Skip to content

Instantly share code, notes, and snippets.

@mailinglists35
Last active July 7, 2023 14:11
Show Gist options
  • Save mailinglists35/65cf2f165f543243157c2aa573e75a49 to your computer and use it in GitHub Desktop.
Save mailinglists35/65cf2f165f543243157c2aa573e75a49 to your computer and use it in GitHub Desktop.
recover veracrypt zfs pool after failed usb cable, without reboot
********************************************************************************
WARNING THESE ARE MY PARTICULAR CASE NOTES MADE PUBLIC SO I CAN EASILY FIND THEM
DO NOT BLINDLY PASTE WITHOUT UNDERSTANDING WHAT DO THESE COMMANDS DO
********************************************************************************
dmsetup table | grep veracrypt
veracrypt2: 0 3904923136 crypt aes-xts-plain64 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 256 8:34 256
dmsetup reload veracrypt2 --table "0 3904923136 error"
dmsetup suspend --noflush veracrypt2
dmsetup resume veracrypt2
(?)zpool clear backup-usb
remove from veracrypt UI
echo "0 3904923136 zero" | dmsetup reload veracrypt2
dmsetup suspend --noflush veracrypt2
dmsetup resume veracrypt2
dmsetup remove veracrypt2
re-setup dm table from veracrypt UI
zpool clear backup-usb
scrub will start automatically
errors will be found
export pool
reimport
scrub again
@mailinglists35
Copy link
Author

scrub twice to make the error status go away openzfs/zfs#9705 (comment)

@Animeshz
Copy link

Animeshz commented Jul 6, 2023

How do you force the zfs to use devmapper virtual device instead of real device?

@mailinglists35
Copy link
Author

when you import, you direct it to import from /dev/mapper
zpool import -d /dev/mapper

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment