aboutsummaryrefslogtreecommitdiff
path: root/rc.sysinit
diff options
context:
space:
mode:
authorJudd Vinet <judd@archlinux.org>2005-11-10 02:34:20 +0000
committerJudd Vinet <judd@archlinux.org>2005-11-10 02:34:20 +0000
commitd7e23b7ef7c92f7c9529c65a255b524b26648cc3 (patch)
tree7a2c69cc584567e81716a46f544a36e3280bcc9a /rc.sysinit
parent0e992c0464125a0cb0207171a053dbf64c593833 (diff)
downloadinitscripts-d7e23b7ef7c92f7c9529c65a255b524b26648cc3.tar.xz
added more intelligence for RAID/LVM setups from the initrd
Diffstat (limited to 'rc.sysinit')
-rwxr-xr-xrc.sysinit13
1 files changed, 13 insertions, 0 deletions
diff --git a/rc.sysinit b/rc.sysinit
index 82e5fc5..dc0a13d 100755
--- a/rc.sysinit
+++ b/rc.sysinit
@@ -39,6 +39,18 @@ if [ -e /initrd/dev/mapper/root ]; then
mkdir /dev/mapper 2>/dev/null
cp -a /initrd/dev/mapper/root /dev/mapper/root
fi
+
+# If necessary, find md devices and manually assemble RAID arrays
+if [ -f /etc/mdadm.conf -a "`grep ^ARRAY /etc/mdadm.conf`" ]; then
+ if [ -d /initrd/dev ]; then
+ # udev won't create these md nodes, so we steal them from the initrd
+ for i in `grep ^ARRAY /etc/mdadm.conf | awk '{print $2}'`; do
+ cp -a /initrd/$i /dev/
+ done
+ fi
+ status "Assembling RAID arrays" /sbin/mdadm --assemble --scan
+fi
+
# Unmount and free up the old initrd if it exists
if [ -f /initrd/linuxrc ]; then
stat_busy "Freeing memory from Initial Ramdisk"
@@ -58,6 +70,7 @@ if [ "$USELVM" = "yes" -o "$USELVM" = "YES" ]; then
elif [ -x /sbin/lvm -a -d /sys/block ]; then
# Kernel 2.6.x, LVM2 groups
stat_busy "Activating LVM2 groups"
+ /sbin/lvm vgscan --ignorelockingfailure
/sbin/lvm vgchange --ignorelockingfailure -a y
stat_done
fi