Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Failed to stop array: device or resource busy RAID/DMCrypt
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware
View previous topic :: View next topic  
Author Message
eponymous
Tux's lil' helper
Tux's lil' helper


Joined: 02 Feb 2005
Posts: 141

PostPosted: Thu Dec 06, 2012 10:51 pm    Post subject: Failed to stop array: device or resource busy RAID/DMCrypt Reply with quote

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
View user's profile Send private message
krinn
Watchman
Watchman


Joined: 02 May 2003
Posts: 7470

PostPosted: Thu Dec 06, 2012 11:08 pm    Post subject: Reply with quote

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
View user's profile Send private message
eponymous
Tux's lil' helper
Tux's lil' helper


Joined: 02 Feb 2005
Posts: 141

PostPosted: Fri Dec 07, 2012 10:42 am    Post subject: Reply with quote

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
View user's profile Send private message
eponymous
Tux's lil' helper
Tux's lil' helper


Joined: 02 Feb 2005
Posts: 141

PostPosted: Mon Dec 10, 2012 3:52 pm    Post subject: Change which order init scripts are called on shutdown. Reply with quote

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
View user's profile Send private message
eponymous
Tux's lil' helper
Tux's lil' helper


Joined: 02 Feb 2005
Posts: 141

PostPosted: Tue Dec 11, 2012 9:50 am    Post subject: Reply with quote

Honestly, can no one help me with this?
Back to top
View user's profile Send private message
desultory
Bodhisattva
Bodhisattva


Joined: 04 Nov 2005
Posts: 9410

PostPosted: Thu Dec 13, 2012 4:28 am    Post subject: Reply with quote

Merged the two preceding posts.
Back to top
View user's profile Send private message
mbar
Veteran
Veteran


Joined: 19 Jan 2005
Posts: 1990
Location: Poland

PostPosted: Thu Dec 13, 2012 12:46 pm    Post subject: Reply with quote

rc_dmcrypt_after="xxxxxx" in rc.conf

xxxxxxx is mdadm or mdraid depending on your config.
Back to top
View user's profile Send private message
eponymous
Tux's lil' helper
Tux's lil' helper


Joined: 02 Feb 2005
Posts: 141

PostPosted: Thu Dec 13, 2012 8:21 pm    Post subject: Reply with quote

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
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum