How Linux writes/deletes from a hdd
This isn't a problem just something i'm curious about. I couldn't find anything decent by searching google. I know all about controlling Linux but im still new when it comes to how Linux actually works.
Ok so I know when Windows deletes a file it actually just puts that space on the disk open to be written over. This causes fragmentation because if a file larger than that space is written to it, it has to split the file up and put the other part of the file in a different space. Apparently Linux doesnt fragment your hard drive. So what does Linux do different? Atleast for ext2/3/4 formatted drives if that makes a difference. Does Linux save data differently depending on the filesystem? Im used to FAT/NTFS where nothing has changed accept the layout that's written to has changed and now treated differently so you can write files over 2/4GB. That and the information of the file is written with the cluster. I only know of the ext file systems for Linux which I assume are the most popular. I would appreciate your time. |
Not sure exactly how accurate this is, but it was my understanding also at one point when I had a similar question.
|
I think you are asking about the behavior of different filesystems. In general, I think block devices all have some similar paradigms---eg inodes setup with fixed sizes, data not erased but blocks (inodes) simply being dereferenced, etc.
There's a recent thread that talks about how to see what is written to the disk in different situations--I posted something showing how a modified file gets saved to a new physical location, but the old file is still there (but dereferenced) (I can't find the thread) |
All times are GMT -5. The time now is 03:20 PM. |