Depois de cavar eternamente esta noite, finalmente encontrei a solução. A resposta curta é que você pode usar os GUIDs dos discos (que persistem mesmo após desconectar uma unidade) com o comando zpool
.
Resposta longa:
Eu tenho o GUID do disco usando o comando zdb
que me deu a seguinte saída
root@zeus:/dev# zdb
hermes:
version: 28
name: 'hermes'
state: 0
txg: 162804
pool_guid: 14829240649900366534
hostname: 'zeus'
vdev_children: 1
vdev_tree:
type: 'root'
id: 0
guid: 14829240649900366534
children[0]:
type: 'raidz'
id: 0
guid: 5355850150368902284
nparity: 1
metaslab_array: 31
metaslab_shift: 32
ashift: 9
asize: 791588896768
is_log: 0
create_txg: 4
children[0]:
type: 'disk'
id: 0
guid: 11426107064765252810
path: '/dev/disk/by-id/ata-ST3300620A_5QF0MJFP-part2'
phys_path: '/dev/gptid/73b31683-537f-11e2-bad7-50465d4eb8b0'
whole_disk: 1
create_txg: 4
children[1]:
type: 'disk'
id: 1
guid: 15935140517898495532
path: '/dev/disk/by-id/ata-ST3300831A_5NF0552X-part2'
phys_path: '/dev/gptid/746c949a-537f-11e2-bad7-50465d4eb8b0'
whole_disk: 1
create_txg: 4
children[2]:
type: 'disk'
id: 2
guid: 7183706725091321492
path: '/dev/disk/by-id/ata-ST3200822A_5LJ1CHMS-part2'
phys_path: '/dev/gptid/7541115a-537f-11e2-bad7-50465d4eb8b0'
whole_disk: 1
create_txg: 4
children[3]:
type: 'disk'
id: 3
guid: 17196042497722925662
path: '/dev/disk/by-id/ata-ST3200822A_3LJ0189C-part2'
phys_path: '/dev/gptid/760a94ee-537f-11e2-bad7-50465d4eb8b0'
whole_disk: 1
create_txg: 4
features_for_read:
O GUID que eu estava procurando é 15935140517898495532
, o que me permitiu fazer
root@zeus:/dev# zpool offline hermes 15935140517898495532
root@zeus:/dev# zpool status
pool: hermes
state: DEGRADED
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' or replace the device with
'zpool replace'.
scan: scrub repaired 0 in 2h4m with 0 errors on Sun Jun 9 00:28:24 2013
config:
NAME STATE READ WRITE CKSUM
hermes DEGRADED 0 0 0
raidz1-0 DEGRADED 0 0 0
ata-ST3300620A_5QF0MJFP ONLINE 0 0 0
ata-ST3300831A_5NF0552X OFFLINE 0 0 0
ata-ST3200822A_5LJ1CHMS ONLINE 0 0 0
ata-ST3200822A_3LJ0189C ONLINE 0 0 0
errors: No known data errors
e depois
root@zeus:/dev# zpool replace hermes 15935140517898495532 /dev/disk/by-id/ata-ST3500320AS_9QM03ATQ
root@zeus:/dev# zpool status
pool: hermes
state: DEGRADED
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 Jun 9 01:44:36 2013
408M scanned out of 419G at 20,4M/s, 5h50m to go
101M resilvered, 0,10% done
config:
NAME STATE READ WRITE CKSUM
hermes DEGRADED 0 0 0
raidz1-0 DEGRADED 0 0 0
ata-ST3300620A_5QF0MJFP ONLINE 0 0 0
replacing-1 OFFLINE 0 0 0
ata-ST3300831A_5NF0552X OFFLINE 0 0 0
ata-ST3500320AS_9QM03ATQ ONLINE 0 0 0 (resilvering)
ata-ST3200822A_5LJ1CHMS ONLINE 0 0 0
ata-ST3200822A_3LJ0189C ONLINE 0 0 0
errors: No known data errors
Depois que o resilvering foi concluído, tudo funcionou bem novamente. Teria sido bom incluir essa informação, que você pode usar o GUID de um disco obtido através de zdb
com o comando zpool
, com a página de manual do zpool.
Editar
Como apontado por durval abaixo, o comando zdb
pode não produzir nada. Então você pode tentar usar
zdb -l /dev/<name-of-device>
para listar explicitamente informações sobre o dispositivo (mesmo que ele já esteja faltando no sistema).