Andrei Ivanov wrote:
> 
> Any way to defrag the partition? defrag does not seem to be working, it
> gives me error message:
> bad magic number in super block
> 

Andrei, this error also got me a while back when I tried out defrag,
and as usual, reading the man page turned out to be a good idea :-)

To defrag an ext2 partition you need to use the command 'e2defrag
/dev/xxxx'. 'defrag' is for the minix file system which is why you get
that error. Also note what the man page says about running defrag on a
mounted and/or a bootable partition.
 
Another way to "defrag" it (and the way I prefer) would be to copy the
contents to another partition, re-format the original partition, and
then copy back again. 

I always keep a bootable backup of my Debian partition (I use just one
partition plus a swap partition), and occasionally will do the above,
even though I've never found that fragmentation was any particular
problem in Linux. Of course it's a good idea to run fsck on the file
system first to check for and fix any errors.

This mini-HOWTO gives a procedure (and a few variations of it) for
copying a partition with the cp command. 

http://metalab.unc.edu/LDP/HOWTO/mini/Hard-Disk-Upgrade.html

Tom

Reply via email to