View previous topic :: View next topic |
Author |
Message |
eponymous Tux's lil' helper
Joined: 02 Feb 2005 Posts: 141
|
Posted: Thu Dec 06, 2012 10:51 pm Post subject: Failed to stop array: device or resource busy RAID/DMCrypt |
|
|
Hi,
I've set up encryption using dmcrypt/luks on my /dev/md0 which is a RAID0 array.
It seems I'm running into issues when I do a reboot or halt in that it doesn't stop the array properly. I never had this issue until I encrypted the disks.
/dev/md0 is just three disks which are used as a backup store - no root, boot or swap on these.
/var/log/rc.log:
Code: | 1340 [ ok ]
1341 * Shutting down RAID devices (mdadm) ...
1342 mdadm: stopped /dev/md1
1343 mdadm: failed to stop array /dev/md0: Device or resource busy
1344 Perhaps a running process, mounted filesystem or active volume group?
1345 [ !! ]
1346 * ERROR: mdraid failed to stop
1347 * Removing dm-crypt mappings
1348 * crypt_backup ...
1349 [ ok ]
1350 * crypt_md0 ...
1351 [ ok ]
|
Should the RAID devices not be stopped after the dm-crypt mappings are removed? If so, how do you change that order? |
|
Back to top |
|
|
krinn Watchman
Joined: 02 May 2003 Posts: 7470
|
Posted: Thu Dec 06, 2012 11:08 pm Post subject: |
|
|
not sure if it will work, but i would tried
rc_dm_crypt_need="dmraid" in rc.conf (names might not be that, check them)
so telling openrc dm-crypt need dmraid should trigger stopping dm-crypt if dmraid goes on stop. |
|
Back to top |
|
|
eponymous Tux's lil' helper
Joined: 02 Feb 2005 Posts: 141
|
Posted: Fri Dec 07, 2012 10:42 am Post subject: |
|
|
Ah I should've mentioned I'm not using dmraid. I'm only using mdadm and dmcrypt. The only init scripts I have for this are /etc/init.d/dmcrypt and /etc/init.d/mdadm both of which are in the "boot" runlevel. |
|
Back to top |
|
|
eponymous Tux's lil' helper
Joined: 02 Feb 2005 Posts: 141
|
Posted: Mon Dec 10, 2012 3:52 pm Post subject: Change which order init scripts are called on shutdown. |
|
|
Hi,
I want to make /etc/init.d/dmcrypt stop before /etc/init/d/mdadm so that the luksClose occurs before the raid arrays are taken down (as it should already do...).
However on startup, it should be mdadm that is called first so that the raid nodes are setup and then encryption is started afterward (which I think is already happening).
Does anyone know how to do this?
I've looked at the depend {} section of the init script but does this seems to apply to startup only? |
|
Back to top |
|
|
eponymous Tux's lil' helper
Joined: 02 Feb 2005 Posts: 141
|
Posted: Tue Dec 11, 2012 9:50 am Post subject: |
|
|
Honestly, can no one help me with this? |
|
Back to top |
|
|
desultory Bodhisattva
Joined: 04 Nov 2005 Posts: 9410
|
Posted: Thu Dec 13, 2012 4:28 am Post subject: |
|
|
Merged the two preceding posts. |
|
Back to top |
|
|
mbar Veteran
Joined: 19 Jan 2005 Posts: 1990 Location: Poland
|
Posted: Thu Dec 13, 2012 12:46 pm Post subject: |
|
|
rc_dmcrypt_after="xxxxxx" in rc.conf
xxxxxxx is mdadm or mdraid depending on your config. |
|
Back to top |
|
|
eponymous Tux's lil' helper
Joined: 02 Feb 2005 Posts: 141
|
Posted: Thu Dec 13, 2012 8:21 pm Post subject: |
|
|
I managed to solve it by putting the following in /etc/init.d/dmcrypt:
Code: | depend () {
...
after mdadm mdraid
} |
Where is this kind of thing documented?
There is only limited info in the Gentoo init script guide and in the man pages... |
|
Back to top |
|
|
|