LWN.net Logo

Resizing and defragmenting Linux filesystems (NewsForge)

Resizing and defragmenting Linux filesystems (NewsForge)

Posted Oct 13, 2003 23:50 UTC (Mon) by welinder (guest, #4699)
Parent article: Resizing and defragmenting Linux filesystems (NewsForge)

Enlighten me, please.

Why isn't defragmenting a matter of

  • Telling the user not to write of the partition in the meantime.
  • Identifying fragmented files.
  • Copying each fragmented file to a new place (in one piece) and mv-ing it back.


(Log in to post comments)

Resizing and defragmenting Linux filesystems (NewsForge)

Posted Oct 14, 2003 3:55 UTC (Tue) by hisdad (subscriber, #5375) [Link]

Because thats easier to say than do.
I doubt if anything other than special tools can do it.
You can't even find if a file is fragmented from normal system calls.
Sparse allocation makes it worse. If you copy a sparse file you will un-sparse it.

--dad

Copyright © 2008, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds