This is an old revision of the document!


  1. Create ZFS filesystem hierarchy

The fletcher4 algorithm should be more robust than the fletcher2 algorithm.

Fixit# zfs set checksum=fletcher4							zroot
Fixit# zfs create -o compression=on	-o exec=on	-o setuid=off			zroot/tmp
Fixit# chmod 1777 /zroot/tmp
Fixit# zfs create									zroot/usr
Fixit# zfs create									zroot/usr/home
Fixit# cd zroot ; ln -s /usr/home home
Fixit# zfs create -o compression=lzjb 			-o setuid=off			zroot/usr/ports
Fixit# zfs create -o compression=off	-o exec=off	-o setuid=off			zroot/usr/ports/distfiles
Fixit# zfs create -o compression=off	-o exec=off	-o setuid=off			zroot/usr/ports/packages
Fixit# zfs create -o compression=lzjb 	-o exec=off	-o setuid=off			zroot/usr/src
Fixit# zfs create									zroot/var
Fixit# zfs create -o compression=lzjb 	-o exec=off	-o setuid=off			zroot/var/crash
Fixit# zfs create			-o exec=off	-o setuid=off			zroot/var/db
Fixit# zfs create -o compression=lzjb 	-o exec=on	-o setuid=off			zroot/var/db/pkg
Fixit# zfs create			-o exec=off	-o setuid=off	-o readonly=on	zroot/var/empty
Fixit# zfs create -o compression=lzjb 	-o exec=off	-o setuid=off			zroot/var/log
Fixit# zfs create -o compression=gzip 	-o exec=off	-o setuid=off			zroot/var/mail
Fixit# zfs create			-o exec=off	-o setuid=off			zroot/var/run
Fixit# zfs create -o compression=lzjb 	-o exec=on	-o setuid=off			zroot/var/tmp
Fixit# chmod 1777 /zroot/var/tmp
Note:
  1. Compression may be set to on, off, lzjb, gzip, gzip-N (where N is an integer from 1 (fastest) to 9 (best compresion ratio. gzip is equivalent to gzip-6).
  2. Compression will cause some latency when accessing files on the ZFS filesystems. Use compression on ZFS filesystems which will not be accessed that often.
Fixit# cd /dist/8.0-20090628-SNAP
Fixit# export DESTDIR=/zroot
Fixit# for dir in base catpages dict doc games info lib32 manpages ports; \
  do (cd $dir ; ./install.sh) ; done
Fixit# cd src ; ./install.sh all
Fixit# cd ../kernels ; ./install.sh generic
Fixit# cd /zroot/boot ; cp -Rlp GENERIC/* /zroot/boot/kernel/
  1. Create /etc/rc.conf, /etc/src.conf, /boot/loader.conf
Fixit# echo 'zfs_enable="YES"' > /zroot/etc/rc.conf
Fixit# echo 'LOADER_ZFS_SUPPORT=YES' > /zroot/etc/src.conf
Fixit# echo 'zfs_load="YES"' > /zroot/boot/loader.conf
Fixit# echo 'vfs.root.mountfrom="zfs:zroot"' >> /zroot/boot/loader.conf
Fixit# chroot /zroot
Fixit# mount -t devfs devfs /dev
Fixit# export DESTDIR=""
Fixit# cd /usr/src/sys/boot/
Fixit# make obj
Fixit# make depend
Fixit# make
Fixit# cd i386/loader
Fixit# make install
Fixit# umount /dev
Fixit# exit
  1. change root password
Fixit# chroot /zroot
Fixit# passwd
Fixit# exit
  1. Install zpool.cache to the ZFS filesystem
Fixit# cp /boot/zfs/zpool.cache /zroot/boot/zfs/zpool.cache
  • rootonzfs/installingfreebsd.1256320276.txt.gz
  • Last modified: 2009/10/23 17:51
  • by ScotHetzel