I had the following scenario:
I intalled FreeBSD 10.1 USB .img
file to 1GB stick and installed FreeBSD to the 16GB stick. 1GB stick was recognized as /dev/da0
, and the 16GB stick as /dev/da1
. FreeBSD was installed to 16GB stick under /dev/da1s2a
. Then I removed 1GB stick and—normally—cannot boot to FreeBSD system automatically. The system said that cannot boot to vfs.root.mountfrom="/dev/da1s2a"
, but offered me to manually boot into FreeBSD, so I had to change the boot slice to /dev/da0s2a
, and it worked. Off course, I don’t want to do it manually, so I found this post.
It inspired me to search for the location of variable vfs.root.mountfrom
, so I remoot the system, pull out the 16GB stick, put back the 1GB stick, boot from it as a Live CD. At this point, I put back the 16GB stick, mounted it (mount /dev/da1s2a /mnt
) and searched for "vfs.root.mountfrom". My findings were:
- DO NOT CHANGE the
/boot/loader.conf
file!
- DO NOT CHANGE the
/boot/defaults/loader.conf
file!
Since doing those things will mess up the loader!
The solution was to tweak the /etc/fstab
on the /mnt
(16GB stick) changing the entry /dev/da1s2a
to /dev/da0s2a/
as the loader is looking the fstab
for file systems in fstab
during booting and automatically write the value of the vfs.Root.Mountfrom
variable!!!
So during reboot I removed the 1GB stick and the machine successfully booted up the FreeBSD!
/etc/disktab
andbsdlabel -B
?/boot/kernel.conf
?