zfs
Unterschiede
Hier werden die Unterschiede zwischen zwei Versionen angezeigt.
| Beide Seiten der vorigen RevisionVorhergehende ÜberarbeitungNächste Überarbeitung | Vorhergehende Überarbeitung | ||
| zfs [2024-04-04 20:10:56] – [Linux] manfred | zfs [2025-12-10 17:26:41] (aktuell) – [ZFS-Snapshot erstellen] manfred | ||
|---|---|---|---|
| Zeile 6: | Zeile 6: | ||
| * ... Doch auch andere Betriebssysteme setzen nicht auf das Original-ZFS, | * ... Doch auch andere Betriebssysteme setzen nicht auf das Original-ZFS, | ||
| * [[https:// | * [[https:// | ||
| + | |||
| + | |||
| + | ===== Installation ===== | ||
| + | |||
| + | Linux: | ||
| + | > apt install zfsutils-linux zfsnap | ||
| + | |||
| + | FreeBSD //(Die ZFS-Tools sind bereits im FreeBSD-Basis-System enthalten)//: | ||
| + | > pkg install sysutils/ | ||
| Zeile 71: | Zeile 80: | ||
| - | ==== ZFS resize ==== | + | ==== ZFS-Snapshot erstellen ==== |
| + | |||
| + | <file bash / | ||
| + | # | ||
| + | |||
| + | # | ||
| + | # Dieses Skript macht von dem ZFS-Pool " | ||
| + | # | ||
| + | # Es kann maximal EINER pro Stunde angelegt werden, | ||
| + | # sollte für diesen Zeitraum bereits einer existieren, | ||
| + | # dann wird er vorher gelöscht. | ||
| + | # | ||
| + | # zfs snapshot mysql_datadir@4-16 | ||
| + | # zfs list -t snapshot mysql_datadir | ||
| + | # mount -t zfs mysql_datadir@7-16 /mnt | ||
| + | # zfs destroy mysql_datadir@4-16 | ||
| + | # | ||
| + | # Bedeutung von " | ||
| + | # mysql_datadir - ZFS-Pool (Tank) | ||
| + | # 4 - 4. Wochentag -> am Donnerstag aufgenommen | ||
| + | # 16 - zwischen 16:00 und 16:59 Uhr aufgenommen | ||
| + | # | ||
| + | |||
| + | SNAP_ZEIT=" | ||
| + | zfs list -Hp | awk '/ | ||
| + | do | ||
| + | echo "################################################################################" | ||
| + | echo " | ||
| + | zfs destroy ${SNAP}@${SNAP_ZEIT} | ||
| + | zfs snapshot ${SNAP}@${SNAP_ZEIT} | ||
| + | done | ||
| + | echo | ||
| + | |||
| + | # alle SnapShots anzeigen | ||
| + | zfs list -t snapshot | ||
| + | </ | ||
| + | |||
| + | |||
| + | ==== ZFS-Snapshot mounten ==== | ||
| + | |||
| + | <code bash> | ||
| + | root@mysqlhost01: | ||
| + | NAME | ||
| + | mysql_datadir@3-17 | ||
| + | |||
| + | root@mysqlhost01: | ||
| + | |||
| + | root@mysqlhost01: | ||
| + | Filesystem | ||
| + | mysql_datadir@3-17 | ||
| + | |||
| + | root@mysqlhost01: | ||
| + | total 13K | ||
| + | drwxr-xr-x | ||
| + | drwxr-xr-x 23 root root 4.0K Dec 9 15:39 .. | ||
| + | drwxr-xr-x | ||
| + | |||
| + | root@mysqlhost01: | ||
| + | |||
| + | root@mysqlhost01: | ||
| + | Filesystem | ||
| + | / | ||
| + | |||
| + | root@mysqlhost01: | ||
| + | total 8.0K | ||
| + | drwxr-xr-x | ||
| + | drwxr-xr-x 23 root root 4.0K Dec 9 15:39 .. | ||
| + | </ | ||
| + | |||
| + | |||
| + | ==== ZFS-Snapshot löschen ==== | ||
| + | |||
| + | <code bash> | ||
| + | root@mysqlhost01: | ||
| + | NAME | ||
| + | mysql_datadir@3-17 | ||
| + | |||
| + | root@mysqlhost01: | ||
| + | |||
| + | root@mysqlhost01: | ||
| + | no datasets available | ||
| + | </ | ||
| + | |||
| + | |||
| + | ==== ZFS-Pool | ||
| [[https:// | [[https:// | ||
| - | the resize is triggered by running the online subcommand with -e: | + | the resize is triggered by running the online subcommand with '' |
| - | # zpool online -e zroot /dev/ada0p2 | + | <code bash resize> |
| + | root@mysqlhost01: | ||
| + | |||
| + | root@mysqlhost01: | ||
| + | |||
| + | root@mysqlhost01: | ||
| + | </ | ||
| Zeile 186: | Zeile 285: | ||
| [[https:// | [[https:// | ||
| - | > zpool create speicher mirror /dev/ad6 /dev/ad8 | ||
| + | den Daten-Pool " | ||
| + | > zpool create speicher mirror /dev/ad7 /dev/ad8 | ||
| + | |||
| + | > zpool list speicher | ||
| + | > zpool iostat speicher | ||
| + | > zpool status speicher | ||
| + | |||
| + | alle Daten auf dem Pool überprüfen und ggf. reparieren: | ||
| + | > zpool scrub speicher | ||
| + | |||
| + | auf dem Daten-Pool " | ||
| > zfs create speicher/ | > zfs create speicher/ | ||
| > zfs create speicher/ | > zfs create speicher/ | ||
| Zeile 193: | Zeile 302: | ||
| > zfs create speicher/ | > zfs create speicher/ | ||
| + | die 4 ZFS-Volumen bekommen jeweils einen Mount-Point zugewiesen: | ||
| > zfs set mountpoint=/ | > zfs set mountpoint=/ | ||
| > zfs set mountpoint=/ | > zfs set mountpoint=/ | ||
| Zeile 203: | Zeile 313: | ||
| so kannst du Kompression einstellen: | so kannst du Kompression einstellen: | ||
| > zfs set compression=gzip speicher/ | > zfs set compression=gzip speicher/ | ||
| + | |||
| + | einen SnapShot von '' | ||
| + | > zfs snapshot speicher/ | ||
| + | |||
| + | alle SnapShots von '' | ||
| + | > zfs list -rt snapshot speicher/ | ||
| + | NAME USED AVAIL REFER MOUNTPOINT | ||
| + | speicher/ | ||
| + | |||
| + | den SnapShots mounten: | ||
| + | > mount -t zfs speicher/ | ||
| + | > ls -lha /mnt | ||
| + | > umount /mnt | ||
| + | |||
| + | den SnapShots löschen: | ||
| + | > zfs destroy speicher/ | ||
| + | | ||
| + | > zfs list -rt snapshot speicher/ | ||
| + | no datasets available | ||
| + | |||
| + | nur das eine ZFS-Volumen " | ||
| + | > zfs destroy -r speicher/ | ||
| + | |||
| + | alle ZFS-Volumen ('' | ||
| + | > zfs destroy -r speicher | ||
| + | |||
| + | den ganzen Daten-Pool " | ||
| + | > zpool destroy speicher | ||
/home/http/wiki/data/attic/zfs.1712261456.txt · Zuletzt geändert: von manfred
