[techtalk] Disk utilities under Linux

Conor Daly conor.daly at oceanfree.net
Mon Oct 9 12:23:44 EST 2000


On Mon, Oct 09, 2000 at 01:18:37AM -0500 or so it is rumoured hereabouts, 
Jeff Dike thought:
> MSYBlood at aol.com said:
> >  I'm  wondering what disk utilities are available under Linux--or are
> > they  necessary?  For instance what about a disk defragmentation
> > utility like  Norton Speed disk?
> 
> As far as I understand, they're not really necessary.  The ext2 filesystem 
> isn't as prone to fragmentation as fat-based filesystems.
> 

There are significant differences between Windows/DOS and Linux/UNIX as
far as filesystems are concerned.  The primary difference is that Windows
is a single-user system while linux is multiuser.  This has implications
for you using a direct disk access program like Speed Disk (Linux
equivalent fsck (actually, Speed disk and Scan disk rolled into one with
probably a bit more on the side!)) while another user is writing to the
disk.  For example, suppose speed disk has read a cluster from the disk,
moved it elsewhere, then read aonther cluster to put back where the first
one was (You've watched Speed Disk in action right?).  Now before it
writes back the second cluster, another user saves a file to disk which
gets written to the location Speed Disk is about to write to, then speed
disk writes it's cluster to disk.  Since Speed Disk is using direct disk
access rather than the filesystem interface, the other user's file gets 
corrupted. 

Alternatively you can lock the filesystem while you Speed Disk in which
case all the other users complain. 

The usual method for Linux is to run fsck on all filesystems at boot time
*before* they get mounted for multi-user mode.  This is fine for
multi-boot Win / Linux systems where a reboot happens regularly but it can
be a problem for server systems that remain up (There's a BSD, I think,
box out there that's been up for 5 years without a reboot!
(www.uptimes.net))  If you have your partitions set up correctly on your 
server, you can unmount /home and /var temporarily to do an fsck.  These
are the two directories most likely to have fragmentation problems while /
/usr /lib etc will change rarely if at all.  

If you are installing your Linux system or are happy to reinstall, you
could split your disk space into at two or more partitions with, at
minimum, /home on a seperate partition.  That way, /home fragmentation can
be dealt with without needing to take down the entire system.  More
convenient for system upgrades etc also since your data is safe on /home
when you reformat / at upgrade time...

-- 
Conor Daly <conor.daly at oceanfree.net>

Domestic Sysadmin :-)




More information about the Techtalk mailing list