Stefans Computer Blog


Verwaltung von externen USB-Festplatten mit ZFS unter OmniOS


ZFS ist das Standard-Dateisystem unter OmniOS. Festplatten werden in ZFS-Speicher-Pools verwaltet.

Ein ZFS-Speicherpool kann auch aus mehreren Festplatten bestehen. Festplatten können beliebig zu Speicherpools hinzugefügt oder entfernt werden.

Um eine externe USB-Festplatte einem ZFS-Speicherpool hinzuzufügen muss auf dieser zunächst eine ZFS-Partition erstellt werden.


1. ZFS-Partition auf der externen USB-Festplatte erstellen

USB-Festplatte anschließen und den Gerätenamen ermitteln:


rmformat

Looking for devices...
     1. Logical Node: /dev/rdsk/c4t0d0p0
        Physical Node: /pci@0,0/pci17aa,3140@14/storage@14/disk@0,0
        Connected Device: asmedia  ASMT1153e        0  
        Device Type: Removable
        Bus: USB
        Size: 953,9 GB
        Label: 
        Access permissions: Medium is not write protected.
			

Der Gerätename lautet in diesem Beispiel /dev/rdsk/c4t0d0p0

Das Programm fdisk aufrufen:


fdisk /dev/rdsk/c4t0d0p0
			

Sofern hier eine bestehende Partition angezeigt wird, diese mit


3. Delete a partition
			

löschen. Danach


1. Create a partition
			

auswählen.


Select the partition type to create:
   1=SOLARIS2  2=UNIX        3=PCIXOS     4=Other
   5=DOS12     6=DOS16       7=DOSEXT     8=DOSBIG
   9=DOS16LBA  A=x86 Boot    B=Diagnostic C=FAT32
   D=FAT32LBA  E=DOSEXTLBA   F=EFI        0=Exit?
			


1=SOLARIS2
			

auswählen.


Specify the percentage of disk to use for this partition
(or type "c" to specify the size in cylinders).
			

Um die gesamte Festplatte zu partitionieren 100% eingeben.


Should this become the active partition? If yes, it  will be activated
each time the computer is reset or turned on.
Please type "y" or "n".
			

Die Partition soll nicht die aktive Partition werden, daher n eingeben.

Danach mit


6. Exit (update disk configuration and exit)
			

das Programm verlassen.


2. ZFS-Speicherpool erstellen


zpool create usb-hdd c4t0d0p0
			

Es wurde ein ZFS-Speicherpool mit dem Namen usb-hdd erstellt und die externe USB-Festplatte eingefügt.

Mit zfs list überprüfen, ob der ZFS-Speicherpool angelegt wurde:


root@omniostest:~# zfs list
NAME                                    USED  AVAIL  REFER  MOUNTPOINT
rpool                                  36,2G   863G   108K  /rpool
rpool/ROOT                             3,94G   863G    96K  legacy
rpool/ROOT/omnios-r151036              45,5M   863G   782M  legacy
rpool/ROOT/omnios-r151036-backup-1      288K   863G   785M  /
rpool/ROOT/omnios-r151036p             11,3M   863G   810M  /
rpool/ROOT/omnios-r151036p-1           9,16M   863G   838M  /
rpool/ROOT/omnios-r151036p-1-backup-1   264K   863G   830M  /
rpool/ROOT/omnios-r151036p-1-backup-2   240K   863G   861M  /
rpool/ROOT/omnios-r151036v             3,87G   863G  3,09G  /
rpool/dump                             1,00G   863G  1,00G  -
rpool/home                             27,0G   863G   104K  /home
rpool/home/GRUPPE                      27,0G   863G  27,0G  /home/GRUPPE
rpool/home/pgsql                       8,43M   863G  8,28M  /home/pgsql
rpool/home/stefan                      6,39M   863G  6,28M  /home/stefan
rpool/swap                             4,25G   867G  19,8M  -
usb-hdd                                 100K   899G    24K  /usb-hdd
			


3. ZFS Dataset auf dem ZFS-Speicherpool erstellen


zfs create usb-hdd/daten
			

Es wurde das ZFS-Dataset daten auf dem ZFS-Speicherpool usb-hdd erstellt.


root@omniostest:/usb-hdd/daten# zfs list
NAME                                    USED  AVAIL  REFER  MOUNTPOINT
rpool                                  36,6G   862G   108K  /rpool
rpool/ROOT                             4,27G   862G    96K  legacy
rpool/ROOT/omnios-r151036              45,5M   862G   782M  legacy
rpool/ROOT/omnios-r151036-backup-1      288K   862G   785M  /
rpool/ROOT/omnios-r151036p             11,3M   862G   810M  /
rpool/ROOT/omnios-r151036p-1           9,16M   862G   838M  /
rpool/ROOT/omnios-r151036p-1-backup-1   264K   862G   830M  /
rpool/ROOT/omnios-r151036p-1-backup-2   240K   862G   861M  /
rpool/ROOT/omnios-r151036v             4,21G   862G  3,43G  /
rpool/dump                             1,00G   862G  1,00G  -
rpool/home                             27,0G   862G   104K  /home
rpool/home/GRUPPE                      27,0G   862G  27,0G  /home/GRUPPE
rpool/home/pgsql                       8,43M   862G  8,28M  /home/pgsql
rpool/home/stefan                      2,97M   862G  2,86M  /home/stefan
rpool/swap                             4,25G   867G  19,8M  -
usb-hdd                                 349M   899G    25K  /usb-hdd
usb-hdd/daten                           349M   899G   349M  /usb-hdd/daten
			

Wenn die USB-Festplatte wieder entfernt werden soll, muss der ZFS-Speicherpool usb-hdd exportiert werden.


4. ZFS-Speicherpool exportieren


zpool export usb-hdd
			

Die USB-Festplatte kann jetzt entfernt werden.


5. ZFS-Speicherpool importieren

Die USB-Festplatte kann wieder in das Dateisystem eingefügt werden, indem der ZFS-Speicherpool importiert wird:


zpool import usb-hdd
			


root@omniostest:/root# zfs list
NAME                                    USED  AVAIL  REFER  MOUNTPOINT
rpool                                  36,6G   862G   108K  /rpool
rpool/ROOT                             4,27G   862G    96K  legacy
rpool/ROOT/omnios-r151036              45,5M   862G   782M  legacy
rpool/ROOT/omnios-r151036-backup-1      288K   862G   785M  /
rpool/ROOT/omnios-r151036p             11,3M   862G   810M  /
rpool/ROOT/omnios-r151036p-1           9,16M   862G   838M  /
rpool/ROOT/omnios-r151036p-1-backup-1   264K   862G   830M  /
rpool/ROOT/omnios-r151036p-1-backup-2   240K   862G   861M  /
rpool/ROOT/omnios-r151036v             4,21G   862G  3,43G  /
rpool/dump                             1,00G   862G  1,00G  -
rpool/home                             27,0G   862G   104K  /home
rpool/home/GRUPPE                      27,0G   862G  27,0G  /home/GRUPPE
rpool/home/pgsql                       8,43M   862G  8,28M  /home/pgsql
rpool/home/stefan                      2,97M   862G  2,86M  /home/stefan
rpool/swap                             4,25G   867G  19,8M  -
usb-hdd                                 349M   899G    25K  /usb-hdd
usb-hdd/daten                           349M   899G   349M  /usb-hdd/daten
			



Kontakt: mail@tkfibu.de


HOME