Como eu crio um zpool usando o identificador uuid ou verdadeiramente único?

0

Eu criei meu primeiro zpool no outro dia, atribuindo por letra de unidade, e descobri que quando eu reiniciei, ele foi degradado. Após uma inspeção mais minuciosa, percebi que minhas letras de unidade haviam mudado com a reinicialização, então imaginei que deveria fazê-lo usando UUIDs.

Eu dei uma olhada no blkid e vi que ambas as unidades tinham uuids idênticos, presumivelmente porque eles são espelhados. Então eu destruí o pool e criei novas tabelas de partição nos discos. Quando eu corri blkid novamente, vi que as unidades não tinham mais UUIDs, apenas um PTID. Isso me levou a perceber que o UUID é uma propriedade de um sistema de arquivos, não da própria unidade.

Então, eu tentei usar / dev / disk / by-id / ambos com o UUID da unidade formatada e o PTID da unidade não formatada. Nem funcionou.

user@ubuntu:~$ sudo zpool create nvme-tank mirror /dev/disk/by-id/493fa01d /dev/disk/by-id/9398aa9e
cannot resolve path '/dev/disk/by-id/493fa01d'

user@ubuntu:~$ sudo zpool create nvme-tank mirror /dev/disk/by-id/713e95ab-f307-466c-bc6c-f9ec97914a6a /dev/disk/by-id/44042f83-1654-45b4-9803-42107393af6c
cannot resolve path '/dev/disk/by-id/713e95ab-f307-466c-bc6c-f9ec97914a6a'

esta é a saída do blkid:

/dev/sdb1: UUID="1977-5195" TYPE="vfat" PARTUUID="117c616a-01"
/dev/sdd1: UUID="3d09d690-6110-3c87-abb6-c286e58cf8ae" UUID_SUB="481418c7-ff1c-3ee6-21e1-48be73d0a083" LABEL="ubuntu:0" TYPE="linux_raid_member" PARTUUID="edbfb533-01"
/dev/sdd2: UUID="bb4a8e51-48de-3c04-435f-d48ba763b176" UUID_SUB="3cd3b591-6c08-23df-c885-812b8a4dae09" LABEL="ubuntu:1" TYPE="linux_raid_member" PARTUUID="edbfb533-02"
/dev/sde1: UUID="3d09d690-6110-3c87-abb6-c286e58cf8ae" UUID_SUB="294836fe-a958-5aa8-f9e7-fcb0d5b3ad68" LABEL="ubuntu:0" TYPE="linux_raid_member" PARTUUID="870c34a5-01"
/dev/sde2: UUID="bb4a8e51-48de-3c04-435f-d48ba763b176" UUID_SUB="4f2b1400-7d20-79f5-106f-33fdb0dafc36" LABEL="ubuntu:1" TYPE="linux_raid_member" PARTUUID="870c34a5-02"
/dev/md1: UUID="be1c70fd-3000-4a69-9106-efc73309693d" TYPE="ext4"
/dev/md0: UUID="4c0b7a2c-1b40-4979-868a-0e363bcbe771" TYPE="swap"
/dev/nvme1n1p1: UUID="713e95ab-f307-466c-bc6c-f9ec97914a6a" TYPE="ext4" PARTUUID="9398aa9e-01"
/dev/nvme2n1p1: UUID="24d22c02-be8f-41ba-9907-9494b03c16bb" TYPE="ext4" PARTUUID="edc5ee37-01"
/dev/nvme0n1p1: UUID="44042f83-1654-45b4-9803-42107393af6c" TYPE="ext4" PARTUUID="493fa01d-01"
/dev/nvme0n1: PTUUID="493fa01d" PTTYPE="dos"
/dev/nvme2n1: PTUUID="edc5ee37" PTTYPE="dos"
/dev/nvme1n1: PTUUID="9398aa9e" PTTYPE="dos"
/dev/sda: PTUUID="d5f5a456" PTTYPE="dos"
/dev/sdc: PTUUID="b462c818" PTTYPE="dos"

alguns dos tópicos que eu olhei me levaram a ver o / etc / default / zfs Descobri que a linha relevante foi comentada, mas não sabia o que fazer com os comentários acima, que estão redigidos de uma forma que me confunde:

# Specify specific path(s) to look for device nodes and/or links for the
# pool import(s). See zpool(8) for more information about this variable.
# It supersedes the old USE_DISK_BY_ID which indicated that it would only
# try '/dev/disk/by-id'.
# The old variable will still work in the code, but is deprecated.
#ZPOOL_IMPORT_PATH="/dev/disk/by-vdev:/dev/disk/by-id"

Então, minha pergunta é, posso criar zpools diretamente usando um identificador exclusivo e permanente, como o número de série? Ou existe outra maneira de criá-los pelo UUID que realmente funciona?

Estou usando o ZFS no Ubuntu Server 18.04

Editar: novas tentativas Eu também tentei o conselho aqui: link

user@ubuntu:~$ sudo zpool create nvme-tank mirror nvme0n1 nvme1n1
user@ubuntu:~$ sudo zpool export nvme-tank
user@ubuntu:~$ sudo zpool import -d /dev/disk/by-id nvme-tank

Mas agora eu não os vejo de forma alguma:

/dev/sdb1: UUID="1977-5195" TYPE="vfat" PARTUUID="117c616a-01"
/dev/sdd1: UUID="3d09d690-6110-3c87-abb6-c286e58cf8ae" UUID_SUB="481418c7-ff1c-3ee6-21e1-48be73d0a083" LABEL="ubuntu:0" TYPE="linux_raid_member" PARTUUID="edbfb533-01"
/dev/sdd2: UUID="bb4a8e51-48de-3c04-435f-d48ba763b176" UUID_SUB="3cd3b591-6c08-23df-c885-812b8a4dae09" LABEL="ubuntu:1" TYPE="linux_raid_member" PARTUUID="edbfb533-02"
/dev/sde1: UUID="3d09d690-6110-3c87-abb6-c286e58cf8ae" UUID_SUB="294836fe-a958-5aa8-f9e7-fcb0d5b3ad68" LABEL="ubuntu:0" TYPE="linux_raid_member" PARTUUID="870c34a5-01"
/dev/sde2: UUID="bb4a8e51-48de-3c04-435f-d48ba763b176" UUID_SUB="4f2b1400-7d20-79f5-106f-33fdb0dafc36" LABEL="ubuntu:1" TYPE="linux_raid_member" PARTUUID="870c34a5-02"
/dev/md1: UUID="be1c70fd-3000-4a69-9106-efc73309693d" TYPE="ext4"
/dev/md0: UUID="4c0b7a2c-1b40-4979-868a-0e363bcbe771" TYPE="swap"
/dev/nvme2n1p1: UUID="24d22c02-be8f-41ba-9907-9494b03c16bb" TYPE="ext4" PARTUUID="edc5ee37-01"
    
por Thoughtcraft 09.10.2018 / 23:51

1 resposta

0

Passei por isso usando a documentação do Arch para o ZFS: link

destruiu minha antiga piscina

user@ubuntu:~$ sudo zpool destroy nvme-tank
user@ubuntu:~$ zpool list
no pools available

Obteve os IDs das partes (não uuids)

user@ubuntu:~$ ls -lh /dev/disk/by-id/
total 0
lrwxrwxrwx 1 root root  9 Oct  9 17:04 ata-HGST_HUH728080ALN600_VJH620YX -> ../../sda
lrwxrwxrwx 1 root root  9 Oct  9 17:04 ata-HGST_HUH728080ALN600_VJH624KX -> ../../sdc
lrwxrwxrwx 1 root root  9 Oct  9 17:04 ata-Samsung_SSD_850_EVO_120GB_S21SNX0H915160K -> ../../sdd
lrwxrwxrwx 1 root root 10 Oct  9 17:04 ata-Samsung_SSD_850_EVO_120GB_S21SNX0H915160K-part1 -> ../../sdd1
lrwxrwxrwx 1 root root 10 Oct  9 17:04 ata-Samsung_SSD_850_EVO_120GB_S21SNX0H915160K-part2 -> ../../sdd2
lrwxrwxrwx 1 root root  9 Oct  9 17:04 ata-Samsung_SSD_850_EVO_120GB_S21SNX0H915161E -> ../../sde
lrwxrwxrwx 1 root root 10 Oct  9 17:04 ata-Samsung_SSD_850_EVO_120GB_S21SNX0H915161E-part1 -> ../../sde1
lrwxrwxrwx 1 root root 10 Oct  9 17:04 ata-Samsung_SSD_850_EVO_120GB_S21SNX0H915161E-part2 -> ../../sde2
lrwxrwxrwx 1 root root  9 Oct  9 17:04 md-name-ubuntu:0 -> ../../md0
lrwxrwxrwx 1 root root  9 Oct  9 17:04 md-name-ubuntu:1 -> ../../md1
lrwxrwxrwx 1 root root  9 Oct  9 17:04 md-uuid-3d09d690:61103c87:abb6c286:e58cf8ae -> ../../md0
lrwxrwxrwx 1 root root  9 Oct  9 17:04 md-uuid-bb4a8e51:48de3c04:435fd48b:a763b176 -> ../../md1
lrwxrwxrwx 1 root root 13 Oct  9 17:04 nvme-eui.0025385481b1ea19 -> ../../nvme2n1
lrwxrwxrwx 1 root root 15 Oct  9 17:04 nvme-eui.0025385481b1ea19-part1 -> ../../nvme2n1p1
lrwxrwxrwx 1 root root 13 Oct  9 19:11 nvme-eui.0025385581b40c9c -> ../../nvme0n1
lrwxrwxrwx 1 root root 13 Oct  9 19:11 nvme-eui.0025385581b40e03 -> ../../nvme1n1
lrwxrwxrwx 1 root root 13 Oct  9 17:04 nvme-Samsung_SSD_960_EVO_1TB_S3X3NF0K400271N -> ../../nvme2n1
lrwxrwxrwx 1 root root 15 Oct  9 17:04 nvme-Samsung_SSD_960_EVO_1TB_S3X3NF0K400271N-part1 -> ../../nvme2n1p1
lrwxrwxrwx 1 root root 13 Oct  9 19:11 nvme-Samsung_SSD_970_EVO_1TB_S467NF0K510805L -> ../../nvme0n1
lrwxrwxrwx 1 root root 13 Oct  9 19:11 nvme-Samsung_SSD_970_EVO_1TB_S467NF0K511164Z -> ../../nvme1n1
lrwxrwxrwx 1 root root  9 Oct  9 17:04 usb-Samsung_Flash_Drive_0373617100005284-0:0 -> ../../sdb
lrwxrwxrwx 1 root root 10 Oct  9 17:04 usb-Samsung_Flash_Drive_0373617100005284-0:0-part1 -> ../../sdb1
lrwxrwxrwx 1 root root  9 Oct  9 17:04 wwn-0x5000cca261d0d95a -> ../../sda
lrwxrwxrwx 1 root root  9 Oct  9 17:04 wwn-0x5000cca261d0d9ca -> ../../sdc
lrwxrwxrwx 1 root root  9 Oct  9 17:04 wwn-0x5002538d413f3b81 -> ../../sdd
lrwxrwxrwx 1 root root 10 Oct  9 17:04 wwn-0x5002538d413f3b81-part1 -> ../../sdd1
lrwxrwxrwx 1 root root 10 Oct  9 17:04 wwn-0x5002538d413f3b81-part2 -> ../../sdd2
lrwxrwxrwx 1 root root  9 Oct  9 17:04 wwn-0x5002538d413f3b87 -> ../../sde
lrwxrwxrwx 1 root root 10 Oct  9 17:04 wwn-0x5002538d413f3b87-part1 -> ../../sde1
lrwxrwxrwx 1 root root 10 Oct  9 17:04 wwn-0x5002538d413f3b87-part2 -> ../../sde2

Feito o novo pool, parece funcionar. Eu acho que o primeiro dispositivo na piscina não mostrando em lsblk é esperado?

user@ubuntu:~$ sudo zpool create nvme-tank mirror nvme-Samsung_SSD_970_EVO_1TB_S467NF0K510805L nvme-Samsung_SSD_970_EVO_1TB_S467NF0K511164Z
user@ubuntu:~$ blkid
/dev/sdb1: UUID="1977-5195" TYPE="vfat" PARTUUID="117c616a-01"
/dev/sdd1: UUID="3d09d690-6110-3c87-abb6-c286e58cf8ae" UUID_SUB="481418c7-ff1c-3ee6-21e1-48be73d0a083" LABEL="ubuntu:0" TYPE="linux_raid_member" PARTUUID="edbfb533-01"
/dev/sdd2: UUID="bb4a8e51-48de-3c04-435f-d48ba763b176" UUID_SUB="3cd3b591-6c08-23df-c885-812b8a4dae09" LABEL="ubuntu:1" TYPE="linux_raid_member" PARTUUID="edbfb533-02"
/dev/sde1: UUID="3d09d690-6110-3c87-abb6-c286e58cf8ae" UUID_SUB="294836fe-a958-5aa8-f9e7-fcb0d5b3ad68" LABEL="ubuntu:0" TYPE="linux_raid_member" PARTUUID="870c34a5-01"
/dev/sde2: UUID="bb4a8e51-48de-3c04-435f-d48ba763b176" UUID_SUB="4f2b1400-7d20-79f5-106f-33fdb0dafc36" LABEL="ubuntu:1" TYPE="linux_raid_member" PARTUUID="870c34a5-02"
/dev/md1: UUID="be1c70fd-3000-4a69-9106-efc73309693d" TYPE="ext4"
/dev/md0: UUID="4c0b7a2c-1b40-4979-868a-0e363bcbe771" TYPE="swap"
/dev/nvme2n1p1: UUID="24d22c02-be8f-41ba-9907-9494b03c16bb" TYPE="ext4" PARTUUID="edc5ee37-01"
/dev/nvme1n1: LABEL="nvme-tank" UUID="12820183881567404585" UUID_SUB="7696346709622828030" TYPE="zfs_member"
    
por 10.10.2018 / 07:18