diff options
author | Bill Nottingham <notting@redhat.com> | 2010-11-16 21:05:02 -0500 |
---|---|---|
committer | Bill Nottingham <notting@redhat.com> | 2010-11-16 21:05:02 -0500 |
commit | 3c46ef163cd34ef360c0c0322b4d90e3c3dad457 (patch) | |
tree | 2bdb147b62c957600bf6d35c0706f6b15d4f2e7c /systemd/fedora-storage-init | |
parent | 7eaac898d086ea2a3dc2da549e192c5f164a5751 (diff) | |
parent | cc5b400dd6bad85f5d7b8e4a889134d3668e20a4 (diff) | |
download | initscripts-3c46ef163cd34ef360c0c0322b4d90e3c3dad457.tar initscripts-3c46ef163cd34ef360c0c0322b4d90e3c3dad457.tar.gz initscripts-3c46ef163cd34ef360c0c0322b4d90e3c3dad457.tar.bz2 initscripts-3c46ef163cd34ef360c0c0322b4d90e3c3dad457.tar.xz initscripts-3c46ef163cd34ef360c0c0322b4d90e3c3dad457.zip |
Merge branch 'systemd-branch'
Diffstat (limited to 'systemd/fedora-storage-init')
-rwxr-xr-x | systemd/fedora-storage-init | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/systemd/fedora-storage-init b/systemd/fedora-storage-init new file mode 100755 index 00000000..0e3a417e --- /dev/null +++ b/systemd/fedora-storage-init @@ -0,0 +1,40 @@ +#!/bin/bash +# +# Storage initialization + +. /etc/init.d/functions + +[ -z "${cmdline}" ] && cmdline=$(cat /proc/cmdline) + +if ! strstr "$cmdline" nompath && [ -f /etc/multipath.conf ] && \ + [ -x /sbin/multipath ]; then + modprobe dm-multipath > /dev/null 2>&1 + /sbin/multipath -v 0 + if [ -x /sbin/kpartx ]; then + /sbin/dmsetup ls --target multipath --exec "/sbin/kpartx -a -p p" >/dev/null + fi +fi + +if ! strstr "$cmdline" nodmraid && [ -x /sbin/dmraid ]; then + modprobe dm-mirror >/dev/null 2>&1 + dmraidsets=$(LC_ALL=C /sbin/dmraid -s -c -i) + if [ "$?" = "0" ]; then + for dmname in $dmraidsets; do + if [[ "$dmname" == isw_* ]] && \ + ! strstr "$cmdline" noiswmd; then + continue + fi + /sbin/dmraid -ay -i --rm_partitions -p "$dmname" >/dev/null 2>&1 + /sbin/kpartx -a -p p "/dev/mapper/$dmname" + done + fi +fi + +# Start any MD RAID arrays that haven't been started yet +[ -r /proc/mdstat -a -r /dev/md/md-device-map ] && /sbin/mdadm -IRs + +if [ -x /sbin/lvm ]; then + action $"Setting up Logical Volume Management:" /sbin/lvm vgchange -a y --sysinit +fi + +[ -f /etc/crypttab ] && init_crypto 0 |