Wilfully dirtying a filesystem

Dan Nelson dnelson at allantgroup.com
Thu Aug 17 19:21:31 UTC 2006


In the last episode (Aug 17), Ceri Davies said:
> On Thu, Aug 17, 2006 at 02:58:03PM -0400, Jerry McAllister wrote:
> > > Thursday, August 17, 2006, 6:55:08 PM, Ceri wrote:
> > > > I have a system on which /usr is slightly hosed, but not badly enough
> > > > for it to fail a preen fsck.
> > > >
> > > > I cannot easily get to single-user on this machine, so is there
> > > > a good way for me to dirty the filesystem just enough to force
> > > > "fsck -p" to fail (yanking power also difficult)?  "umount -f
> > > > /usr; reboot" doesn't seem to work...
> > 
> > Is 'fsck -f' not a possibility?
> 
> No, because I can't unmount /usr.

What kind of setup do you have where you can't get to single-user mode,
but you apparently want fsck -p to fail (which will put you in
single-user mode)?

If you have a serial console that doesn't kick in until after the
kernel is initialized, just hitting ^\ a couple times during the bootup
sequence should get you your "Enter pathname of shell" single-user
prompt.  You could also put an "exit 1" at the top of /etc/rc and
reboot; just make sure to remove it when you want to continue to
multiuser mode :)

-- 
	Dan Nelson
	dnelson at allantgroup.com


More information about the freebsd-questions mailing list