Showing posts with label ZFS. Show all posts
Showing posts with label ZFS. Show all posts

Wednesday 22 October 2014

Add ZFS storage space usage to SSH MOTD in Ubuntu 14.04

If you want to change the SSH Message of the Day so that it doesn't show the default / drive space AND have it show the size of your zfs pool then you have to do the following to allow it to display.  Please note that this is done on Ubuntu 14.04


First edit the disk.py file under /usr/lib/python2.7/dist-packages/landscape/lib with your favourite text editor and at the end of the STABLE_FILESYSTEMS entry add ', "zfs"' as shown in the screenshot below, then save and quit the editor


Next, edit the disk.py file under /usr/lib/python2.7/dist-packages/landscape/sysinfo with your favourite text editor and find the line main_info = get_filesystem_for_path("/", self._mounts_file, and edit the "/" path to the zfs file system you want, in my case its "/zfs/storage".  Also edit root_main_info = get_filesystem_for_path("/"..... and replace the "/" with the same entry as above.  These changes can be seen in the screenshot below.  Save and then quit the editor.  *Note a recent update removes the root_main_info line and is no longer required*



Done, the next time you ssh in to your server, you'll see your ZFS file system space!!!





Tuesday 19 March 2013

Replacing a failed disk in ZFS


As you can see below running “zpool status” shows me that disk c6d0 has faulted (before you replace the disk you can run "format" to check the serial numbers to make sure you pull out the right disk!!!!)

I replaced the faulty disk, then ran “zpool replace zfs c6d0” another check of “zpool status” and you can see the drive is rebuilding (resilvering as it’s called in the ZFS world).

Run a “zpool status” in 30 mins or so, this will give you an accurate finish time, in my case I can see its going to take about 6 and a half hours.