Que faire, si cela se passe mal en cas de coupure électrique avec un unique disque (dans mon cas un SSD dans un boîtier externe en USB)
Coupure électrique, et pas de chance le boîtier USB externe n’était pas sur onduleur 🙁
dans le dmesg FreeBSD ca donne ca:
ugen0.9: <ASMedia asm1153e> at usbus0 (disconnected)
umass2: at uhub0, port 17, addr 9 (disconnected)
da1 at umass-sim2 bus 2 scbus9 target 0 lun 0
da1: <ASMedia asm1153e 0> s/n 000000000001 detached
(da1:umass-sim2:2:0:0): Periph destroyed
umass2: detached
ugen0.9: <ASMedia asm1153e> at usbus0
umass2 on uhub0
umass2: <ASMedia asm1153e, class 0/0, rev 3.00/1.00, addr 16> on usbus0
umass2: SCSI over Bulk-Only; quirks = 0x0100
umass2:9:2: Attached to scbus9
da1 at umass-sim2 bus 2 scbus9 target 0 lun 0
da1: <ASMedia asm1153e 0> Fixed Direct Access SPC-4 SCSI device
da1: Serial Number 000000001234
da1: 400.000MB/s transfers
da1: 976762MB (2000409264 512 byte sectors)
da1: quirks=0x2<NO_6_BYTE>
# zpool list
NAME SIZE ALLOC FREE CKPOINT EXPANDSZ FRAG CAP DEDUP HEALTH ALTROOT
backup 7.25T 1.34T 5.91T – – 0% 18% 1.00x ONLINE –
zroot 896G 657G 239G – – 27% 73% 1.00x ONLINE –
zssd 952G 128G 824G – – 0% 13% 1.00x UNAVAIL /mnt
# zpool status zssd
pool: zssd
state: UNAVAIL
status: One or more devices are faulted in response to IO failures.
action: Make sure the affected devices are connected, then run ‘zpool clear’.
see: http://illumos.org/msg/ZFS-8000-HC
scan: none requested
config:
NAME STATE READ WRITE CKSUM
zssd UNAVAIL 0 0 0
14572189989752791848 REMOVED 0 0 0 was /dev/da1p2
# zpool clear zssd
# zpool status -v zssd
pool: zssd
state: ONLINE
status: One or more devices has experienced an error resulting in data
corruption. Applications may be affected.
action: Restore the file in question if possible. Otherwise restore the
entire pool from backup.
see: http://illumos.org/msg/ZFS-8000-8A
scan: scrub in progress since Mon Oct 25 17:22:00 2021
128G scanned at 340M/s, 83.0G issued at 221M/s, 128G total
0 repaired, 64.93% done, 0 days 00:03:27 to go
config:
NAME STATE READ WRITE CKSUM
zssd ONLINE 0 0 0
da1p2 ONLINE 0 0 0
errors: Permanent errors have been detected in the following files:
<metadata>:<0x0>
<metadata>:<0x39>
/mnt/zssd/lesarcs
# Remarque le scrub est automatique, il n’est pas utile de le lancer manuellement.
# zpool status -v zssd
pool: zssd
state: ONLINE
scan: scrub repaired 0 in 0 days 00:09:52 with 0 errors on Mon Oct 25 17:31:52 2021
config:
NAME STATE READ WRITE CKSUM
zssd ONLINE 0 0 0
da1p2 ONLINE 0 0 0
Je test avec /sbin/md5 s’il y une différence entre les fichiers du SSD et avec le backup, aucune ! tout est ok 🙂