Lighthouse      Zap's Digital Lighthouse
   


About
Zap's Digital Lighthouse is
a Blosxom weblog for our digital outpost on the Internet

For info
info@rax.org


Useful links:
Google
Cyberpresse
The Reg
Slashdot
FreeBSD
LinkedIn
Twitter
Boursorama
RAX
zap
Soekris
xkcd
AirFrance
Wiki soekris
Wikipedia
Wiktionary
ACME
blosxom

Categories:
/FreeBSD (27)
/admin (4)
/blosxom (6)
/games (5)
/hardware (17)
/inet (4)
/misc (37)
/notwork (2)
/software (11)
/tech (1)

Archives:
 2025 (1)   
 | January (1)
 2024 (3)   
 | December (3)
 2023 (1)   
 | June (1)
 2021 (2)   
 | January (2)
 2020 (2)   
 | December (1)
 | September (1)
 2019 (2)   
 | November (1)
 | July (1)
 2018 (6)   
 | December (1)
 | November (3)
 | January (2)
 2017 (4)   
 | December (2)
 | January (2)
 2016 (3)   
 | November (1)
 | October (1)
 | January (1)
 2015 (9)   
 | December (2)
 | November (1)
 | October (1)
 | June (1)
 | May (2)
 | February (1)
 | January (1)
 2014 (9)   
 | December (1)
 | October (1)
 | September (1)
 | August (3)
 | May (2)
 | April (1)
 2013 (20)   
 | October (3)
 | June (4)
 | May (2)
 | April (7)
 | March (1)
 | January (3)
 2012 (60)   
 | December (4)
 | October (1)
 | July (5)
 | June (7)
 | May (1)
 | April (6)
 | March (3)
 | February (14)
 | January (19)
 2011 (3)   
 | December (1)
 | November (2)
 2008 (1)   
 | October (1)


Blosxom

       

home :: FreeBSD :: fb9zfs

Sun, 15 Jan 2012

Setting up FreeBSD 9.0 with a ZFS root filesystem

With the new version of FreeBSD being just out, I decided to try out the ZFS filesystem. Notably, I would like to find out whether it works correctly with 2GB of memory, or whether more is really needed (I read that it doesn't really work with less than 1GB of RAM, but then again, there are conflicting reports that it needs lots more, though sometimes that's qualified with 'if you want prefetch' or 'if you are trying to do dedup'). Actually, I am building a small NAS server I am building around a Soekris net6501-70 which comes with 2GB RAM, and I would like to find out if I can use ZFS with it.

So, I looked up http://wiki.freebsd.org/RootOnZFS/GPTZFSBoot/9.0-RELEASE and tried to set up a vmware virtual machine with ZFS only.

I did not bother setting up swap space, nor a mirrored disk configuration, so the commands I used were:

  • boot a vmware virtual machine from the amd64 FreeBSD9.0-RELEASE DVD
  • choose the Shell option at the partitioning dialog in bsdinstall
  • run the following commands:

    # gpart create -s gpt da0
    # gpart add -s 64K -t freebsd-boot -l boot0 da0
    # gpart add -t freebsd-zfs -l disk0 da0
    # gpart bootcode -b /boot/pmbr -p /boot/gptzfsboot -i 1 da0
    # zpool create -o altroot=/mnt zroot /dev/gpt/disk0
    # zfs create zroot/tmp
    # chmod 1777 /mnt/tmp
    # zfs create zroot/usr
    # zfs create zroot/var
    # zfs create zroot/home
    # exit
  • And then, after installation:
    (update: one must add # echo 'zfs_enable="YES"'>> /mnt/etc/rc.conf here as per the post on 21 January)

    # echo 'zfs_load="YES"'>>  /mnt/boot/loader.conf
    # echo 'vfs.root.mountfrom="zfs:zroot"'>>  /mnt/boot/loader.conf
    # zfs unmount -a
    # zpool export zroot
    # zpool import -o cachefile=/tmp/zpool.cache -o altroot=/mnt zroot
    # zfs set mountpoint=/ zroot
    # cp /tmp/zpool.cache /mnt/boot/zfs/
    # zfs unmount -a
    # zpool set bootfs=zroot zroot
    # zpool set cachefile='' zroot
    # zfs set mountpoint=legacy zroot
    # zfs set mountpoint=/tmp zroot/tmp
    # zfs set mountpoint=/usr zroot/usr
    # zfs set mountpoint=/var zroot/var
    # zfs set mountpoint=/home zroot/home

The last 4 commands (i.e. after 'zfs set mountpoint=legacy zroot') give error messages, but I think that's OK. However, once I rebooted the virtual machine, the filesystems (except for /) were not mounted and therefore FreeBSD did not come up properly.

So, this was a first try... More on this next weekend :-)

/FreeBSD | Posted at 16:57 | permanent link