On Wed, Apr 18, 2001 at 09:48:34AM +0200, Pieter De Wit <[EMAIL PROTECTED]> wrote:
| How do I/Do I need to defrag my Linux box ?

Most modern filesystems endeavour to fragemnt very little. There isn't
a defrg for the ext2 fs I know of. The "standard" way to defrag a
filesystem is to dump it to a medium such as a tape (or, of course,
to another filesystem - just copy the tree over or make a tar file),
make a new, empty filesystem in the old place, mount it and copy the
old contents back. In short:

        - unmount filesystem
        - mount read-only
        - copy data
        - unmount filesystem
        - mkfs a fresh filesystem (eg via mke2fs)
        - mount new, empty filesystem
        - copy data back

Fsck reports the amount of fragmentation. If it's low, don't worry about it.

The fiddliness of all this is one reason to keep your dynamic data on
separate partitions from your OS and apps. Hence / and /usr for OS and
apps, and /home or suchlike for the user stuff.

| How can I "force" a volume
| check. Coming from a M$ background defraging a volume is quite important as
| far as I know (My server is used to as a temp storage for a lot of things,
| hence the frags)

The volume check (well, filesystem - in UNIX "volume" tends to mean
"partition") command is fsck. It has a manual entry. You will find
it doesn't directly mention a "force" mode, but does point the way to
e2fsck (the particular checker for the ext2 filesystem, which is the
usual Linux one). "man e2fsck" reveals the -f flag. So:

        # change "hdc" to whatever the device is - see /etc/fstab
        e2fsck -f /dev/hdc

DO NOT run e2fsck on a volume which is currently mounted.
-- 
Cameron Simpson, DoD#743        [EMAIL PROTECTED]    http://www.zip.com.au/~cs/

Neurotoxin Lite!  Tastes great. Less writhing & drooling.



_______________________________________________
Redhat-list mailing list
[EMAIL PROTECTED]
https://listman.redhat.com/mailman/listinfo/redhat-list

Reply via email to