Review your favorite Linux distribution.
Go Back > Forums > Linux Forums > Linux - General
User Name
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.


  Search this Thread
Old 07-29-2009, 08:36 AM   #1
LQ Newbie
Registered: Jul 2009
Distribution: Arch Linux
Posts: 6

Rep: Reputation: 0
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.

Last edited by tkbonito; 07-29-2009 at 08:40 AM.
Old 07-29-2009, 10:53 AM   #2
LQ Guru
Registered: Dec 2005
Location: Somewhere on the String
Distribution: Debian Wheezy (x86)
Posts: 6,094

Rep: Reputation: 271Reputation: 271Reputation: 271
Not sure exactly how accurate this is, but it was my understanding also at one point when I had a similar question.
Old 07-29-2009, 11:21 AM   #3
LQ Veteran
Registered: Nov 2005
Location: Annapolis, MD
Distribution: Arch/XFCE
Posts: 17,802

Rep: Reputation: 737Reputation: 737Reputation: 737Reputation: 737Reputation: 737Reputation: 737Reputation: 737
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)


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Reduce HDD writes? Cyberman Linux - Hardware 1 09-29-2008 02:49 PM
FC6 Server Randomly Writes Data To HDD jmoschetti45 Linux - Server 6 05-22-2007 03:16 PM
Gnome 2.6, odd hdd writes. slackMeUp Slackware 11 10-07-2004 02:42 AM
Windows installation deletes Linux? SuSE_User Linux - Newbie 3 03-28-2004 04:26 AM
(Foolish linux user deletes block device) Zander Linux - General 3 02-15-2004 11:40 PM

All times are GMT -5. The time now is 10:23 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration