Using ZFS on an external USB drive for backup in Ubuntu

backupzfs

I run Ubuntu 12.04 precise and would like to format, using ZFS, an external USB HDD to use it as a backup drive for my home directories.

Since it's just one drive I am not interested in self-healing since I understand this to require a RAID configuration of 2 or more disks to do it right. So being able to take snapshots of my external backup drive using ZFS native capabilities is enough, for now.

The plan is to rsynch my home folder onto the ZFS drive using the –inplace option to reduce snapshot sizes. This will hopefully allow me to keep many weeks worth of snapshots of my home directories on the ZFS drive. The operating system's HDD where the home directories reside is ext4 if that makes any difference. I would also like to have native ZFS support in my Ubuntu, not FUSE.

How should I go about achieving that in Ubuntu, using the command line? (not the whole backing-up thing, just the formatting).

Best Answer

Assuming your USB disk is /dev/sdb and will be used exclusively with ZFS:

zpool create pool sdb
zfs create pool/backup

Use /pool/backup as your rsync destination directory.

Create snapshots with:

zfs snapshot pool/backup@$(date +%Y%m%d%H%M)
Related Question