Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 30 Jan 2003 08:54:15 -0600
From:      Mike Meyer <mwm-dated-1044370455.459b1d@mired.org>
To:        bastill@adam.com.au
Cc:        Chuck Swiger <cswiger@mac.com>, Giorgos Keramidas <keramida@ceid.upatras.gr>, freebsd-questions@FreeBSD.org
Subject:   Re: Fixit instructions
Message-ID:  <15929.15511.113620.677592@guru.mired.org>
In-Reply-To: <1043907672.3e38c458244c1@webmail.adam.com.au>
References:  <1043728084.3e3606d4a3b6a@webmail.adam.com.au> <15926.3781.54965.702684@guru.mired.org> <1043736426.3e36276aee60a@webmail.adam.com.au> <20030128130709.GA25877@gothmog.gr> <1043800649.3e372249b8066@webmail.adam.com.au> <15927.9781.687511.670713@guru.mired.org> <1043907672.3e38c458244c1@webmail.adam.com.au>

next in thread | previous in thread | raw e-mail | index | archive | help
In <1043907672.3e38c458244c1@webmail.adam.com.au>, bastill@adam.com.au typed:
> Quoting Mike Meyer <mwm@mired.org>:
> > You don't have to boot the fixit cd - just mount it and look. I'm sure
> > that what you will find on the CD is a pretty complete FreeBSD system,
> > with the layout described in the hier man page.
> 
> Close, but...
> root@BAPhD ~ #ls /cdrom
> .cshrc          bin             etc             modules         sys
> .profile        boot            filename.txt    proc            tmp
> COPYRIGHT       cdrom.inf       floppies        root            usr
> CVS-REPO        commerce        kernel.GENERIC  rr_moved        var
> README.TXT      dev             mnt             sbin
> 
> Note the absence of mnt2 and stand, both of which I was aked to examine.  Those
> directories are set up on booting the cdrom and entering Fixit mode.
> bin, sbin and usr/bin on the cd are indeed readable ( and extensive) directly
> from the CD.

Right. Those aren't on the fixit disk, they are on the root file
system used by the boot process. That's a stripped system file system
used for installing FreeBSD. It mounts the fixit cdrom to give you the
rest of the FreeBSD world.

> I don't mean to be difficult or over-demanding about this, especially to people
> who are offering help, but what I was expecting was trhat some helpful guru
> would have prepared a "Fixit Handbook" which might have chapters like "Repairing
> a corrupt partition table" and "Restoring a lost directory" and ...  whatever. 
>  Perhaps the book Chuck suggested would do that.

If such a book exists, I don't know about it. Part of the problem is
that the commands for this only exist at two levels: the
straightforward (you want fsck), and the incredibly baroque world of
hex file editors that you're going to point at the disk. One handles
all the cases you are liable to run into in real life. The other
requires an intimate knowledge of the on-disk file structure, and a
hex calculator - and even then what you are doing is incredibly risky.

> Reading man pages doesn't tell me with any clarity which commands go with what
> do do something.  One really needs far more knowledge than I have to make sense
> of it all.

On the other hand, a "reading guide" might do a lot of good, and makes
a lot of sense. Something that says things like "For problems with DOS
partitions (aka slices), see fdisk(8), boot0cfg(8) and
/usr/include/sys/disklabel.h. For problems with FreeBSD partitions,
see disklabel(8) and /usr/include/sys/disklabel.h. For problems with
the file system, see fsck(8), /usr/include/ufs/ufs/dinode.h and
/usr/include/ufs/ufs/dir.h."

Come to think of it, about the only reason one should be mounting the
fixit CDROM is because your root file system is screwed. I think I
just covered everything you need to know about fixing broken file
systems.

The problem is, that's not complete. You may need to know how to
create dev entries - at least on 4.7. You'll want to know about mount
in order to mount working file systems, and to check the broken file
system once you've fixed it. If the breakage causes you to change
what's mounted where, I tend to fix that in fixit mode with ed, so you
may want to know about that.

Maybe what's needed is an "Essential BSD commands" handbook entry,
that covers the lists the commands available in Fixit mode that are
actually useful for fixing a broken system?

	<mike
-- 
Mike Meyer <mwm@mired.org>		http://www.mired.org/consulting.html
Independent WWW/Perforce/FreeBSD/Unix consultant, email for more information.

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-questions" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?15929.15511.113620.677592>