Trouble Shooting & Disaster Recover


Table of Contents

fsck and runlevel probs 
fsck and runlevel probs 
What's the problem with my file system? 
What's the problem with my file system? 

fsck and runlevel probs 

Newsgroups: comp.os.linux.setup
Date: 5 Jan 2003 18:15:18 GMT
> When I type umount /dev/hda8 it either returns unknown filesystem or
> filesytem in use. I thought runlevel 1 allowed access to disks without them
> being in use for the particular purpose of fsck etc.

If hda8 is your / try 'touch /forcefsck' then reboot. Your fs checker should then run at boot.

fsck and runlevel probs 

> >> checker should then run at boot.
> >
> > If hda8 is the root fs, just remount it read-only and run fsck
> > on it.  Then remount it read-write and change the runlevel back
> > to 3 or whatever it was.  There is no need to reboot.
>
>In read-only mode, fsck will only be able to find errors, not correct
>them.  To correct any errors, fsck needs write access as well.  Right?

It doesn't work _through_ the filesystem, but _on_ it, via direct access to the device special file. Hence the permissions on /dev/hda8 are what makes a difference, not whether it is mounted read/write.

The point in remounting is to allow fsck to be run on the root filesystem without having to reboot the system from a rescue disk. It would also work on other filesystems, but they can be unmounted. The problem with running fsck on a mounted filesytem is that the kernel will flush its buffers, which contain the same errors as the physical disk, back to the disk after fsck has corrected the errors, thus replacing the corrections with the same old errors. It won't do that if it is mounted read/only, so that is the equivalent of just unmounting the filesystem.

Floyd L. Davidson