zfs
- zfs-fuse is in ubuntu repositories
- zfs and zpool are to be run as sudo
- NO partitioning
disks
tool &/ other partition managers might show the disk as Free/unused.
Create Pool
sudo zpool create -f -m /mnt/mountpoint zfspoolnamehere /dev/disk/by-id/carefully_choose_the_correct_disk
Options
- can be set during
zpool create
with-o option=value
for each option, orsudo zfs set option=value zfspoolnamehere
copies=2
to keep 2 copies of each file in the disk. (Single Disk. No RAID setup)
dedup=on
deduplication
Maintenance
- Scrub to run a check
sudo zpool scrub name-of-zfs-pool
- Check will run in background. Check the status of scrubbing
sudo zpool status name-of-zfs-pool
- For general status info, this is better. Shows attributes, used and free space.
sudo zpool get all name-of-zfs-pool
- Is copying to
dedup
ed zfs drive is too slow? turn off duplicate checking if neededsudo zfs set dedup=off name-of-zfs-pool
Disconnecting and Reconnecting zfs hard drives
The pool has to be exported before the hard drive can be removed from the system.
sudo zpool export name-of-the-pool
CAUTION: Don’t use
-f
option; forcefully removes a drive. May cause data loss.
After export and removal, the hard drive can be connected to the same or different computer later.
sudo zpool import
– lists the details of available pools
sudo zpool import name-of-the-pool
– to import the pool.
Snapshots
sudo zfs set listsnapshots=on name-of-zfs-pool
Now, sudo zfs list
will show snapshots too.
more: Displaying and Accessing Snapshots
Resources
- https://wiki.archlinux.org/index.php/ZFS
man zfs
(example scenarios at the bottom)