View Single Post
  #128   Report Post  
Posted to uk.d-i-y
Dennis@home Dennis@home is offline
external usenet poster
 
Posts: 5,168
Default Defraggin LInux (was should DIY be a green cause)

On 26/03/2016 09:28, The Natural Philosopher wrote:
On 25/03/16 21:20, Vir Campestris wrote:
On 24/03/2016 22:43, The Natural Philosopher wrote:
Oh the joys of Linux, and no de fragging ever unless the disk is 100%
full


I've heard this said, and I never can work out how.

If I put 5000 files on my disk, and delete every alternate one, how can
it not be fragmented?

Well of course it is somewhat, but the point is that new files tend to
be written in the middle of the biggest free space, depending on the
actual disk format in use, so they tend to simply grow linearly.

Fragmentation isn't a file in a random place, its a file in dozens of
random places, so to get the entire contents takes many seeks.

http://www.howtogeek.com/115229/htg-...defragmenting/


That link includes

"Because of the way this approach works, you will start to see
fragmentation if your file system fills up. If its 95% (or even 80%)
full, youll start to see some fragmentation. However, the file system
is designed to avoid fragmentation in normal use.

If you do have problems with fragmentation on Linux, you probably need a
larger hard disk. If you actually need to defragment a file system, the
simplest way is probably the most reliable: Copy all the files off the
partition, erase the files from the partition, then copy the files back
onto the partition. The file system will intelligently allocate the
files as you copy them back onto the disk."

So the linux solution to fragmentation is to waste upto 20% of disk
space and to do manual disk defragmenting as was the norm for unix in
the seventies.


Also the way Linux aggressively caches the disk, means that such
fragmentation as there is tends not to be such a performance hit.,


Windows caches a lot, so much so that *you* complain that it uses more
memory than a linux machine.
Linux must be wasting the memory if it isn't using it for cache like
windows does.



Mind, with SSDs who cares anyway?


Indeed.


Andy