Posted on

by

in

,

zfs

ZFS ist eine coole Sache :- )

Neuen Pool anlegen

zpool create mypool /dev/sdb

aktueller Status anzeigen

zpool status

… das dazugehörende dev finden …

glabel status

… und die s/n zum dev finden …

smartctl -q noserial -a /dev/ada0  | sed -n 3,20p

Übliche Kompression einstellen

zfs set compression=lz4 zfspool

Standard Snapshot einstellen:

(install zfs-auto-snapshot)

zfs set com.sun:auto-snapshot=true zfspool/snapped

By default script saves: – frequent snapshots every 15 mins, keeping 4 snapshots – hourly snapshots every hour, keeping 24 snapshots – daily snapshots every day, keeping 31 snapshots – weekly snapshots every week, keeping 7 snapshots – monthly snapshots every month, keeping 12 snapshots

oder manuell konfigurieren

sudo zfs set com.sun:auto-snapshot=true zfspool/snapped
sudo zfs set com.sun:auto-snapshot:monthly=false zfspool/snapped
sudo zfs set com.sun:auto-snapshot:weekly=false zfspool/snapped
sudo zfs set com.sun:auto-snapshot:daily=true zfspool/snapped
sudo zfs set com.sun:auto-snapshot:hourly=false zfspool/snapped
sudo zfs set com.sun:auto-snapshot:frequent=false zfspool/snapped

Snapshots anzeigen

zfs list -t snapshot

Neuen Speicherplatz hinzufügen (nicht redundant)

zpool add -f zfspool/dev/sdc

Redundanten Speicher hinzufügen (~RAID)

zpool attach -f zfspool/dev/sdc

zpool status anzeigen

zpool status -x

Snapshot löschen

Vol1RaidZ/SnapMonthly@auto-20200801.0900-13m

zpool Datenintegrität prüfen

Vol1RaidZ/SnapMonthly@auto-20200801.0900-13m

… und noch Samba konfigurieren

apt-get install samba-vfs-modules

Then configure smb.conf by configuring your shares:

[global]
    shadow: snapdir = .zfs/snapshot
    shadow: sort = desc
    shadow: format = zfs-auto-snap_%Y-%m-%d-%H%M

[myshare]
    path = /my/tank/data
    read only = No
    comment = ZFS dataset with Previous Versions enabled
    vfs objects = shadow_copy2

teilweise kopiert von:

https://github.com/zfsonlinux/zfs-auto-snapshot/wiki/Samba