
9 Nov
2012
9 Nov
'12
12:28 a.m.
Robert Moonen <n0b0dy@bigpond.net.au> writes:
Ext3/4 filesystems do not need defragmenting like FAT32 and friends
Wrong. Under pathological cases, ext will get fragmented quickly: specifically, if you repeatedly fill the filesystem as root, or as any user with the reserved space set to 0. After a couple of dozen times, fsck will report a fragmentation level of 30% or so. The fix for this is in userspace: free up some space, then for each file on the filesystem, read it out and write it back. Something like *untested) find /foo -xdev -type f -exec sh -c 'cp "$0" "$0~" && mv "$0~" "$0"' {} \;