Installation
Let us go for it.
Code:
# make install
for THIS in /usr/freebsd-dist/base.txz /usr/freebsd-dist/kernel.txz ;
do tar --unlink -xvpJf ${THIS} -C /mnt ; done
x ./
x ./bin/
x ./boot/
x ./dev/
x ./etc/
x ./lib/
x ./libexec/
x ./media/
x ./mnt/
x ./proc/
x ./rescue/
x ./root/
x ./sbin/
[snip]
x ./boot/kernel/zlib.ko
x ./boot/kernel/zlib.ko.symbols
x ./boot/kernel/linker.hints
After all the files have been extracted we are presented with:
- directory listing of the FreeBSD installation
Code:
ls -l /mnt
total 146
-rw-r--r-- 2 root wheel 1014 Dec 4 2012 .cshrc
-rw-r--r-- 2 root wheel 256 Dec 4 2012 .profile
-r--r--r-- 1 root wheel 6203 Dec 4 2012 COPYRIGHT
drwxr-xr-x 2 root wheel 46 Dec 4 2012 bin
drwxr-xr-x 7 root wheel 39 Dec 4 2012 boot
dr-xr-xr-x 2 root wheel 2 Dec 4 2012 dev
drwxr-xr-x 20 root wheel 94 Dec 4 2012 etc
drwxr-xr-x 3 root wheel 48 Dec 4 2012 lib
drwxr-xr-x 3 root wheel 4 Dec 4 2012 libexec
drwxr-xr-x 2 root wheel 2 Dec 4 2012 media
drwxr-xr-x 2 root wheel 2 Dec 4 2012 mnt
dr-xr-xr-x 2 root wheel 2 Dec 4 2012 proc
drwxr-xr-x 2 root wheel 142 Dec 4 2012 rescue
drwxr-xr-x 2 root wheel 6 Dec 4 2012 root
drwxr-xr-x 2 root wheel 130 Dec 4 2012 sbin
lrwxr-xr-x 1 root wheel 11 Dec 4 2012 sys -> usr/src/sys
drwxrwxrwt 2 root wheel 2 Dec 4 2012 tmp
drwxr-xr-x 14 root wheel 14 Dec 4 2012 usr
drwxr-xr-x 23 root wheel 23 Dec 4 2012 var
- The pool status:
Code:
zpool status super
pool: super
state: ONLINE
scan: none requested
config:
NAME STATE READ WRITE CKSUM
super ONLINE 0 0 0
mirror-0 ONLINE 0 0 0
md1p2 ONLINE 0 0 0
md2p2 ONLINE 0 0 0
errors: No known data errors
- The pool input/output statistics:
Code:
zpool iostat super
capacity operations bandwidth
pool alloc free read write read write
---------- ----- ----- ----- ----- ----- -----
super 616M 1.38G 0 1 64 34.2K
- listing of the ZFS data sets:
Code:
zfs list
NAME USED AVAIL REFER MOUNTPOINT
super 880M 1.09G 144K none
super/ROOT 615M 1.09G 144K none
super/ROOT/default 614M 1.09G 614M /mnt
super/swap 264M 1.35G 72K -
-------------end of install --------------------
Post-installation
Initializing
/boot/loader.conf
Code:
# make loader.conf
echo 'zfs_load=YES' >> /mnt/boot/loader.conf
echo 'vfs.root.mountfrom="zfs:super/ROOT/default"' >> /mnt/boot/loader.conf
=========== loader.conf =========================
zfs_load=YES
vfs.root.mountfrom="zfs:super/ROOT/default"
-------------end of loader.conf --------------------
To prevent errors at boot time an empty
/etc/fstab is needed.
Code:
# make fstab
# ---- create empty /etc/fstab file
touch /mnt/etc/fstab
-------------end of fstab --------------------
Enable ZFS in
/etc/rc.conf.
Code:
# make rc.conf
cat /tmp/template_rc.conf >> /mnt/etc/rc.conf
cat: /tmp/template_rc.conf: No such file or directory
*** [rc.conf] Error code 1
We fix this error and simply redo.
Code:
# cp template_rc.conf /tmp
# make rc.conf
cat /tmp/template_rc.conf >> /mnt/etc/rc.conf
echo 'zfs_enable=YES' >> /mnt/etc/rc.conf
echo '# ------------------' >> /mnt/etc/rc.conf
=========== rc.conf =========================
# ------ rc.conf
#defaultrouter=192.168.222.10
hostname='althusser.utp.xnet'
network_interfaces='bge0'
ifconfig_bge0="SYNCDHCP"
# --- daemons
inetd_enable=NO
sshd_enable=yes
sendmail_enable=yes
# --- time synchronization
ntpd_enable=YES
#openntpd_enable=YES
zfs_enable=YES
# ------------------
Copy the ZFS cache file to
/boot/zfs
Code:
# make zfs_boot
if [ ! -d /mnt/boot/zfs ] ; then echo Cannot copy /tmp/zpool.cache to /mnt/boot/zfs ! ; exit 2 ; fi
cp -p /tmp/zpool.cache /mnt/boot/zfs/
ls -l /mnt/boot/zfs
total 1
-rw-r--r-- 1 root wheel 1488 Aug 5 17:56 zpool.cache
-------------end of zfs_boot --------------------
Unmount
Code:
# make zfs_umount
zfs unmount -a
zfs list
NAME USED AVAIL REFER MOUNTPOINT
super 925M 1.05G 144K none
super/ROOT 659M 1.05G 144K none
super/ROOT/default 659M 1.05G 659M /mnt
super/swap 264M 1.31G 72K -
------
mount
/dev/ada0s3a on / (ufs, local, noatime, soft-updates)
devfs on /dev (devfs, local, multilabel)
tmpfs on /tmp (tmpfs, local)
-------------end of zfs_umount --------------------
Set the mountpoint to
legacy
Code:
# make mountpoint
ls -l /tmp
-rw-r--r-- 1 root wheel 261 Aug 5 23:35 template_rc.conf
-rw-r--r-- 1 root wheel 1488 Aug 5 17:56 zpool.cache
zfs set mountpoint=legacy super/ROOT/default
zfs list
NAME USED AVAIL REFER MOUNTPOINT
super 925M 1.05G 144K none
super/ROOT 659M 1.05G 144K none
super/ROOT/default 659M 1.05G 659M legacy
super/swap 264M 1.31G 72K -
Setup is finished ............
----------------- done ! ---------------------------------
you can now reboot into your new ZFS only system now .....
----------------------------------------------------------
Or you could finish the elementary setup with:
1. Remount your ZFS file system : mount -t zfs super/ROOT/default /mnt
2. Chroot into /mnt : chroot /mnt
3. Change the root password : passwd
4. Create the /etc/mail/aliases.db : newaliases
5. Set up your time zone : tzsetup
6. Exit the chroot : exit
7. Unmount : umount /mnt
-------------end of mountpoint --------------------
That's it. A FreeBSD ZFS only system suitable for managing boot environments.