Zfs
Salta a la navegació
Salta a la cerca
ZPool All Properties:
zpool get all Z5000LUKS_zfs
Dataset All Properties:
zfs get all Z5000LUKS_zfs zfs get all Z5000LUKS_zfs/fs
List all commands executed:
zpool history Z5000LUKS_zfs
List pools and status:
zpool status zpool status -v
List datasets:
zfs list
List all snapshots:
zfs list -t snapshot
Check the compression achieved
zfs get compressratio Z5000LUKS_zfs/fs
Step by step to create a new zfs disk
Find/view drive:
fdisk -l or $ mount
Create pool:
# zpool create -f YOURPOOLNAME /dev/sdX zpool create -f Z5000LUKS_zfs2 /dev/mapper/Z5000LUKS
Create filesystem
# zfs create YOURPOOLNAME/YOURNAME zfs create Z5000LUKS_zfs2/fs
Set features
zfs set compression=on Z5000LUKS_zfs2 zfs set mountpoint=/media/Z5000LUKS_zfs2 Z5000LUKS_zfs2 # zfs set compression=off YOURPOOLNAME/YOURNAME # zfs set copies=2 YOURPOOLNAME/YOURNAME
Mountpoints
Add new
zfs set mountpoint=/media/Z5000LUKS_zfs2 Z5000LUKS_zfs2/fs
Remove mountpoint
zfs set mountpoint=none Z5000LUKS_zfs2/fs
Encryption
Not yet supported with standard repository
https://blog.heckel.xyz/2017/01/08/zfs-encryption-openzfs-zfs-on-linux/
Auto snapshots
For Ubuntu 16.04:
https://romaco.ca/blog/2016/09/04/install-zfs-auto-snapshot-on-ubuntu-16-04-lts/ You can download the Ubuntu 16.04 package here, and install it by running:
wget https://furneaux.ca/w4ca8cqmwx234io/zfs-auto-snapshot-trustyport.deb dpkg -i zfs-auto-snapshot-trustyport.deb
To avoid too frequently
rm /etc/cron.d/zfs-auto-snapshot rm /etc/cron.hourly/zfs-auto-snapshot
Or configure frequency for the individual pools https://askubuntu.com/questions/322541/activate-zfs-snapshots
sudo zfs set com.sun:auto-snapshot=true tank/backup sudo zfs set com.sun:auto-snapshot:monthly=false tank/backup sudo zfs set com.sun:auto-snapshot:weekly=false tank/backup sudo zfs set com.sun:auto-snapshot:daily=true tank/backup sudo zfs set com.sun:auto-snapshot:hourly=false tank/backup sudo zfs set com.sun:auto-snapshot:frequent=false tank/backup
or disable
sudo zfs set com.sun:auto-snapshot=false tank/tmp
Alternatives:
http://wiki.complete.org/ZFSAutoSnapshots
- simplesnap - a simple and powerful cron-based network snapshot transfer tool by John Goerzen.
- Has a simple and secure wrapper so unfettered root access isn't needed.
- Designed to work with zfSnap or other snapshot-making tools on this page.
- Supports multiple backup sources, targets, and target sets (such as offsite media rotation)
- zfs-auto-snapshot - a simple cron-based service. Different names for different snapshots, with a simple count of how many to retain. Can exclude based on property.
- snapxfer, a wrapper around:
- zfSnap - a flexible snapshot-creation system. Can embed an expiry age in snapshot name, or override from command line.
- zxfer - a flexible snapshot-transfer system. Can use rsync or zfs snapshots. Used together with another snapshotting system. For remote transfers, requires root ssh authorized_keys or sudo access.
- zfs-snapshot-rotation-and-backup, a Python library and example scripts that use it. Expects ssh root access to remote.
- zsnap -- looks flexible and powerful, last commit 5 years ago. Requires Ruby.
- Suggested on ZFS on Linux mailing list:
- zetaback - feature-packed. Has a server-side agent to run on systems being backed up. Buggy config parser without sufficient validation on client.
- zrep - for zfs based replication (possibly remote) of filesystems. Can also be used just for backups. License prohibits public redistribution. Does failover too. Doesn't work on nested datasets. Designed to run once per minute. Same snapshot retention on both sides.
- zfs-auto-snapshot - as above, for snapshotting