Hier werden die Unterschiede zwischen zwei Versionen angezeigt.
| Beide Seiten der vorigen RevisionVorhergehende Überarbeitung | |||
| computer:zfs-storage_unter_debian_squeeze [2011/03/01 17:09] – christian | computer:zfs-storage_unter_debian_squeeze [2012/03/02 12:58] (aktuell) – gelöscht christian | ||
|---|---|---|---|
| Zeile 1: | Zeile 1: | ||
| - | Debian GNU/ | ||
| - | ======Kurzübersicht über ZFS====== | ||
| - | Gegenüber bestehenden Software-RAID- und LVM-Systemen stellt ZFS einen sehr interessanten und professionellen Lösungsansatz dar. ZFS ist ein 128-bit Dateisystem, | ||
| - | |||
| - | * RAID 0 - Striping | ||
| - | * RAID 1 - Mirroring | ||
| - | * RAID Z-1 - 1x Parität (// | ||
| - | * RAID Z-2 - 2x Parität (// | ||
| - | * RAID Z-3 - 3x Parität | ||
| - | |||
| - | ZFS ist sehr leicht zu administrieren und somit ideal für sämtliche Einsatzgebiete. Nicht nur im Rechenzentrum erfreut sich ZFS großer Beliebtheit - auch im Heimbereich (// | ||
| - | |||
| - | |||
| - | ======Idee====== | ||
| - | Als plausibles Beispiel dient hier ein Eigenbau-NAS. Es soll Nutzdaten in einem RAID-5 Verbund sichern und mittels Samba dem Heimnetzwerk zur Verfügung stellen. | ||
| - | |||
| - | |||
| - | ======Konfiguration====== | ||
| - | Die Installation von Debian GNU/ | ||
| - | |||
| - | Zuerst ist wichtig, dass alle Festplatten erkannt wurden (//hier 6 virtuelle Festplatten// | ||
| - | |||
| - | < | ||
| - | # dmesg | ||
| - | ... | ||
| - | da0 at mpt0 bus 0 scbus0 target 0 lun 0 | ||
| - | da0: <VMware, VMware Virtual S 1.0> Fixed Direct Access SCSI-2 device | ||
| - | da0: 320.000MB/s transfers (160.000MHz DT, offset 127, 16bit) | ||
| - | da0: Command Queueing enabled | ||
| - | da0: 1048576MB (2147483648 512 byte sectors: 255H 63S/T 133674C) | ||
| - | da1 at mpt0 bus 0 scbus0 target 1 lun 0 | ||
| - | da1: <VMware, VMware Virtual S 1.0> Fixed Direct Access SCSI-2 device | ||
| - | da1: 320.000MB/s transfers (160.000MHz DT, offset 127, 16bit) | ||
| - | da1: Command Queueing enabled | ||
| - | da1: 1048576MB (2147483648 512 byte sectors: 255H 63S/T 133674C) | ||
| - | da2 at mpt0 bus 0 scbus0 target 2 lun 0 | ||
| - | da2: <VMware, VMware Virtual S 1.0> Fixed Direct Access SCSI-2 device | ||
| - | da2: 320.000MB/s transfers (160.000MHz DT, offset 127, 16bit) | ||
| - | da2: Command Queueing enabled | ||
| - | da2: 1048576MB (2147483648 512 byte sectors: 255H 63S/T 133674C) | ||
| - | da3 at mpt0 bus 0 scbus0 target 3 lun 0 | ||
| - | da3: <VMware, VMware Virtual S 1.0> Fixed Direct Access SCSI-2 device | ||
| - | da3: 320.000MB/s transfers (160.000MHz DT, offset 127, 16bit) | ||
| - | da3: Command Queueing enabled | ||
| - | da3: 1048576MB (2147483648 512 byte sectors: 255H 63S/T 133674C) | ||
| - | da4 at mpt0 bus 0 scbus0 target 4 lun 0 | ||
| - | da4: <VMware, VMware Virtual S 1.0> Fixed Direct Access SCSI-2 device | ||
| - | da4: 320.000MB/s transfers (160.000MHz DT, offset 127, 16bit) | ||
| - | da4: Command Queueing enabled | ||
| - | da4: 1048576MB (2147483648 512 byte sectors: 255H 63S/T 133674C) | ||
| - | da5 at mpt0 bus 0 scbus0 target 5 lun 0 | ||
| - | da5: <VMware, VMware Virtual S 1.0> Fixed Direct Access SCSI-2 device | ||
| - | da5: 320.000MB/s transfers (160.000MHz DT, offset 127, 16bit) | ||
| - | da5: Command Queueing enabled | ||
| - | da5: 1048576MB (2147483648 512 byte sectors: 255H 63S/T 133674C) | ||
| - | </ | ||
| - | |||
| - | Die Erstellung des Pools ist kinderleicht! Mit einem Befehl werden alle Festplatten zu neuen Pool namens "// | ||
| - | |||
| - | # zpool create pool0 raidz / | ||
| - | |||
| - | Ein kleiner Blick in den Pool mit **zpool** zeigt, dass alle Festplatten eingebunden wurden: | ||
| - | < | ||
| - | # zpool status pool0 | ||
| - | pool: pool0 | ||
| - | | ||
| - | | ||
| - | config: | ||
| - | |||
| - | NAME STATE READ WRITE CKSUM | ||
| - | pool0 | ||
| - | raidz1 | ||
| - | da0 | ||
| - | da1 | ||
| - | da2 | ||
| - | da3 | ||
| - | da4 | ||
| - | da5 | ||
| - | |||
| - | errors: No known data errors | ||
| - | </ | ||
| - | |||
| - | Ein weiterer Blick auf die Pools mithilfe **zpool** zeigt den verfügbaren Speicherplatz: | ||
| - | |||
| - | < | ||
| - | # zpool list | ||
| - | NAME SIZE | ||
| - | pool0 6,00T | ||
| - | </ | ||
| - | |||
| - | Der Mountpoint des Pools wird der Übersicht halber nun noch geändert, aktuell befindet er sich direkt auf Root-Ebene: | ||
| - | |||
| - | < | ||
| - | # zfs get mountpoint pool0 | ||
| - | NAME | ||
| - | pool0 mountpoint | ||
| - | root@vm-debsqueeze: | ||
| - | root@vm-debsqueeze: | ||
| - | root@vm-debsqueeze: | ||
| - | NAME | ||
| - | pool0 mountpoint | ||
| - | </ | ||
| - | |||
| - | |||
| - | =====Samba-Freigabe===== | ||
| - | < | ||
| - | Paketlisten werden gelesen... Fertig | ||
| - | Abhängigkeitsbaum wird aufgebaut | ||
| - | Statusinformationen werden eingelesen... Fertig | ||
| - | Die folgenden zusätzlichen Pakete werden installiert: | ||
| - | ... | ||
| - | Möchten Sie fortfahren [J/n]? j | ||
| - | ... | ||
| - | |||
| - | # mv / | ||
| - | # nano / | ||
| - | </ | ||
| - | |||
| - | < | ||
| - | [global] | ||
| - | workgroup = TEST | ||
| - | server string = Test-NAS | ||
| - | obey pam restrictions = Yes | ||
| - | passdb backend = tdbsam | ||
| - | pam password change = Yes | ||
| - | passwd program = / | ||
| - | passwd chat = *Enter\snew\s*\spassword: | ||
| - | unix password sync = Yes | ||
| - | syslog = 0 | ||
| - | log file = / | ||
| - | max log size = 1000 | ||
| - | dns proxy = No | ||
| - | panic action = / | ||
| - | |||
| - | [homes] | ||
| - | comment = Home Directories | ||
| - | valid users = %S | ||
| - | create mask = 0700 | ||
| - | directory mask = 0700 | ||
| - | browseable = No | ||
| - | |||
| - | [storage] | ||
| - | comment = Storage | ||
| - | path = / | ||
| - | read only = No | ||
| - | locking = No | ||
| - | </ | ||
| - | |||
| - | **Testparm** verrät jetzt noch, ob der Syntax der Datei korrekt ist: | ||
| - | |||
| - | < | ||
| - | # testparm | ||
| - | Load smb config files from / | ||
| - | Processing section " | ||
| - | Processing section " | ||
| - | Loaded services file OK. | ||
| - | Server role: ROLE_STANDALONE | ||
| - | Press enter to see a dump of your service definitions | ||
| - | ... | ||
| - | </ | ||
| - | |||
| - | Der Übersichtlichkeit halber werden die Dateirechte für einen Benutzer gesetzt - er erhält auch ein Samba-Passwort, | ||
| - | |||
| - | < | ||
| - | # smbpasswd -a christian | ||
| - | New SMB password: | ||
| - | Retype new SMB password: | ||
| - | # chown christian / | ||
| - | # chgrp christian / | ||
| - | # chown christian / | ||
| - | # chgrp christian / | ||
| - | # chmod 775 / | ||
| - | # / | ||
| - | Stopping Samba daemons: nmbd smbd. | ||
| - | Starting Samba daemons: nmbd smbd. | ||
| - | </ | ||
| - | |||
| - | |||
| - | ======Rudimentäre Administration====== | ||
| - | =====Pool löschen====== | ||
| - | < | ||
| - | # zpool destroy pool0 | ||
| - | # zpool list | ||
| - | no pools available | ||
| - | </ | ||
| - | |||
| - | =====Pool erstellen===== | ||
| - | < | ||
| - | # zpool destroy pool0 | ||
| - | # zpool list | ||
| - | no pools available | ||
| - | </ | ||
| - | |||
| - | |||
| - | |||
| - | =====Pool erstellen===== | ||
| - | ====Striping (RAID-0)==== | ||
| - | < | ||
| - | # zpool status pool0 | ||
| - | pool: pool0 | ||
| - | | ||
| - | | ||
| - | config: | ||
| - | |||
| - | NAME STATE READ WRITE CKSUM | ||
| - | pool0 | ||
| - | da0 | ||
| - | da1 | ||
| - | da2 | ||
| - | da3 | ||
| - | da4 | ||
| - | da5 | ||
| - | |||
| - | errors: No known data errors</ | ||
| - | |||
| - | |||
| - | |||
| - | ====Mirroring (RAID-1)==== | ||
| - | < | ||
| - | # zpool status pool0 | ||
| - | pool: pool0 | ||
| - | | ||
| - | | ||
| - | config: | ||
| - | |||
| - | NAME STATE READ WRITE CKSUM | ||
| - | pool0 | ||
| - | mirror | ||
| - | da0 | ||
| - | da1 | ||
| - | |||
| - | errors: No known data errors | ||
| - | # zpool list | ||
| - | NAME SIZE | ||
| - | pool0 1022G 79,5K 1022G | ||
| - | |||
| - | |||
| - | |||
| - | ====RAID-Z1 (~RAID-5)==== | ||
| - | # zpool create pool0 raidz / | ||
| - | # zpool status pool0 | ||
| - | pool: pool0 | ||
| - | | ||
| - | | ||
| - | config: | ||
| - | |||
| - | NAME STATE READ WRITE CKSUM | ||
| - | pool0 | ||
| - | raidz1 | ||
| - | da0 | ||
| - | da1 | ||
| - | da2 | ||
| - | da3 | ||
| - | da4 | ||
| - | da5 | ||
| - | |||
| - | errors: No known data errors | ||
| - | # zpool list | ||
| - | NAME SIZE | ||
| - | pool0 6,00T | ||
| - | |||
| - | |||
| - | |||
| - | ====RAID-Z2 (~RAID-6)==== | ||
| - | < | ||
| - | # zpool status pool0 | ||
| - | pool: pool0 | ||
| - | | ||
| - | | ||
| - | config: | ||
| - | |||
| - | NAME STATE READ WRITE CKSUM | ||
| - | pool0 | ||
| - | raidz2 | ||
| - | da0 | ||
| - | da1 | ||
| - | da2 | ||
| - | da3 | ||
| - | da4 | ||
| - | da5 | ||
| - | |||
| - | errors: No known data errors | ||
| - | # zpool list | ||
| - | NAME SIZE | ||
| - | pool0 6,00T | ||
| - | |||
| - | |||
| - | |||
| - | =====Spare hinzufügen====== | ||
| - | Spares sind Festplatten, | ||
| - | |||
| - | < | ||
| - | # zpool create pool0 raidz / | ||
| - | # zpool add pool0 spare /dev/da5 | ||
| - | # zpool status pool0 | ||
| - | pool: pool0 | ||
| - | | ||
| - | | ||
| - | config: | ||
| - | |||
| - | NAME STATE READ WRITE CKSUM | ||
| - | pool0 | ||
| - | raidz1 | ||
| - | da0 | ||
| - | da1 | ||
| - | da2 | ||
| - | da3 | ||
| - | da4 | ||
| - | spares | ||
| - | da5 AVAIL | ||
| - | |||
| - | errors: No known data errors | ||
| - | # zpool list | ||
| - | NAME SIZE | ||
| - | pool0 5,00T | ||
| - | </ | ||
| - | |||
| - | |||
| - | |||
| - | ======Internet-Verweise====== | ||
| - | * Projektseite von Debian GNU/ | ||
| - | * Wikipedia-Artikel über ZFS: http:// | ||
| - | * OpenSolaris-Artikel über ZFS: http:// | ||