Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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).

share|improve this question
add comment

1 Answer 1

up vote 2 down vote accepted

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)
share|improve this answer
    
should'nt I format the drive as ZFS first? 'sudo zpool create pool sdb' gives me "invalid vdev specification use '-f' to override the following errors: /dev/sdb is part of potentially active pool 'pool'". And when I try 'sudo zpool create -f pool sdb' I get "cannot open '/dev/sdb': Device or resource busy" –  Menelaos Perdikeas Sep 29 '12 at 17:42
    
No, there is no such thing as ZFS formatting (assuming you mean creating a file system like with mk2efs). Is /dev/sdb your USB disk ? Did you already create a ZFS pool on it ? Is there already a mounted file system on your USB disk ? –  jlliagre Sep 29 '12 at 21:39
    
I created a ZFS pool with the "zpool create pool sdb" and "zfs create pool/backup" commands you provided. The USB disk was at /dev/sdb and was NTFS formatted with a mounted file system (which I however dismounted). Anyway, I'll accept your answer for now and will read up on ZFS pools a bit more ... –  Menelaos Perdikeas Sep 29 '12 at 22:41
    
So the pools were already there when you got the error message. What says: zpool list pool, zpool status pool and zpool history pool ? –  jlliagre Sep 30 '12 at 9:05
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.