1. This forum is in read-only mode.

Small question on formatting

Discussion in 'General Discussion' started by Stanley Richards, Aug 31, 2011.

  1. Stanley Richards

    Stanley Richards Well-Known Member

    I'm really curious as to how formatting and deleting files on a phone or any other device works. Let's say I have a PSP, and I want to delete/format my SD card. Where do the deleted files go to? The same can be said for files that get deleted from the Recycle Bin. Where do they go? Is there a secret compartment in the hard drive that files go to? If that's the case, it doesn't really mean they're DELETED, just moved to a hidden part of the hard drive, right?

    I actually started wondering about this when I began formatting my microSD card ever so often on my phone. Sure I can format my microSD from the phone itself, but I don't know where it'll end up. Data doesn't just disappear, right?
     
  2. tehuber1337

    tehuber1337 Well-Known Member

    Oh man, let me think back.

    There are a couple basic types of file systems. The first only allows for files to be contiguous on the media (eg audio cassettes) - this is faster to read/write, but inefficient at allocating space. Unless you're using an old tape backup system or something (which would only happen in big corporations), you won't be using this.

    The next type lets you allocate data in blocks, with each block pointing to the next. This is very efficient with space, but you need to traverse the media back and forth to access the next block so it's much slower.

    The third type is what we use nowadays. It's also the type I remember the least of, so I may be wrong. Basically we use files (IIRC called inodes) that contain metadata telling us where on the media we can find the real data. This allows for both random access and efficient use of space.

    So, what happens when you "delete" or format something, is that you erase these inodes. This means that you no longer know how to access the data, so the file system considers that space unallocated and free for overwriting. However, until the data is overwritten, it's remains recoverable.
     
  3. Stanley Richards

    Stanley Richards Well-Known Member

    I see... thank you.