Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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.

share|improve this question
    
/etc/disktab and bsdlabel -B? /boot/kernel.conf? –  Mikel Mar 22 '11 at 3:34

3 Answers 3

up vote 1 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.

share|improve this answer

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)

share|improve this answer

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.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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