8

I'm using ZFS on OSX and I've zpool which is active and online:

NAME      SIZE  ALLOC   FREE    CAP  DEDUP  HEALTH  ALTROOT
WD_1TB    931G   280G   651G    30%  1.00x  ONLINE  -

but I can't actually mount it.

$ sudo zfs mount WD_1TB
cannot open 'WD_1TB': pool I/O is currently suspended
cannot open 'WD_1TB': pool I/O is currently suspended

or unmount it:

$ sudo zfs unmount WD_1TB
cannot open 'WD_1TB': pool I/O is currently suspended
cannot open 'WD_1TB': pool I/O is currently suspended

or even destroy it:

$ sudo zpool destroy -f WD_1TB
cannot open 'WD_1TB': pool I/O is currently suspended

When doing zpool export WD_1TB it just freezes.

When clearing device errors in a pool, there is an error as well:

$ sudo zpool clear WD_1TB
cannot clear errors for WD_1TB: I/O error

Above happening whatever the disk is connected via USB or not.

What's interesting that zpool status points zpool to /dev/disk1, but diskutil list points to /dev/disk3.

I've enabled debug messages via: sysctl -w zfs.vnops_osx_debug=1 and run sudo dmesg | tail which shows something like:

0 [Level 3] [Facility com.apple.system.fs] [ErrType IO] [ErrNo 6] [IOType Read] [PBlkNum 0] [LBlkNum 0] 
0 [Level 3] [Facility com.apple.system.fs] [DevNode devfs] [MountPt /dev] [Path /dev/disk1s2] 
disk1s2: media is not present.
0 [Level 3] [Facility com.apple.system.fs] [ErrType IO] [ErrNo 6] [IOType Read] [PBlkNum 512] [LBlkNum 512] 
0 [Level 3] [Facility com.apple.system.fs] [DevNode devfs] [MountPt /dev] [Path /dev/disk1s2] 

zfs_vnop_write(vp 0xffffff804f6303c0, offset 0x12b00000 size 0x10000
zfs_vnop_write(vp 0xffffff804f6303c0, offset 0x12b10000 size 0x10000
zfs_vnop_write(vp 0xffffff804f6303c0, offset 0x12b20000 size 0x10000
zfs_vnop_write(vp 0xffffff804f6303c0, offset 0x12b30000 size 0x10000
zfs_vnop_write(vp 0xffffff8051b031e0, offset 0x1f0000 size 0x10000

Connecting or disconnecting HDD doesn't help.

Any way of simply mounting the HDD on OSX in above circumstances?

Related:

  • Some ZFS commands accept a -f flag to force operations that might normally fail. Have you tried this flag? – Mike Fitzpatrick Dec 9 '13 at 20:59
  • No, it doesn't help. E.g. zfs mount doesn't accept -f. Restarting OSX helped for few days, but it keeps happening from time to time. – kenorb Dec 11 '13 at 9:07
  • btw. zpool destroy -f WD_1TB shows the same error message. – kenorb Dec 11 '13 at 9:09
8

If executing sudo zpool clear WD_1TB won't work, try:

$ sudo zpool clear -nFX WD_1TB

where these undocumented parameters mean:

  • -F: (undocumented for clear, the same as for import) Rewind. Recovery mode for a non-importable pool. Attempt to return the pool to an importable state by discarding the last few transactions. Not all damaged pools can be recovered by using this option. If successful, the data from the discarded transactions is irretrievably lost. This option is ignored if the pool is importable or already imported.
  • -n: (undocumented for clear, the same as for import) Used with the -F recovery option. Determines whether a non-importable pool can be made importable again, but does not actually perform the pool recovery. For more details about pool recovery mode, see the -F option, above. and then try to re-import again:
  • -X (undocumented): Extreme rewind. The effect of -X seems to be that some extremely lengthy operation is attempted, that never finishes. In some cases, a reboot was necessary to terminate the process.
  • -V (undocumented): Option by UTSLing, when used for import it makes the pool got imported again, but still without an attempt at resilvering.

Source: ZFS faulted pool problem and man zpool.

$ zpool import WD_1TB

If won't help, try the following commands to remove the invalid zpool:

$ zpool list -v
$ sudo zfs unmount WD_1TB
$ sudo zpool destroy -f WD_1TB
$ zpool detach WD_1TB disk1s2
$ zpool remove WD_1TB disk1s2
$ zpool remove WD_1TB /dev/disk1s2
$ zpool set cachefile=/etc/zfs/zpool.cache WD_1TB

Finally if nothing helps, remove the file /etc/zfs/zpool.cache (optionally) and just restart your computer.


Related:

  • 1
    This saved my butt when I hot swapped a few drives and screwed up my pool. I didn't used the -x flag, just -nF – elBradford Jun 4 '19 at 13:09

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.