Recurring problem in root filesystem

Conor P. Cahill cpcahil at virtech.uucp
Tue Sep 4 22:22:38 AEST 1990


In article <15590:Sep402:41:0190 at kramden.acf.nyu.edu> brnstnd at kramden.acf.nyu.edu (Dan Bernstein) writes:
>In article <4010 at auspex.auspex.com> guy at auspex.auspex.com (Guy Harris) writes:
>> >Try running fsck on the *unmounted* root filesystem,
>> Try unmounting the root filesystem first.  Good luck....
>
>Wait a minute. Can't you chroot() to another filesystem, then remount
>the original root below the new one? I haven't tested this but it seems
>like it should work on an otherwise unused system.

You can't remount root because you can't unmount root because your chrooted
environment is below the real root file system and therefore makes
the root file system busy.  chroot() does not make any file system 
changes it only places acts as a starting point for pathname resolution in
namei() or lookupname() (the kernel routines that resolve pathnames) when
the first character of the file name is '/'.

The problem is that fscking a mounted file system is that fsck may find 
things that are wrong when they aren't really wrong and may fix things
that get written over if the kernel syncs before you reboot.

Fscking root is yet another chicken and egg problem.  (although some
late system V.3s allow root to be fscked and remounted without rebooting
if there is little or no damage to the root fs).  This problem is usually
resolved by one of the following:

	a: boot off another device (different partition or different media)
	   fsck the real root and then reboot

	b: fsck root, reboot no sync, fsck root, if still problems reboot
	   no sync and try try again

One of the big reasons for continuing to have problems on your root partition
is that it cannot be unmounted due to some other problem in the system (like
you have another file system that is not being unmounted (but it too
would have fsck problems) or a process that gets stuck in never-never land
because of a bug in a device driver, etc)

-- 
Conor P. Cahill            (703)430-9247        Virtual Technologies, Inc.,
uunet!virtech!cpcahil                           46030 Manekin Plaza, Suite 160
                                                Sterling, VA 22170 



More information about the Comp.unix.questions mailing list