Estou tentando testar a detecção e a recuperação de erros em um sistema com o ZFS instalado recentemente. Eu deliberadamente sobrescrevo o início de um dos discos com o dd, mas não consigo forçar nenhum erro a ser detectado.
Não posso usar o dd para fazer isso? Ou eu simplesmente não estou acertando nenhum dado?
Eu criei o pool do zfs espelhado e copiei alguns dados para ele:
$ zpool status
pool: zfspool
state: ONLINE
scan: scrub repaired 0 in 0h6m with 0 errors on Sun Dec 1 11:53:12 2013
config:
NAME STATE READ WRITE CKSUM
zfspool ONLINE 0 0 0
mirror-0 ONLINE 0 0 0
ata-WDC_WD10EFRX-68JCSN0_WD-WCC1U4257356 ONLINE 0 0 0
ata-WDC_WD10EFRX-68JCSN0_WD-WCC1U4299344 ONLINE 0 0 0
errors: No known data errors
Eu então tentei corromper um dos discos:
$ dd of=/dev/sdb if=/dev/zero bs=512 count=10000
10000+0 records in
10000+0 records out
5120000 bytes (5.1 MB) copied, 0.103375 s, 49.5 MB/s
e forçar uma leitura de todos os dados:
$ diff -qr /home/archive/ /zfspool/archive/
Eu teria pensado que isso deveria ter encontrado a corrupção em uma das unidades, sinalizá-la como inválida e definir o status da associação como degradado, mas:
$ zpool status
pool: zfspool
state: ONLINE
scan: scrub repaired 0 in 0h6m with 0 errors on Sun Dec 1 11:53:12 2013
config:
NAME STATE READ WRITE CKSUM
zfspool ONLINE 0 0 0
mirror-0 ONLINE 0 0 0
ata-WDC_WD10EFRX-68JCSN0_WD-WCC1U4257356 ONLINE 0 0 0
ata-WDC_WD10EFRX-68JCSN0_WD-WCC1U4299344 ONLINE 0 0 0
errors: No known data errors
Ok, vamos testar:
$ zpool scrub zfspool
$ zpool status
pool: zfspool
state: ONLINE
scan: scrub repaired 0 in 0h6m with 0 errors on Sun Dec 1 12:46:34 2013
config:
NAME STATE READ WRITE CKSUM
zfspool ONLINE 0 0 0
mirror-0 ONLINE 0 0 0
ata-WDC_WD10EFRX-68JCSN0_WD-WCC1U4257356 ONLINE 0 0 0
ata-WDC_WD10EFRX-68JCSN0_WD-WCC1U4299344 ONLINE 0 0 0
errors: No known data errors
Informações adicionais solicitadas por @ rickhg12hs:
$ fdisk -l /dev/sda
WARNING: GPT (GUID Partition Table) detected on '/dev/sda'! The util fdisk doesn't support GPT. Use GNU Parted.
Disk /dev/sda: 1000.2 GB, 1000204886016 bytes
256 heads, 63 sectors/track, 121126 cylinders
Units = cylinders of 16128 * 512 = 8257536 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disk identifier: 0x00000000
Device Boot Start End Blocks Id System
/dev/sda1 1 121127 976762583+ ee GPT
Partition 1 does not start on physical sector boundary.
[17:37:26][root@zserver2:~]$ fdisk -l /dev/sdb
WARNING: GPT (GUID Partition Table) detected on '/dev/sdb'! The util fdisk doesn't support GPT. Use GNU Parted.
Disk /dev/sdb: 1000.2 GB, 1000204886016 bytes
255 heads, 63 sectors/track, 121601 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disk identifier: 0x00000000
[17:38:11][root@zserver2:~]$ mount
...
zfspool on /zfspool type zfs (rw,xattr)
zfspool/archive on /zfspool/archive type zfs (rw,xattr)