The Home Server Part 2: Ubuntu & ZFS

So I have my HP Micro Server. It has a modded BIOS. I have installed a spare SSD that I had into the OOD slot. Next step is Ubuntu.

Unfortunately I found the Ubuntu Server 13.10 doesn’t like to work with either of my USB keyboards which makes installing it impossible. So I got a Ubuntu 13.04 ISO and installed it via USB stick to the SSD, then upgraded to 13.10.

Now for ZFS I did the following

sudo -i
apt-get install python-software-properties software-properties-common
add-apt-repository ppa:zfs-native/stable
apt-get update
apt-get install ubuntu-zfs
apt-get install zfs-initramfs
I then put in my 3 500gb test HDD’s that I am going to use as practice for setting up and recovering zfs.
Next I edited /etc/default/zfs to enable automatic mounting/umounting of zfs shares on startup and shutdown, as well as the zfs sharing properties. (Change the top 4 options in the file from no to yes)
Execute the following to get the disk id’s of the disks  you want to use in your zfs pool:
ls -l /dev/disk/by_id
Mine were:
ata-WDC_WD5000AAKS-00TMA0_WD-WCAPW1902486
ata-WDC_WD5000AAKS-00TMA0_WD-WCAPW1908191
ata-SAMSUNG_HD501LJ_S0MUJ13P651726
Then to create my RAIDZ pool (the Zfs equivalent of raid5) with my 3x500GB disks:
zpool create -f storage raidz /dev/disk/by-id/ata-WDC_WD5000AAKS-00TMA0_WD-WCAPW1902486 /dev/disk/by-id/ata-WDC_WD5000AAKS-00TMA0_WD-WCAPW1908191 /dev/disk/by-id/ata-SAMSUNG_HD501LJ_S0MUJ13P651726
Then to check its all created
$> zpool list
NAME      SIZE  ALLOC   FREE    CAP  DEDUP  HEALTH  ALTROOT
storage  1.36T   220K  1.36T     0%  1.00x  ONLINE  –
$> zpool status
Now when I ran both of those command the size it gives you is the raw size of the pool which in this case is 1.36TB.
Note also DEDUP is on. When I properly set this up with the final drives I plan to use I will be turning it off on some of my sub file systems.
If I run the following:
$> zfs list
NAME      USED  AVAIL  REFER  MOUNTPOINT
storage   137K   913G  38.6K  /storage
I only see 913GB because of the 1/3 of the data taken to use as a parity.
Finally I am going to create a single zfs filesystem within my zfs filesystem
$> zfs create storage/test
$> zfs list
NAME           USED  AVAIL  REFER  MOUNTPOINT
storage        188K   913G  40.0K  /storage
storage/test  38.6K   913G  38.6K  /storage/test
Next. Creating some data, losing a drive, and rebuilding

Comments are closed.

Comments are disabled