Monthly Archives: January 2015

ZFS as RAID1

As my HP N54L server has 4 hard drive bays, I’ve been waiting for a good deal to add hard drives and expand my storage. Following a special offer at Argos (£99 instead of £249 😎 ), I purchased a WD 4TB My Book Duo Desktop USB Hard Disk Drive:

WD 4TB My Book Duo

WD 4TB My Book Duo

The idea was to take the hard drives out of the box and fit them in the server:

HP N54L Bays

HP N54L Bays

I originally wanted to set them in RAID1 (mirrored) for additional data protection, it turns out that the RAID1 feature on the Bios is not compatible with Ubuntu.

I therefore decided to use ZFS which although a bit slower, would actually be more powerful than RAID1 due to its self healing functionality.

This is what I did to set it up:

sudo add-apt-repository ppa:zfs-native/stable
sudo apt-get update
sudo apt-get install ubuntu-zfs

It is better to set it up by using the hard drive ID rather than name. the below command will give you what you need

ls -l /dev/disk/by-id

Once I have the names of the drives, I uses the  below command to create the zfs pool. (Don’t start copying files into it yet until ZFS file systems are created:

sudo zpool create -o autoexpand=on myzfs mirror /dev/disk/by-id/disk1 /dev/disk/by-id/disk2

 

I then created a separate file system for each of my top-level folders:

sudo zfs create -o compression=on myzfs/folder1

I created “Backup”, “Movies”, “Music”, “TV_Shows”, “Pictures”. They show up in Ubuntu’s file system as /myzfs/Backup, /myzfs/Movies, /myzfs/Music, /myzfs/TV_Shows, etc.

I’ve chosen the latter folder names as I’ll be using them for Plex

Thanks to whirlpool.net.au for the instructions on how to set up ZFS.




SmartVISU Plot Charts

With the release of DomotiGa v1.0.020, it is now possible to use SmartVISU plot charts directly instead of importing a 3rd party tool like HighCharts (see previous article about HighCharts).

Notes:

  1. Make sure you use the correct DomotiGa drivers for SmartVISU (you can get them here: io_domotiga.js and io_domotiga.min.js)
  2. If not yet done, you’ll also need to ensure you are tracking the value changes by enabling Log value history to database under the Options tab
  3. Name your device values correctly: the device name ideally has no spaces, the datasource name will be made of devicename_plotx where x is the device’s value (1 to 4). In my example, HDDRoot is the name, the Hard Drive’s temperature is in value1 so the datasource name is hddroot_plot1:

    datasource name

    datasource name

  4. Use this command in your SmartVISU page:
  5. {{ plot.period('plot1', 'HDDRoot_Plot1', 'avg', '1w', '', '', '', '', 'HDD Root', '#ff0', 'line', ['','°C'], '1h')}}
  6. Explanation of what each parameter means is provided by SmartVISU HERE

The result of my setup is this:

SmartVISU Plots

SmartVISU Plots

Note: I just added 2 hard drives to my server for storage and backup purposes (see this article), so there has not been enough time yet to track their temperature changes in the above charts.