Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I know these things about storage devices:

  • They're separated into two parts: the file table and the file data
  • The way these work is dictated by the file system
  • All file systems have a file table and file data
  • The file table can be changed without changing the file data, and vice versa
  • A file can be removed from the file table for a quick delete without actually removing the file's data

So, my question is: when you change the file system on (or "format") a drive, why must all the file data be lost? Can't a computer simply remember the file table and re-create it in the format of the new system?

I'm sure you'd run into some issues with a completely full drive if the new file system requires a larger table than the old system, but other than that, I don't see why this can't be done.

I also know that after a "quick format" (where just the file table is replaced, but the new one is empty) that all the file data is still there and can be recovered with forensic tools.

share|improve this question

migrated from cs.stackexchange.com Jun 23 at 16:29

This question came from our site for students, researchers and practitioners of computer science.

2 Answers 2

up vote 1 down vote accepted

You seem to be thinking that there are two separated, well-defined areas on a storage device: the "file table" (metadata) and the "file data" (data), so you could keep the data area untouched while the metadata area is erased and re-created.

That's not the case. Not only does each filesystem put its fixed metadata in a different place, but also on most filesystems part of the metadata is mixed with the data. This often happens with directories, which are internally treated in a way somewhat similar to a "special file".

For instance, you have FAT32 with its metadata area at the beginning of the storage device, plus directories mixed with the data; NTFS, which IIRC has its main metadata area (the MFT) in a fixed location in the middle of the storage device; the ext family (ext2, ext3, ext4) which splits the storage device in "block groups", each with its own metadata in fixed locations, so you have several metadata areas spread all over the storage device, plus directories stored as special files; and btrfs, which uses a tree structure in which most of the metadata can be almost anywhere.

As you can see, what is data in one filesystem might overlap with what is metadata in another filesystem. To convert from one filesystem to another, not only would the conversion tool have to convert the directory structure, but it would also have to move part of the data out of the way. This can be done (see for instance a conversion from ext3/ext4 to btrfs), but since it's complex and rarely done (most storage devices are formatted once with one filesystem and keep using it for the rest of its life), there's not much incentive to implement it (and test it, which is somewhat important when dealing with your user's data).

share|improve this answer
    
" most storage devices are formatted once with one filesystem and keep using it for the rest of its life" do you have any data on this? I feel like USB drives and micro SD cards are formatted much more often –  Supuhstar Nov 25 at 15:23

when you change the file system on (or "format") a drive, why must all the file data be lost?

It doesn't have to be. Normally formatting a drive is done to initialize a new drive with no data or discard the data that was on it.

Should you have a storage media with data on it you could easily change the file system structure from one to another (e.g. FAT -> ext3) in any number of ways. This is not done very often by end users nor in multi-user environments. The approach varies depending on details you did not provide. Note that not all your assumptions are necessarily valid.

To learn more about file systems checkout http://en.wikipedia.org/wiki/Filesystems.

share|improve this answer
    
Cool! How would one go about doing so? –  Supuhstar Jun 24 at 17:03
    
I never have. I rarely change file systems on a device that is in use; if I had to then I would back-up the volume, change the file-system, and restore the volume. –  Ram Jun 24 at 22:36
1  
Converting from FAT to NTFS with preservation of data is supported out-of-the-box by Windows. I used it a couple of times on systems that were installed on a FAT partition. –  Berend Nov 25 at 11:50

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.