Table of Contents
Begin installationPartition the drives (GPT or MBR)
Create mirrored ZFS filesystem
Finish installation
Finish installation
On the last installation screen choose shell again when asked.
Create system init configs
# echo 'zfs_load="YES"' >> /boot/loader.conf # echo 'vfs.root.mountfrom="zfs:system"' >> /boot/loader.conf # echo 'zfs_enable="YES"' >> /etc/rc.conf
Create fstab file
/etc/fstab (GPT)
# Device Mountpoint FStype Options Dump Pass# /dev/cd0 /media/cdrom cd9660 ro,noauto 0 0 /dev/da0s1 /media/flash msdosfs rw,sync,noauto,longnames,-Lru_RU.UTF-8 0 0 /dev/ufs/share /share ufs rw 1 2
/etc/fstab (MBR)
# Device Mountpoint FStype Options Dump Pass# /dev/cd0 /media/cdrom cd9660 ro,noauto 0 0 /dev/da0s1 /media/flash msdosfs rw,sync,noauto,longnames,-Lru_RU.UTF-8 0 0 /dev/ufs/share /share ufs rw 1 2
ZFS filesystems does not need fstab entries. Adjust flash mount options as you want.
Create mount points:
# cd /media # mkdir cdrom flash # cd / # mkdir share
I have only one UFS filesystem — /share. If you don't have any then skip the step. Or create mountpoints and fstab entries for filesystems you have.
Note that I use /dev/ufs/share as the device. If your UFS2 filesystem does not have a label than it's time to create one:
# tunefs -L share /dev/ada3s1d
Reboot into your new system
Type exit, finish the installation and reboot. Set BIOS to boot from one of the mirrored drives.
Login to the system and:
# zfs set readonly=on system/var/empty # rm /etc/motd
Create swap (eight gigabytes here — change it):
# zfs create -V 8G -o org.freebsd:swap=on -o checksum=off -o compression=off \ -o dedup=off -o sync=disabled -o primarycache=none system/swap # swapon /dev/zvol/system/swap
Now you can start configuring your new system. Have a look at Initial configuration article.
Hi ross,
It didn't work for me.
First the boot loader wouldn't find the right partition to boot from. It searches on the second partition which is the swap.
If I manually enter the root partition and there the kernel it freezes.
If I boot with the installation usb stick I can see the pools I created but they are all faulty.
If I do a "zpool status" I see that they are still refering to xxx.nop devices which do not exist after reboot.
If I recreate the "nop" device I can use the pool.
Probably that is the cause of all problems and I don't know how to fix it.
It didn't work for me.
First the boot loader wouldn't find the right partition to boot from. It searches on the second partition which is the swap.
If I manually enter the root partition and there the kernel it freezes.
If I boot with the installation usb stick I can see the pools I created but they are all faulty.
If I do a "zpool status" I see that they are still refering to xxx.nop devices which do not exist after reboot.
If I recreate the "nop" device I can use the pool.
Probably that is the cause of all problems and I don't know how to fix it.
Thanks
Nice howto. Everything went fine for me. Thanks a lot!
Very well written. It has worked perfectly for me and now this is my favourite when I do a ZFS mirror install.
Oh my god i did it! U r my sensei! Thanks a lot!
Hi, ross
Help plz.
I did every step of GPT way.
But bootable device not found after reboot.
How can I fix it? Any idea?
thx
Help plz.
I did every step of GPT way.
But bootable device not found after reboot.
How can I fix it? Any idea?
thx
Are you sure you have created freebsd-boot partition and installed bootcode to it, just like here https://daemon-notes.com/articles/system/install-zfs/gpart ?
parameter -i to the "gpart bootcode" command is actually the partition number
parameter -i to the "gpart bootcode" command is actually the partition number
Yes, I did it.
I have active EFI. Could it possible reason for my fail?
I have active EFI. Could it possible reason for my fail?
these commands for MBR or for both GPT and MBR?
I meant:
# dd if=/boot/zfsboot of=/dev/ada1s1 count=1
# dd if=/boot/zfsboot of=/dev/ada1s1a skip=1 seek=1024
# dd if=/boot/zfsboot of=/dev/ada2s1 count=1
# dd if=/boot/zfsboot of=/dev/ada2s1a skip=1 seek=1024
# dd if=/boot/zfsboot of=/dev/ada1s1 count=1
# dd if=/boot/zfsboot of=/dev/ada1s1a skip=1 seek=1024
# dd if=/boot/zfsboot of=/dev/ada2s1 count=1
# dd if=/boot/zfsboot of=/dev/ada2s1a skip=1 seek=1024
this is for mbr.
the problem is efi, I believe. you can try to enable legacy boot.
all my systems still use bios, but I should probably update the guide to uefi some day...
the problem is efi, I believe. you can try to enable legacy boot.
all my systems still use bios, but I should probably update the guide to uefi some day...