To clarify, there are two loader variables,
currdev
and
rootdev
, which can be used to set the root file system (see
loader(8) for details).
The
currdev
variable selects the default device/partition from which the kernel should be loaded and the same root file system be mounted.
Example: The root file system where the variable is set is on disk 1 and the kernel and root file system which should be booted from and mounted is on disk 2, partition 2:
currdev=disk1p2:
(disk counting starts at 0), ZFS
currdev=zroot1/ROOT/default:
(zroot1 pool being here the file system on disk 2).
The
rootdev
variable specifies only the root file system to be mounted, not the kernel to be loaded.
Example: The kernel to boot from and the variable set is on disk 1 and the root file system which should be mounted is on disk 2, partition 2:
rootdev=disk1p2:
.
rootdev
works well with UFS2, on ZFS it doesn't ( tested on 13.1-RELEASE). Neither the kernel nor the root file system specified is hand over as variable to the loader. Instead set
vfs.root.mountfrom="zfs:zroot1/ROOT/default"
.
With the
rootdev
or
vfs.root.mountfrom
variable set, the kernel and and the mounted root file system must have the same version..