newbie documentation (was: Re: Contributing to FreeBSD documentation (was: Re: no ath0 on new system with good card))

Doug Barton dougb at FreeBSD.org
Mon Jan 22 00:48:39 UTC 2007


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Steve Franks wrote:
> I have another section to add to my previous post:
> 
> At some point in your dealings, you may introduce a typo into a
> critical startup file,  such as rc.conf, loader.conf, fstab, or
> similar, and reach the following upon reboot:
> 
> "...."
> "Press enter for /bin/sh:"
> 
> To recover:

While it's always nice when someone takes an interest in improving our
documentation, what you have below is missing some key ingredients.

> 0. press enter
> 1. cd /etc
> 2. cat fstab (if you don't know the partitions & disks to mount already)

It's very possible that cat won't be in your path when you do this, so
you might have to say /bin/cat. Similarly throughout the rest of your
post.

More importantly, it's crucial to run at least 'fsck -p' before trying
to mount anything. If the only things you'll be mounting are in fstab
already, that's all you have to type. If you need to mount something
that isn't in fstab, you'll have to specify it by device, such as
'fsck -p /dev/ad2s1e'. If the prune isn't enough, then you will have
to do 'fsck -y /dev/<blah>' for anything that didn't come up clean.

> 3. mount /dev/adXs1Y /usr (gives you the edit command) (find X and Y
> in your fstab file)
> 4. mount /dev/adXs1Z / (gives you write acess to /etc) (find X and Z
> in your fstab)

First, if the slices you're mounting are in your fstab, you don't have
to specify the device name, just 'mount /' is enough. Second, you
should always mount the / partition read/write before you try to mount
anything else.

Assuming that all your slices came up clean after fsck, it is probably
simpler to do 'mount -a' (or 'mount -a -t nonfs' if you have NFS
mounts in your fstab without the noauto flag) than to type them all
out by hand.

> 5. edit blah ( i.e. rc.conf) to fix the typo
> 6. init 6

You're much better off to just type 'exit' when you're done fixing
stuff. That will take you out of the subshell, and back into the
normal rc startup process.


Hope this helps,

Doug

- --

    This .signature sanitized for your protection
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (MingW32)

iD8DBQFFtAOeyIakK9Wy8PsRAiiyAJ92/0/nYm7d952zEglKoDF0KOvcQQCfTS51
TwAQySkJy3SPd6vIZMNSXI8=
=Ye1F
-----END PGP SIGNATURE-----


More information about the freebsd-questions mailing list