Re: e2fsck...

Riccardo Facchetti (fizban@tin.it)
Thu, 12 Nov 1998 16:52:39 +0100 (MET)


On Thu, 12 Nov 1998, Mofeed Shahin wrote:

> So let me get this straight, If I want to check my file system for errors
> there is no problems, but if I want to fix any errors found I have to
> reboot via a boot disk, and then e2fsck the now unmounted drive ?
>
> If true (makes sense since it is a multitasking environment), then this is
> not so good for my internet gateway, which may have some corruption.
> But hey no use winging about it.

The problem with fsck'ing mounted fs'es is that you may check a non up to
date (but perfectly valid) filesystem so doing any kind of fsck on mounted
filesystems is bad in the first place.
If you want to fsck a filesystem without rebooting your machine you have 2
ways:

1) umount the partition and then fsck it (here you can have problems with
running processes that may have open files on the to-be-umounted fs.
2) remount the partition read-only and then fsck it.

The third option is to go single user (tipically runlevel 1) and fsck.
A fourth option can be to boot with a floppy and then fsck.

There are no other ways that come to mind to safely fsck a partition.

Ciao,
Riccardo.

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/