About my problem

Chris Pressey cpressey at catseye.mb.ca
Tue May 20 23:41:15 PDT 2003

On Wed, 14 May 2003 10:38:25 +0100
Matthew Seaman <m.seaman at infracaninophile.co.uk> wrote:

> On Wed, May 14, 2003 at 02:18:22AM -0500, Teilhard Knight wrote:
> > [...]
> > I have compiled my kernel. Everything seems to be all right, 
> > except that on boot it cannot mount root.
> > 
> > It displays: "mounting root from ufs:ad2s2a", and a failure message.
> > [...]
> > The HD where FreeBSD is installed is ad2 in my previous kernel and
> > in this new one it is ad1. I have now found out that this is the
> > source of the problem. I checked the partition table, and the slices
> > are called ad2s2a ---> ad2s2g. If this is the case, no way I can
> > mount root on a disk called ad1 with those slices.
> > 
> > So, I'll pose a different question. Do you know of a possible way I
> > can make my new kernel to spot my HD as ad2? To me this is the only
> > solution possible.
> Hmmm... It's not impossible to recover from the situation you're in
> without having to do anything unaesthetic, like re-installing.  It is,
> however, fairly tricky and requires use of some quite unfriendly
> commands.
> Your aim is simply to edit /etc/fstab and change all references to ad2
> over to ad1.  Since the fstab is not correct for your current machine,
> you can't boot to multiuser mode.  You can, however, boot to single
> user mode with the root partition you tell the kernel as above.  After
> power-on, interrupt the 10 second count down, and at the boot loader
> prompt type:
>     set root_disk_unit=1
>     boot /kernel -s
> This should get you to the single user prompt, but with the root
> partition mounted read-only.


Today I found myself in a similar position to Mr. Teilhard, and tried
following this advice...

I installed FreeBSD 4.8RC2 on one computer on an IDE hard drive which
was hooked up as the primary slave (ad1) and later moved that hard drive
to another computer, hooking it up as the secondary slave (ad3) there.

When booting from that drive on the second computer, I got the same
failure message "cannot mount root from ad1s1a".  I tried specifying
"ufs:/dev/ad3s1a" but it would only return error code 6 (iirc).

So, I tried following what I thought would be the logical variation on
Mr. Seaman's advice.  I interrupted the boot process and typed:

  set root_disk_unit=3
  boot -s

To no avail.  Still tried to mount root from ad1s1a.  Same error.

Googling for 'root_disk_unit' I got the impression that it might not
really be necessary under 4.x and that 'set rootdev=disk2s1a' might be
in order.  (The boot sequence informed me that the drive I was trying to
boot off of was indeed seen as disk2 by the BIOS.)  I tried it, and
several combinations of both rootdev and root_disk_unit, with no luck.

(btw, the kernel was GENERIC with the only change being that lnc0 was
commented out (for some reason probing that NIC caused the boot sequence
to go haywire, and I didn't really need it in this case))

Eventually I gave up, unplugged the primary slave (a CDROM,) plugged
the hard drive in as the primary slave, booted off of it, used ee to
change all occurances of ad1xxx to ad3xxx in /etc/fstab, shut down the
machine, moved the hard drive back to the secondary slave, put the CDROM
back in, and, of course, it booted up just peachy.

But I may have to do something very much like this again in the near
future and I might not have the luxury of monkeying with the other
devices next time.  So I'd like to know if I've misinterpreted Mr.
Seaman's instructions, or if there is some subtle magic implied in them
that I'm not picking up on, or what, because they simply didn't seem to
work for me.


More information about the freebsd-questions mailing list