I installed FreeBSD 8.1 on a machine where the drive was /dev/ad6 but have moved it to a new system where the drive is now /dev/ad4. The new system boots but I need to manually specify that the root file system is on ad4s1.

How can I change the boot loader to do this automatically? Googling around turns up examples of disklabel -e being able to change the disk number, but I only get "Class not found" errors and no disk label changes with this method.

link|improve this question

/etc/disktab and bsdlabel -B? /boot/kernel.conf? – Mikel Mar 22 '11 at 3:34
feedback

3 Answers

I think you want to change /boot.config.

See the boot.config man page.

It suggests you want something like

echo "1:ad(4,a)/boot/loader" > /boot.config

But cat the file first to see what /dev/ad6 is, then figure out what /dev/ad4 should be.

link|improve this answer
feedback
up vote 0 down vote accepted

Using sysinstall (Configure > Label) allowed fixing the disk label. One oddity was that the editor came up with the correct disk number (i.e. ad4), but selecting W wrote out the correct label and fixed the boot problem.

link|improve this answer
feedback

The file /boot/loader.conf contains the instructions on which filesystem to mount as root.

Check this file for an enrty:

vfs.root.mountfrom="ufs:ad6s1a"

and tweak it (or add it if it's missing) to read:

vfs.root.mountfrom="ufs:ad4s1a"

(that is assuming partition a of slice 1 of device 4)

link|improve this answer
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.