Karl Cordes

Very rough notes on setting up ZFS on Ubuntu 16.04 - with LXD

sudo apt-get install zfsutils-linux

dmesg | grep -i sata | grep 'link up'
[    6.208581] ata1: SATA link up 6.0 Gbps (SStatus 133 SControl 300)
  [    6.896647] ata2: SATA link up 6.0 Gbps (SStatus 133 SControl 300)
  [    7.216674] ata3: SATA link up 3.0 Gbps (SStatus 123 SControl 300)


k@sagan:~$ sudo zpool create apollo mirror /dev/sdb /dev/sdc
invalid vdev specification
use '-f' to override the following errors:
/dev/sdb does not contain an EFI label but it may contain partition
information in the MBR.
/dev/sdc does not contain an EFI label but it may contain partition
information in the MBR.
# wtf

k@sagan:~$ sudo zpool create -f apollo mirror /dev/sdb /dev/sdc
k@sagan:~$ sudo zpool status
  pool: apollo
 state: ONLINE
  scan: none requested
config:

        NAME        STATE     READ WRITE CKSUM
        apollo      ONLINE       0     0     0
          mirror-0  ONLINE       0     0     0
            sdb     ONLINE       0     0     0
            sdc     ONLINE       0     0     0

errors: No known data errors


k@sagan:~$ sudo zfs create apollo/projects
k@sagan:~$ ls
k@sagan:~$ sudo zfs list
NAME              USED  AVAIL  REFER  MOUNTPOINT
apollo            372K  5.27T    96K  /apollo
apollo/projects    96K  5.27T    96K  /apollo/projects

Performance

http://blog.ashodnakashian.com/2013/12/18tb-home-nashtpc-with-zfs-on-linux-part-3/

Recreate the pool

http://zfsonlinux.org/faq.html#WhatDevNamesShouldIUseWhenCreatingMyPool

Advanced Format (4k sector size)

http://zfsonlinux.org/faq.html#HowDoesZFSonLinuxHandleAdvacedFormatDrives

sudo zpool create -o ashift=12 /dev/

k@sagan:/dev/disk/by-id$ sudo zpool create -f apollo mirror /dev/disk/by-id/ata-ST6000DM001-1XY17Z_Z4D37NYA /dev/disk/by-id/ata-ST6000DM001 -1XY17Z_Z4D38MR6

k@sagan:/dev/disk/by-id$ sudo zpool create -f -o ashift=12 apollo mirror /dev/disk/by-id/ata-ST6000DM001-1XY17Z_Z4D37NYA /dev/disk/by-id/ata-ST6000DM001-1XY17Z_Z4D38MR6

NFS & Samba

https://docs.oracle.com/cd/E23824_01/html/821-1448/gayne.html sudo zfs set sharenfs=on apollo/rivaridge sudo zfs set sharesmb=on apollo/rivaridge

LXD

https://insights.ubuntu.com/2015/11/10/converting-eth0-to-br0-and-getting-all-your-lxc-or-lxd-onto-your-lan/

Samba

https://www.latentexistence.me.uk/zfs-and-ubuntu-home-server-howto/