1

I keep my important data on 2 drives that are mirrored (I think that is the correct terminology) in a machine running Ubuntu 12.04 LTS. Today, I was unable to access any of the data and 'sudo zpool status -x' returns:

pool: data
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://zfsonlinux.org/msg/ZFS-8000-8A
scan: none requested
config:

NAME                                     STATE     READ WRITE CKSUM
data                                     ONLINE       0     0     0
  mirror-0                               ONLINE       0     0     0
    scsi-SATA_TOSHIBA_DT01ACA_Y3F4U6EGS  ONLINE       0     0     0
    scsi-SATA_TOSHIBA_DT01ACA_Y3FMSUNAS  ONLINE       0     0     0

errors: 1 data errors, use '-v' for a list

When I run 'sudo zpool status -v' it shows which file is 'corrupted'. Fortunately, I do not care about this particular file, so I have no need to restore it. From this post:

What does a permanent ZFS error indicate?

it appears that I should run 'sudo zpool scrub', but I hesitate to do so since that particular post involved a zpool without redundancy. Will scrubbing the zpool bring the files back online, or will I mess up the whole thing?

USD Matt
  • 5,321
  • 14
  • 23
Damon Sisk
  • 11
  • 1

2 Answers2

1

zpool clear data and/or zpool scrub data

I do not know what happened to your disks. How did they lose connection or generate the error? Loose cable? Drive failure?

ewwhite
  • 194,921
  • 91
  • 434
  • 799
0

According to the status output, ZFS thinks the pool is fine so you'd normally expect data to be accessible.

Do the ZFS file systems show as mounted in mount output? The pool is imported but it's still possible for the file systems to be unmounted.

To add, if verbose output lists the corrupted file it may be worth deleting it, running clear to clear the error, then scrub which should hopefully complete without any errors if that's the only corrupt data.

USD Matt
  • 5,321
  • 14
  • 23
  • It looks like it is not mounted to me. Here is the output from mount: /dev/sda1 on / type ext4 (rw,noatime,errors=remount-ro) proc on /proc type proc (rw,noexec,nosuid,nodev) sysfs on /sys type sysfs (rw,noexec,nosuid,nodev) none on /sys/fs/fuse/connections type fusectl (rw) none on /sys/kernel/debug type debugfs (rw) none on /sys/kernel/security type securityfs (rw) udev on /dev type devtmpfs (rw,mode=0755) devpts on /dev/pts type devpts (rw,noexec,nosuid,gid=5,mode=0620) tmpfs on /run type tmpfs (rw,noexec,nosuid,size=10%,mode=0755) – Damon Sisk Sep 07 '17 at 23:26
  • Further output: none on /run/lock type tmpfs (rw,noexec,nosuid,nodev,size=5242880) none on /run/shm type tmpfs (rw,nosuid,nodev) binfmt_misc on /proc/sys/fs/binfmt_misc type binfmt_misc (rw,noexec,nosuid,nodev) gvfs-fuse-daemon on /home/damon/.gvfs type fuse.gvfs-fuse-daemon (rw,nosuid,nodev,user=damon) – Damon Sisk Sep 07 '17 at 23:27
  • Disk Utility shows the drives as /dev/sdb and /dev/sdd. – Damon Sisk Sep 07 '17 at 23:28
  • Have you tried a `zfs mount -a` to see if it will mount the file systems and allow access to the data? – USD Matt Sep 08 '17 at 08:13
  • I had not. But after trying it, I have access to all the files (it seems so at least.) Thank you! There is still an error with 1 particular file. Is it safe to delete it? Should I zpool scrub or clear? – Damon Sisk Sep 08 '17 at 11:51
  • I've covered that in the last ilne of the answer. – USD Matt Sep 08 '17 at 11:53
  • Sorry, I missed that. I deleted the file, but it moved to '.Trash-1000'. so I deleted all the contents of that folder with: rm -rf .Trash-1000/* That removed the file as well as a bunch of other files that were in the directory. But even after 'sudo zpool clear data', (data is the name of my zpool) 'status' still senses an error in the file now called data:<0x4c0e0> (apparently a hexadecimal number for the file that had the error). Is it still ok to 'scrub' using zpool? Sorry I don't know much about the ZFS file system. – Damon Sisk Sep 08 '17 at 20:32
  • There's no issue with running a scrub. If you have any snapshots it may also be that the corrupt file is still referenced. – USD Matt Sep 09 '17 at 16:41
  • Thank you very much USD Matt! Scrub worked. At first I thought it did not because when I issued the scrub command, the prompt came back almost instantly. However, it apparently works in the background, because now zpool status returns no errors and says: "scan: scrub repaired 0 in 5h9m with 0 errors on "(todays date). For posterity, here http://unixetc.co.uk/2012/01/22/zfs-corruption-persists-in-unlinked-files/ and here https://serverfault.com/questions/576898/clear-a-permanent-zfs-error-in-a-healthy-pool are two sites that talk about my particular error type. – Damon Sisk Sep 09 '17 at 19:27