This is an old revision of the document!


You have an ad0 disk. Create one slice covering the entire disk:

# fdisk -BI /dev/ad0

Initialize the BSDlabel:

# bsdlabel -wB /dev/ad0s1

Edit your label and create a small (like 256MB-512MB) 'a' partition and use the rest for the 'd' partition:

# bsdlabel -e /dev/ad0s1

The 'd' partition will be used for ZFS:

# zpool create tank ad0s1d

Create a UFS file system on /dev/ad0s1a and copy the /boot/ directory onto it:

# newfs /dev/ad0s1a
# mount /dev/ad0s1a /mnt/tmp
# cp -Rp /boot/* /mnt/tmp/

Note that there is no /boot/ directory on ad0s1a yet. This is one of the two possibilities. You now need to create a symlink:

# cd /mnt/tmp
# ln -s . boot

From what I checked our loader should handle symlinks just fine. This will allow us to mount /dev/ad0s1a on /boot directory and use it as usual.

Another option is to:

# cp -Rp /boot /mnt/tmp/

and in the future mount /dev/ad0s1a on eg. /bootdisk and create symlink:

# ln -s bootdisk/boot /boot

All in all, you should see your kernel when you do:

# ls -l /mnt/tmp/boot/kernel

Now don't forget to add zfs_load=“YES” to /mnt/tmp/boot/loader.conf.

Ok, you also need to tell your loader where your root file system is. You can do it by adding:

vfs.root.mountfrom="zfs:tank"

to /mnt/tmp/boot/loader.conf or you can create /mnt/tmp/etc/fstab file with one entry only:

tank /       zfs     rw      0       0

On your ZFS file system, your /etc/fstab should contains the line above and:

/dev/ad0s1a  /boot   ufs     rw      0       0

(and everything else, ie. your swap and other file systems)

At the end, set mount point to 'legacy' so ZFS won't try to mount it automatically:

# zfs set mountpoint=legacy tank
  • zfsonroot.1177537021.txt.gz
  • Last modified: 2007/04/25 21:37
  • by PawelJakubDawidek