Skip to content

Commit

Permalink
fix for mdadm and udev
Browse files Browse the repository at this point in the history
  • Loading branch information
root committed Oct 24, 2014
1 parent 340956a commit 859e1bf
Showing 1 changed file with 7 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,11 @@ create_disk() {
StopIfError "Disk $disk has size $disk_size, unable to continue."

cat >> "$LAYOUT_CODE" <<EOF
Log "Stop mdadm and pause udev"
if [ -d "/dev/md" ] && ls /dev/md?* &>/dev/null; then
mdadm --stop /dev/md?* >&2
fi
type -p udevadm >/dev/null && udevadm control --stop-exec-queue || udevcontrol stop_exec_queue
Log "Erasing MBR of disk $disk"
dd if=/dev/zero of=$disk bs=512 count=1
sync
Expand All @@ -52,6 +57,8 @@ EOF
create_partitions "$disk" "$label"

cat >> "$LAYOUT_CODE" <<EOF
Log "Resume udev"
type -p udevadm >/dev/null && udevadm control --start-exec-queue || udevcontrol start_exec_queue
# Wait some time before advancing
sleep 10
Expand Down

0 comments on commit 859e1bf

Please sign in to comment.