mdadm-raid does not start before lvm
Using alpine 1.9.0_beta4, I set up LVM on a RAID array created with mdadm (/dev/md0) according to the document http://wiki.alpinelinux.org/w/index.php?title=Setting\_up\_Logical\_Volumes\_with\_LVM. I replaced every `rc_add` command with `rc-update SERVICE default`.
All the services were sequenced correctly except for mdadm-raid. As a result, the lvm partitions were unavailable after rebooting. Here are the services as installed:
~# rc-status -a
* Caching service dependencies... [ok]
Runlevel: default
lvm [ started ]
localmount [ started ]
chronyd [ started ]
sshd [ started ]
cron [ started ]
crpd [ started ]
mdadm-raid [ started ]
swap [ started ]
Runlevel: boot
modules [ started ]
hwclock [ started ]
hostname [ started ]
sysctl [ started ]
bootmisc [ started ]
syslog [ started ]
networking [ started ]
I was able to work around this problem by creating /etc/conf.d/lvm as follows:
~# cat /etc/conf.d/lvm
rc_need="mdadm-raid"
This results in the correct sequence for `mdadm-raid`:
~# rc-status default
Runlevel: default
mdadm-raid [ started ]
lvm [ started ]
localmount [ started ]
chronyd [ started ]
sshd [ started ]
cron [ started ]
crpd [ started ]
swap [ started ]
Perhaps /etc/init.d/mdadm-raid should be modified as follows:
--- mdadm-raid-orig Fri Aug 28 14:59:38 2009
+++ /etc/init.d/mdadm-raid Fri Aug 28 14:59:24 2009
@@ -2,6 +2,10 @@
# script to start raid devices described in /etc/mdadm.conf.
+depend() {
+ before lvm
+}
+
start() {
[ -f /proc/mdstat ] || modprobe -k md > /dev/null 2>&1
ebegin "Starting RAID devices"
(from redmine: issue id 148, created on 2009-08-28, closed on 2009-10-09)
- Changesets:
- Revision 386db07f on 2009-08-31T11:22:07Z:
main/lvm2: init.d dependency fixes
make sure we start after fsck and after hwdrivers and modules.
provide default config that starts lvm after mdadm-raid.
fixes #148