echo 'zfs_enable="YES"' >> /etc/rc.conf
vm.kmem_size="330M" vm.kmem_size_max="330M" vfs.zfs.arc_max="40M" vfs.zfs.vdev.cache.size="5M" zfs_load="YES" vfs.root.mountfrom="zfs:tank"
LOADER_ZFS_SUPPORT=yes
cd /usr/src/sys/boot make clean make obj make depend make make install [DESTDIR=/some]
ZFS можно разместить в любом разделе. Как вариант, в BSD-подразделе (slice).
MBR->BSDPART->ZFS_SUBPART
# создаем таблицу разделов типа MBR gpart create -s MBR da0 # создаем раздел в ней; если на весь диск, то размер опускаем grart add -b 1 [-s _SIZE_] -t freebsd da0 # создаем под-таблицу разделов BSD, ранее это делалось утилитой bsdlabel gpart create -s BSD da0s1 # создаем bsd-подраздел (slice) gpart add -i 1 [ -s _SIZE_ ] da0s1 # создаем ZFS пул zpool create zroot da0s1a # далее операции с пулом и файловой системой zpool export zpool import zfs create zpool/usr ...
# gpart show ad0 => 63 7880481 ad0 MBR (3.8G) 63 7880481 1 freebsd [active] (3.8G) # gpart show ad0s1 => 0 7880481 ad0s1 BSD (3.8G) 0 7880481 1 freebsd-zfs (3.8G)
Нуждается в уточнении вариантов установки boot part1 & part1
dd if=/mnt2/boot/zfsboot of=/dev/da0s1a bs=512 count=1 dd if=/mnt2/boot/zfsboot of=/dev/da0s1a bs=512 skip=1 seek=1024
Root On ZFS Configuration using zfsboot
16. Install ZFS boot
- Install the boot1 stage:
Fixit# dd if=/mnt2/boot/zfsboot of=/dev/ad0s3 count=1- Install the boot2 zfs stage into the convienient hole in the ZFS filesystem on-disk format which is located just after the ZFS metadata (this is the seek=1024).
Fixit# dd if=/mnt2/boot/zfsboot of=/dev/ad0s3a \ skip=1 seek=1024Exit Fixit mode, and sysinstall. Then remove the FreeBSD install CD and the system will boot using the ZFS root.
Под загрузчик Stage2 выделяется отдельный раздел.
GPT->BSD_BOOT_PART ->BSD_FREEBSD_UFS_PART
gpart create -s GPT da0 gpart add -b 32 -s 128 -t freebsd-boot da0 gpart add -b _32+128_ -t freebsd-ufs da0 gpart add ... grapt bootcode -b /boot/pmbr -p /boot/gptboot -i1 da0 newfs -U -L _label_ da0p2 ..
Аналогично UFS+GPT, инталлируется другой загрузчик Stage2
GPT->BSD_BOOT_PART ->BSD_FREEBSD_ZFS_PART
gpart create -s GPT da0 gpart add -b 32 -s 128 -t freebsd-boot da0 gpart add -b _32+128_ -t freebsd-zfs da0 gpart add ... grapt bootcode -b /boot/pmbr -p /boot/gptzfsboot -i1 da0 zpool create tank da0p2 ..