Click here to Skip to main content
15,890,882 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I want to create a file wiping application that support different file system. so the deleted file cannot be recovered by recovery software. First of all, I want know the partition' file system type that the file stored. I want to find the partition attribute in the partition table or partition boot sector, but I cannot find the partition marker in partition table or partition boot sector. Can you gave me some addvice, thank you
Posted

It is not stored in the file system in the sense that I think you mean. The operating system keeps track of it. If you have a disk with 4 partitions as you describe, and have 2 or 3 Windows operating systems on the drive, each operating system 'instance' will have its own opinion of which is C:, D:, E: and F:.

tl;dr: Ask the operating system which is which.
 
Share this answer
 
As far as I can tell the traditional DOS style Windows Drive letters, C: D: E: etc are not stored anywhere on the disk. Each partition has a number starting at 1 assigned by the appropriate low level subsystem. On boot drive letters are assigned to the partitions of disk drive devices based possibly on partition numbers beggining with the letter C:. A: and B: are reserved for or assigned to 1 or 2 floppy drives.

I don't know but it would be interesting to determine how partition numbering works in a mixed IDE/SATA environment or how it interacts with the overlapping NTFS concept of Volumes. The 'magic' code which makes 'E:' pop up in Explorer when I insert a new disk device such as a USB mass storage drive is actually very difficult to replicate and I don't believe Microsoft have ever fully disclosed how they achieve this. I would steer clear of trying to work with or from drive letters if you can avoid it.

To get such low level information on NTFS as it looks like you'll need the best way may be to go to the source code for a Linux tool like GPartEd. FAT is supposed to be a public specification so perhaps you can get official docs on that.
A lot of Volume information like what sort of file system is on a Volume can be retrieved through WMI but there are or were frustrating holes in that information like missing RAID and mirroring data, no good deleting one copy of a file only to have system 'recover' it for you.

P.S. If you don't already have the Microsoft DDK (preferably latest and original Win2K version) then you will need it. There are low level disk related constants and definitions in there that are not MSDN documented or available in the platform SDK including some pretty simple user level things like device change message ids.
 
Share this answer
 
v2
Comments
H.Brydon 3-Apr-13 0:01am    
I can't speak for recent Windows operating systems, but with Windows 2000, I had a machine that had a number of SCSI and IDE disks, several of them bootable. In each case, the boot drive was always C: and the other disks were D:, E:, F: (almost exactly as OP asked the question). The D: drive for example was different between the 2 ways the machine booted.

You can also change the letter drive corresponding to a partition. Go to desktop, right click Computer -> Manage, Disk Management. You can click on a partition and change its drive letter. The setting is persistent within an operating system instance.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900