Changing boot disk bus connections/settings?

David Marsh drmarsh at
Sat Jan 29 03:50:16 GMT 2000

I've just finished a rather long hack-sesh..

My FreeBSD box has two hard disks in it (the original, and a newer, bigger,
faster, cheaper (;-) etc) one..

My original installation of (an older version of) FreeBSD was on the old
hard disk, and my current version (3.2) is on the newer hard disk (so done
to make a fresh install, and to avoid any potential hassles with
upgrade-in-place or a.out->ELF transition).

The new hard disk was (until today) the master disk on IDE-0 (wdc0/wd0), and
the old hard disk was the master disk on IDE-1 and didn't really get much
use any more (I was meaning to clean out my old user files and use it as
additional storage - but I still ain't filled up the new disk ;-)

For various complicated reasons (after having spent the whole day (good job
I had today off ;-) messing around), I realised that I needed to make the
_old_ hard disk the master disk on IDE-0 again.

Anyway, I was quite chuffed that I did manage to reinstall the boot manager
onto the new hard disk (*now* on IDE-1, disk wd2), and get FreeBSD working
again in its "new home". Admittedly, there was a lot of faffing around with
the install floppies to get things working!

First off, I had to suss out the newer boot manager, which doesn't appear
to be as helpful as the old one (which displayed the boot options in depth
before booting). A bit of trial and error revealed that I had to type:
   set root_disk_unit=2   in order to get FreeBSD to find the 'new' location
of the root partition (wd2s2a) (since the disk names change when they are
connected to a different IDE bus), otherwise it was booting its way through
the kernel (?) and then failing to find the root partition where it 
expected it.

Is there anywhere that I can have the 'set root_disk_unit=2' stored

I'm not entirely sure what actually happens during the boot process.
Obviously the kernel is being booted after the boot manager chooses a
partition to boot from - but how come the boot manager can find the kernel,
yet the kernel can't find the root partition once it boots itself up
(without the use of the variable above)? Is the location of the
root partition something that is compiled into the kernel? (I haven't made a
new kernel - I'm still running with the 'factory version' (shame on me)).
Will I have to make a new kernel to allow my non-standard boot process to
work properly, or is it possible to 'permanently configure' the boot manager
with the above variable somehow?

The second issue was that upon loading the kernel, and starting up, the
system then found that the hard disks had moved (surprise!). Yep,
/etc/fstab still had the old disk partition names in it, of course.
Easy to fix, I thought. But no. Because the boot process hadn't completed
properly, / was mounted read-only, and I couldn't edit the file. The only
way I could find to get around this was to copy the 'fixit' floppy from the
CDs, boot with the boot floppies and then crank up the 'emergency
holographic shell' (ROTFL!) from the fixit floppy, and mount the root
partition from there. That seems a rather long-winded way to go about
it (especially since, if I read things correctly, you're supposed to have
to make a fixit floppy specific to your kernel configuration). Anyway, this
seems to have worked, otherwise I wouldn't be typing this message :-)  Did
I go about doing this the right way, or is there an easier way to access the
filesystem in a writable state under such circumstances?

(And a final idle-curiousity question: what files are actually on the root
partition, and which are on /usr? How can you tell where one stops and the
other starts? Since everything is placed under "/", I'm not sure how I can
tell what actually really lives where..)

Thanks for any advice,


David Marsh,drmarsh at |          |
Glasgow/Glaschu, Scotland.      | If urgent, phone: +44 77-121-848-90 |
>CYCLEWAY: cycle activism GB/IE: <
>Trim quotes b4 replying; Quote 1st, reply 2nd; Ask b4 attaching files<

More information about the Ukfreebsd mailing list