Disk fragmentation

Paul De Bra debra at alice.UUCP
Thu Sep 15 11:05:08 AEST 1988


Richard Ronteltap is a bit overly enthousiastic about fsck -S as
the tool for avoiding fragmentation.

What fsck -S does is rearrange the list of FREE BLOCKS in such a
way that newly create files will be less scattered over the whole
disk. fsck -S does NOTHING to existing files.
 
You can do it safely, only on unmounted file systems.
To fsck -S root: first go into single user mode (kill -1 1, and then
type root password when asked to).
Then (umount all other file systems and) sync; sync the disk.
Then run fsck -S on the root file system.
Then press the hardware reset button on the computer or power-cycle.
Do NOT use /etc/haltsys in this case, because that will write the
old in core superblock onto the newer superblock created by fsck.
(When rebooting, the root file system will be checked again.)

fsck -S does not turn an old file system into a new one. But if one
starts with a new file system and goes through this procedure once
every day or so, these few minutes or seconds will slow down the
fragmentation considerably. We started this routine a few years ago,
on a rather busy machine, and after three months the file systems
were still in good shape, whereas before the Unix system would become
noticeably slower after about a month or so.

The Berkeley fast file system and the 9-th edition Unix 4k file system
perform "fsck -S"-like actions all the time, and don't degrade as
quickly. Hopefully future releases of Xenix will include a similar
approach.

Paul.



More information about the Comp.unix.xenix mailing list