Unterschiede
Hier werden die Unterschiede zwischen zwei Versionen der Seite angezeigt.
Beide Seiten, vorherige Überarbeitung Vorherige Überarbeitung Nächste Überarbeitung | Vorherige Überarbeitung | ||
server_und_serverdienste:linux_zfs [2022/03/21 08:46] – [Autoexpand auf einem Rootpool] loma | server_und_serverdienste:linux_zfs [2024/08/20 08:25] (aktuell) – loma | ||
---|---|---|---|
Zeile 63: | Zeile 63: | ||
Danach noch die initram updaten und rebooten. | Danach noch die initram updaten und rebooten. | ||
| | ||
- | update-initramfs -u | + | update-initramfs -u -k all |
Zeile 122: | Zeile 122: | ||
**Wichtig ist auch zu erwähnen das die neu hinzugefügten Platten zuerst bevorzugt auf den Füllstand der anderen Platten gebracht werden, erst dann werden wieder immer alle HDD's gleichzeitg verwendet.** | **Wichtig ist auch zu erwähnen das die neu hinzugefügten Platten zuerst bevorzugt auf den Füllstand der anderen Platten gebracht werden, erst dann werden wieder immer alle HDD's gleichzeitg verwendet.** | ||
+ | |||
+ | Als addon kann man noch eine spare disk hinzfügen, die man in Falle eines Ausfalls der produktiven Disks verwenden kann: | ||
+ | |||
+ | zpool add < | ||
Zeile 175: | Zeile 179: | ||
Nachdem dies ein Rpool ist, danach nicht vergessen Grub auf allen hinzugefügten Platten zu installieren. | Nachdem dies ein Rpool ist, danach nicht vergessen Grub auf allen hinzugefügten Platten zu installieren. | ||
+ | |||
+ | ===== Hinzufüge eines Special Device ===== | ||
+ | |||
+ | Ein " | ||
+ | |||
+ | Die Redundanz des speziellen Geräts sollte mit der des Pools übereinstimmen, | ||
+ | |||
+ | <WRAP center round tip 60%> | ||
+ | Das Hinzufügen eines speziellen Geräts zu einem Pool kann nicht rückgängig gemacht werden! | ||
+ | </ | ||
+ | |||
+ | |||
+ | Im folgenden Beispiel werden 2 Mirrors für das Special Devices verwendet. | ||
+ | |||
+ | zpool add < | ||
+ | |||
===== Korrupte Daten ===== | ===== Korrupte Daten ===== | ||
Zeile 287: | Zeile 307: | ||
| zpool list| Zeigt alle Zpools in Kurzform an | | | zpool list| Zeigt alle Zpools in Kurzform an | | ||
| zfs list| Zeigt alle ZFS-Pools und Datasets inkl. Einhängepunkte an | | | zfs list| Zeigt alle ZFS-Pools und Datasets inkl. Einhängepunkte an | | ||
- | | zpool iostat -v| Zeigt alle Festplattenaktiviäten genau an | | + | | zpool iostat -v| Zeigt alle Festplattenaktiviäten genau an, inkl. Füllstände \\ der einzellnen Festplatten |
| zfs set compression=lz4 < | | zfs set compression=lz4 < | ||
| zpool upgrade < | | zpool upgrade < | ||
Zeile 305: | Zeile 325: | ||
| zpool set listsnapshots=on rpool| zeigt bei "zfs list" auch snapshots an | | | zpool set listsnapshots=on rpool| zeigt bei "zfs list" auch snapshots an | | ||
| zfs list -r -t snapshot -o name, | | zfs list -r -t snapshot -o name, | ||
- | | zfs get volsize v-machines/ | + | | zfs get volsize v-machines/ |
| zfs set volsize=32g v-machines/ | | zfs set volsize=32g v-machines/ | ||
| zfs create -V 5gb tank/vol| legt ein neues zvol mit einer maximalen Größe von 5G an \\ (Blockdevice) | | | zfs create -V 5gb tank/vol| legt ein neues zvol mit einer maximalen Größe von 5G an \\ (Blockdevice) | | ||
| zfs set quota=50g tank/ | | zfs set quota=50g tank/ | ||
| zfs rename -p rpool/test rpool/ | | zfs rename -p rpool/test rpool/ | ||
+ | | zfs set reservation=5G mypool | Reserviert 5G damit im Falle von Disk voll \\ noch Aktionen gesetzt werden können | | ||
| zfs list -o space | Speicherauslastung inkl. wie viel für Snapshots verbraucht wird | | | zfs list -o space | Speicherauslastung inkl. wie viel für Snapshots verbraucht wird | | ||
| mount -t zfs -o ro v-machines/ | | mount -t zfs -o ro v-machines/ | ||
Zeile 549: | Zeile 570: | ||
proxmox-boot-tool init / | proxmox-boot-tool init / | ||
</ | </ | ||
+ | ==== Autoexpand of an Raidz2 Pool ==== | ||
+ | For example: | ||
+ | < | ||
+ | zpool status | ||
+ | pool: backup_pool_1 | ||
+ | | ||
+ | config: | ||
+ | |||
+ | NAME STATE READ WRITE CKSUM | ||
+ | backup_pool_1 | ||
+ | raidz2-0 | ||
+ | scsi-0QEMU_QEMU_HARDDISK_drive-scsi1 | ||
+ | scsi-0QEMU_QEMU_HARDDISK_drive-scsi2 | ||
+ | scsi-0QEMU_QEMU_HARDDISK_drive-scsi3 | ||
+ | scsi-0QEMU_QEMU_HARDDISK_drive-scsi4 | ||
+ | </ | ||
+ | |||
+ | Switch drive offline: | ||
+ | zpool offline backup_pool_1 scsi-0QEMU_QEMU_HARDDISK_drive-scsi4 | ||
+ | |||
+ | < | ||
+ | pool: backup_pool_1 | ||
+ | | ||
+ | status: One or more devices has been taken offline by the administrator. | ||
+ | Sufficient replicas exist for the pool to continue functioning in a | ||
+ | degraded state. | ||
+ | action: Online the device using 'zpool online' | ||
+ | 'zpool replace' | ||
+ | config: | ||
+ | |||
+ | NAME STATE READ WRITE CKSUM | ||
+ | backup_pool_1 | ||
+ | raidz2-0 | ||
+ | scsi-0QEMU_QEMU_HARDDISK_drive-scsi1 | ||
+ | scsi-0QEMU_QEMU_HARDDISK_drive-scsi2 | ||
+ | scsi-0QEMU_QEMU_HARDDISK_drive-scsi3 | ||
+ | scsi-0QEMU_QEMU_HARDDISK_drive-scsi4 | ||
+ | </ | ||
+ | Remove your old drive (or not if you have enouth bay's) and replace it with your new bigger one '' | ||
+ | zpool replace backup_pool_1 scsi-0QEMU_QEMU_HARDDISK_drive-scsi4 scsi-0QEMU_QEMU_HARDDISK_drive-scsi5 | ||
+ | |||
+ | < | ||
+ | pool: backup_pool_1 | ||
+ | | ||
+ | scan: resilvered 768K in 00:00:00 with 0 errors on Mon Jul 15 14:57:10 2024 | ||
+ | config: | ||
+ | |||
+ | NAME STATE READ WRITE CKSUM | ||
+ | backup_pool_1 | ||
+ | raidz2-0 | ||
+ | scsi-0QEMU_QEMU_HARDDISK_drive-scsi1 | ||
+ | scsi-0QEMU_QEMU_HARDDISK_drive-scsi2 | ||
+ | scsi-0QEMU_QEMU_HARDDISK_drive-scsi3 | ||
+ | scsi-0QEMU_QEMU_HARDDISK_drive-scsi5 | ||
+ | </ | ||
+ | Then the next drive. | ||
+ | |||
==== Umwandeln eines Rpool Singledisk in einen Mirror inkl. Autoexpand ==== | ==== Umwandeln eines Rpool Singledisk in einen Mirror inkl. Autoexpand ==== | ||
Annahme ist hier ein Rpool mit einer Samsung EVO750. Da die Disk nicht Enterprise ist und das Wearoutlevel schon bei 90% ist, fügen wir eine Samsung SM863a als Mirror hinzu. Dann können wir beim Ausfall der EVO bequem eine weitere SM863a hinzufügen. Der zeitiger Status ist: | Annahme ist hier ein Rpool mit einer Samsung EVO750. Da die Disk nicht Enterprise ist und das Wearoutlevel schon bei 90% ist, fügen wir eine Samsung SM863a als Mirror hinzu. Dann können wir beim Ausfall der EVO bequem eine weitere SM863a hinzufügen. Der zeitiger Status ist: |