ZFS on LUKS: shutting down devices fails #18697
Replies: 1 comment
|
Yes - that understanding is correct. For an imported pool, ZFS keeps the vdev block devices open. Using a shutdown unit to run something like: zpool export <poolname>and then importing via device scan on the next boot is a reasonable approach for this layout, assuming the LUKS devices are opened before the ZFS import runs. From a data-integrity perspective, If my answer solved your problem, please mark it as answered the question — I'm here to help, and honestly I'm also collecting Galaxy Brain badges along the way 😆 |
Uh oh!
There was an error while loading. Please reload this page.
Hi
I was looking around about these error messages that appear in
journalctl:device-mapper: remove ioctl on [...] failed: Device or resource busyThere are also similar messages about
/dev/dm-Xdevices, appearing during shutdown after some delay. They don't appear to be persisted in any logs though. As far as I understand, these are the same Device Mapper devices for LUKS HDDs. The devices in thejournalctlerror messages are in/dev/mapper.I have a
zpoolon these LUKS HDDs, which likely causes them to remain "busy". Here's some discussions about similar situations:Apparently the only way to "close" the
zpoolso that the LUKS devices can be properly closed is toexportthezpool. Which then leads to the necessity of it being scanned again on next startup, because it's removed from import cache. I tried shutting down the NFS server since a filesystem in thezpoolis shared, and alsozfs unmount, but neither had any effect on the aforementioned error messages. Not surprisingly, since thezpool, as far as I understand, remains active.Is this correct? The only working way to "close" the
zpoolso that the devices are no longer "busy" isexport, which then needs an explicitimportinstead of thezpoolcurrently being added back byzfs-import-cache.service? I could add asystemdservice to do theexport, and apparently usingzfs-import-scan.serviceinstead ofzfs-import-cache.servicewould handle importing thezpoolafter it has been exported.I'd like confirmation that this is the correct approach, and that ZFS doesn't provide anything out of the box to suitably "close" the
zpooland free the devices. I´d also like to know more about what difference this makes in terms of data integrity and such.All reactions