It all works very well, until you remove the USB device and then run pvscan/lvscan commands of LVM. Which then throws the following errors:
# pvscan /dev/mapper/USBOFFSITE12B: read failed after 0 of 4096 at 999201636352: Input/output error /dev/mapper/USBOFFSITE12B: read failed after 0 of 4096 at 999201693696: Input/output error /dev/mapper/USBOFFSITE12B: read failed after 0 of 4096 at 0: Input/output error /dev/mapper/USBOFFSITE12B: read failed after 0 of 4096 at 4096: Input/output error PV /dev/md12 VG vg13 lvm2 [2.67 TiB / 821.62 GiB free] Total: 1 [2.67 TiB] / in use: 1 [2.67 TiB] / in no VG: 0 [0 ]
If 'autofs' would allow us to execute a script after it dismounts the drive from inactivity, it might be a good option for us. But I'm not sure that is possible.
Another option would be that at the end of the daily backup script which copies files off to the attached device, we dismount it automatically.
A third option would be to check every hour and see whether the /dev/mapper/NAME is no longer in use, then tell cryptsetup to dismount it. The command to check that might be "dmsetup ls --tree -o uuid,open | grep -i 'CRYPT-LUKS'".
Still exploring options at this point. I need to do some more testing first. I'm also searching for a way to auto-open LUKS volumes upon device insertion.
No comments:
Post a Comment