Can't boot from ad4: Device Not Configured?

Tim Kientzle kientzle at acm.org
Fri May 9 14:26:54 PDT 2003


Brooks Davis wrote:

> On Thu, May 08, 2003 at 01:37:42PM -0700, Tim Kientzle wrote:
>>b) It doesn't get that far.
>>   (The root hasn't yet been mounted, so the
>>   contents of /dev would seem to be immaterial.
>>   If you can't read the disk, it doesn't really
>>   matter what's on it. ;-)
> 
> Before root is mounted for real, it is actually mounted.  /sbin/init
> attempts to remount / properly using the device listed in /etc/fstab
> and will fail to mount it if the entry does not exist in /dev.  I ran
> into this exact problem (ad4 and everything) before when I moved my root
> disk to a PCI ATA controler.  As I recall the two issues I had where a
> bogus fstab entry and not creating all the necessicary entries to get
> ad4s1a in /dev.


Hmmm...  Editing /etc/fstab before moving the
disk does seem to work, but looking through
sys/kern/vfs_conf.c convinces me there's
a bug in here somewhere.  As far as I can tell:

* It is really the _loader_ that reads /etc/fstab
   to get the root device name.  This name is then
   passed to the kernel.

* The kernel tries several different devices in an
   attempt to mount the root filesystem.  This includes
   the value provided by the loader, a variety of
   optional compiled-in defaults, and finally, a
   value typed by the user.

* This last option does not work and it should.
   It's not clear why vfs_mountroot_ask() never
   works, but it doesn't.

Based on the code, you should be able to take a
bootable disk from ad0, move it to ad4, boot it,
get a kernel "Root mount failure" message,
type in the real root device at the prompt, and
get to single-user mode.

That this doesn't work concerns me:  If
my separate IDE controller blows up and I have
to plug the drive back in as ad0, I'm going
to be in big trouble if it won't boot.  :(

Tim Kientzle



More information about the freebsd-stable mailing list