You are not logged in.
I have an mdadm raid1 array. Each raid device sits on top of a dm-crypt block.
When I try to cryptsetup close a dm-crypt block, it says "Device x is still in use."
I stopped the array with mdadm --stop md127, and that allowed me to close the cryptdevice, but it deleted the array in the process.
How can I temporarily disable the array without deleting it, in order to close all the devices? How does the system do it during a shutdown?
Last edited by anacron (2025-02-05 17:35:21)
Offline
Wait a minute---maybe stopping it is the correct command after all?
I thought stopping it would delete the array because of what it said on this webpage
https://www.digitalocean.com/community/ … untu-16-04
This will stop the array. You will have to reassemble the array to access it again.
I thought reassembly meant recreating the array from scratch, but I rebooted my system and it was still there.
Offline
mdadm --stop is right. It stops the array - no longer shows up in /proc/mdstat, no longer in use - until it is assembled again.
If you still get the still in use message afterwards, either the md device itself was in use (unmount filesystems, stop lvm too, etc.), or the array got auto-assembled again after you stopped it.
That can sometimes happen, particularly when other programs reinitialize devices somehow. For example, if you use parted and it reloads the partition table, that can trigger re-detection and auto-assembly.
Offline