Skip to content

ZFS - One Disk Pool -> Mirror Pool

Linux
1 1 212
  • Auf meinem neuen Rechner, habe ich einen Proxmox installiert. Als Datengrab hatte ich eine Platte meines alten RAID Verbundes genommen und dort eingebaut.

    Dann alle Daten vom NAS auf die neue Platte im Proxmox geschaufelt. Die Platte sieht so aus.

    root@pve:~# zpool status
      pool: ZFS-Pool
     state: ONLINE
    config:
    
    	NAME                                        STATE     READ WRITE CKSUM
    	ZFS-Pool                                    ONLINE       0     0     0
    	  ata-WDC_WD40EZRZ-00GXCB0_WD-WCC7K6XD2C26  ONLINE       0     0     0
    
    errors: No known data errors
    

    Ok, so weit so gut. Nachdem jetzt alle Daten drüben sind, ich das so weit es ging kontrolliert habe, nehme ich jetzt die zweite Platte aus dem NAS heraus und möchte diese zu dem ZFS-Pool hängen, so das ein Mirror entsteht. Keine Sorge, wenn was schief geht, ich habe auch immer noch ein Backup des NAS 🙂

    Mal schnell im Netz ein paar Seiten angeschaut und ein, zwei Videos angesehen. Ich denke ich weiß jetzt, wie es geht ....

    Ok, erster Versuch

    Bitte nicht die Disk Label sda sdb usw. benutzen! Nur die IDs aus /dev/disk/by-id !!

    root@pve:~# zpool attach ZFS-Pool sda sdb
    cannot attach sdb to sda: no such device in pool
    

    Hmm, geht nicht. Mir war aber sehr schnell klar, woran das lag. Wie man im Status sieht, hat die PVE Software, den Namen von /dev/disk/by-id genommen.

    root@pve:/dev/disk# ls by-id/
    ata-WDC_ata-WDC_WD40EZRZ-00GXCB0_WD-WCC7K6XD2C26
    [..gekürzt..]
    

    Ich hatte jetzt folgendes eingegeben

    root@pve:~# zpool attach ZFS-Pool ata-WDC_WD40EZRZ-00GXCB0_WD-WCC7K6XD2C26 sdb
    

    Nach kurzer Zeit war der Befehl fertig. Kontrolle

    root@pve:~# zpool status
      pool: ZFS-Pool
     state: ONLINE
    status: One or more devices is currently being resilvered.  The pool will
    	continue to function, possibly in a degraded state.
    action: Wait for the resilver to complete.
      scan: resilver in progress since Sun Oct 17 08:25:49 2021
    	55.7G scanned at 6.19G/s, 264K issued at 29.3K/s, 838G total
    	0B resilvered, 0.00% done, no estimated completion time
    config:
    
    	NAME                                          STATE     READ WRITE CKSUM
    	ZFS-Pool                                      ONLINE       0     0     0
    	  mirror-0                                    ONLINE       0     0     0
    	    ata-WDC_WD40EZRZ-00GXCB0_WD-WCC7K6XD2C26  ONLINE       0     0     0
    	    sdb                                       ONLINE       0     0     0
    
    errors: No known data errors
    

    Wie man sieht, ist der Mirror vorhanden. Der Mirror macht aktuell einen "resilver", ok kann ich mir nicht richtig übersetzen aber ich weiß ja was er jetzt macht. Er spiegelt die Daten von der einen Platte auf die anderen. Später sieht das so aus.

    root@pve:/dev/disk# zpool status -v ZFS-Pool
      pool: ZFS-Pool
     state: ONLINE
    status: One or more devices is currently being resilvered.  The pool will
    	continue to function, possibly in a degraded state.
    action: Wait for the resilver to complete.
      scan: resilver in progress since Sun Oct 17 08:25:49 2021
    	838G scanned at 502M/s, 185G issued at 111M/s, 838G total
    	187G resilvered, 22.06% done, 01:40:33 to go
    config:
    
    	NAME                                          STATE     READ WRITE CKSUM
    	ZFS-Pool                                      ONLINE       0     0     0
    	  mirror-0                                    ONLINE       0     0     0
    	    ata-WDC_WD40EZRZ-00GXCB0_WD-WCC7K6XD2C26  ONLINE       0     0     0
    	    sdb                                       ONLINE       0     0     0  (resilvering)
    
    errors: No known data errors
    

    OK, ist noch dran 🙂

    Jetzt so im Nachhinein betrachtet, bekomme ich ein wenig Kopfschmerzen, ob ich nicht auch besser die by-id benutzt hätte!?? Das weiß ich aktuell nicht, muss ich googeln.

    Was man machen könnte, das Laufwerk sdb detachen und dann mit by-id attachen. Aber, ob das Sinn macht???

    Hier ein netter Beitrag im Netz, was man machen kann wenn die Label falsch sind.

  • 0 Stimmen
    1 Beiträge
    4 Aufrufe
    Niemand hat geantwortet
  • Podman & nftables

    Linux podman nftables linux
    1
    0 Stimmen
    1 Beiträge
    137 Aufrufe
    Niemand hat geantwortet
  • Debian 12 & fail2ban

    Linux debian linux fail2ban
    1
    0 Stimmen
    1 Beiträge
    122 Aufrufe
    Niemand hat geantwortet
  • OpenCloud - Docker Compose local

    Verschoben OpenCloud opencloud linux
    3
    1
    0 Stimmen
    3 Beiträge
    667 Aufrufe
    FrankMF
    Noch was Wichtiges. Die Docker Installation nutzt folgende config. In meinem Beispiel findet man sie unter /home/frank/opencloud/deployments/examples/opencloud_full Darin liegt ein .env ## Basic Settings ## # Define the docker compose log driver used. # Defaults to local LOG_DRIVER= # If you're on an internet facing server, comment out following line. # It skips certificate validation for various parts of OpenCloud and is # needed when self signed certificates are used. INSECURE=true ## Traefik Settings ## # Note: Traefik is always enabled and can't be disabled. # Serve Traefik dashboard. # Defaults to "false". TRAEFIK_DASHBOARD= # Domain of Traefik, where you can find the dashboard. # Defaults to "traefik.opencloud.test" TRAEFIK_DOMAIN= # Basic authentication for the traefik dashboard. # Defaults to user "admin" and password "admin" (written as: "admin:$2y$05$KDHu3xq92SPaO3G8Ybkc7edd51pPLJcG1nWk3lmlrIdANQ/B6r5pq"). # To create user:password pair, it's possible to use this command: # echo $(htpasswd -nB user) | sed -e s/\\$/\\$\\$/g TRAEFIK_BASIC_AUTH_USERS= # Email address for obtaining LetsEncrypt certificates. # Needs only be changed if this is a public facing server. TRAEFIK_ACME_MAIL= # Set to the following for testing to check the certificate process: # "https://acme-staging-v02.api.letsencrypt.org/directory" # With staging configured, there will be an SSL error in the browser. # When certificates are displayed and are emitted by # "Fake LE Intermediate X1", # the process went well and the envvar can be reset to empty to get valid certificates. TRAEFIK_ACME_CASERVER= [....gekürzt....] Man kann dort etwas ändern und mittels docker compose up -d alles aktualisieren. Radicale OpenCloud nutzt im Moment folgendes https://radicale.org/v3.html als Backend Server für Kalender & Kontakte. Jemand hat mir dann erklärt, wie das so funktioniert. Danach hatte es dann klick gemacht. https://fosstodon.org/@h4kamp/114562514701351170 In der config findet man zum Beispiel die Konfiguration für radicale (Kalender- und Kontakte-App) Das ist nur eine rudimentäre Ablage, wird gesteuert über Clienten, z.B. die Thunderbird Kalender Funktion. ### Radicale Setting ### # Radicale is a small open-source CalDAV (calendars, to-do lists) and CardDAV (contacts) server. # When enabled OpenCloud is configured as a reverse proxy for Radicale, providing all authenticated # OpenCloud users access to a Personal Calendar and Addressbook RADICALE=:radicale.yml # Docker image to use for the Radicale Container #RADICALE_DOCKER_IMAGE=opencloudeu/radicale # Docker tag to pull for the Radicale Container #RADICALE_DOCKER_TAG=latest # Define the storage location for the Radicale data. Set the path to a local path. # Ensure that the configuration and data directories are owned by the user and group with ID 1000:1000. # This matches the default user inside the container and avoids permission issues when accessing files. # Leaving it default stores data in docker internal volumes. #RADICALE_DATA_DIR=/your/local/radicale/data In einer Standard Installation ist das auskommentiert. RADICALE=:radicale.yml Danach ein docker compose up -d und Eure Kalendereinträge (extern auf einem Clienten verwaltet) werden in der OpenCloud gesichert.
  • NodeBB - 4.3.0

    NodeBB nodebb linux
    1
    0 Stimmen
    1 Beiträge
    156 Aufrufe
    Niemand hat geantwortet
  • PyWebIO vs. Flask

    Python3 pywebio flask linux python
    2
    0 Stimmen
    2 Beiträge
    281 Aufrufe
    FrankMF
    Mist, jetzt habe ich auch noch Streamlit gefunden. Jetzt geht mir langsam die Zeit aus...
  • Kopia - HTTP/S Server

    Verschoben Kopia kopia linux
    3
    2
    0 Stimmen
    3 Beiträge
    2k Aufrufe
    FrankMF
    Ich hatte ein paar Probleme, die ich mir teilweise nicht erklären kann Ich möchte den Kopia Server gerne über systemd steuern. SystemD [Unit] Description=Kopia Server After=syslog.target After=network.target [Service] Type=simple User=kopia Group=kopia ExecStart=/usr/bin/kopia server --tls-cert-file /home/kopia-server/fullchain.pem --tls-key-file /home/kopia-server/privkey.pem --htpasswd-file /home/kopia-server/.htpasswd --address <IPv4>:51515 Restart=always RestartSec=5 [Install] WantedBy=multi-user.target Danach systemctl daemon-reload systemctl start kopia-server Mit systemctl status kopia-server kann man sich den Status anzeigen lassen. Client Rechner Auf dem Client, der das Backup zum Server schicken soll, machen wir dann folgendes. USER@HOSTNAME:~$ kopia repo connect server --url=https://<DOMAIN>:51515 --override-username=USER --override-hostname=HOSTNAME Enter password to open repository: Connected to repository API Server. NOTICE: Kopia will check for updates on GitHub every 7 days, starting 24 hours after first use. To disable this behavior, set environment variable KOPIA_CHECK_FOR_UPDATES=false Alternatively you can remove the file "/home/frank/.config/kopia/repository.config.update-info.json". Danach steht die Verbindung und wir können Backups hochschieben. kopia snapshot create $HOME Damit wird das Homeverzeichnis gesichert. Das initiale Backup, hat 30 Minuten gebraucht. created snapshot with root kb9e50ff5xxxxxxxxxx265d40a5d0861 and ID cda5c0ffxxxxxxxxxxxxxxa4cb4a367b in 30m28s Ein späteres Backup, sieht so aus. USER@HOSTNAME:~$ kopia snapshot create $HOME Snapshotting USER@HOSTNAME:/home/frank ... * 0 hashing, 51 hashed (324.8 MB), 8524 cached (6.6 GB), 0 uploaded (0 B), 0 errors 100.0% Created snapshot with root kc20a4xxxxxxxxxxxx745c6c7b37c and ID d7a96eaxxxxxxxxxxx0961018eacffa in 3m12s Nach 3 Minuten durch. Zu diesem Zeitpunkt hat sich aber auch nicht wirklich was geändert! Fazit Das Tool macht immer noch einen sehr guten Eindruck. Die Geschwindigkeit ist sehr gut. Die Anleitung ist leider unzureichend. Da gibt es so viele Möglichkeiten, da braucht es sehr lange, bis man da mal durchsteigt. Zum Glück, ist das was man normalerweise braucht, recht überschaubar. Bis zum produktiven Einsatz braucht das aber bei mir noch eine Menge mehr Tests. Was ich noch testen möchte Verzeichnis mounten Backup testweise wieder herstellen (zumindestens teilweise) Der Test läuft mit Standard Einstellungen, also z.B. ohne Kompression. Das sollte man dann auch mal testen.. Bitte achtet auf gleiche Versionen auf dem Clienten, wie auf dem Server. Ich meine da ein paar Probleme festgestellt zu haben...
  • checkmk - systemd crasht

    Verschoben checkmk checkmk linux
    1
    0 Stimmen
    1 Beiträge
    734 Aufrufe
    Niemand hat geantwortet