summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--debian/FAQ4
-rw-r--r--debian/NEWS11
-rw-r--r--debian/README.initramfs-transition22
-rw-r--r--debian/README.mdrun6
-rw-r--r--debian/README.recipes4
-rw-r--r--debian/README.upgrading-2.5.333
-rw-r--r--debian/UPGRADE-STRATEGY6
-rw-r--r--debian/bugscript4
-rw-r--r--debian/changelog73
-rw-r--r--debian/checkarray8
-rw-r--r--debian/control4
-rw-r--r--debian/initramfs/hook151
-rw-r--r--debian/initramfs/script.local-top45
-rw-r--r--debian/mdadm-raid10
-rw-r--r--debian/mdadm.config83
-rw-r--r--debian/mdadm.cron.d2
-rw-r--r--debian/mdadm.dirs2
-rw-r--r--debian/mdadm.docs1
-rw-r--r--debian/mdadm.init6
-rw-r--r--debian/mdadm.postinst152
-rw-r--r--debian/mdadm.postrm9
-rw-r--r--debian/mdadm.preinst9
-rw-r--r--debian/mdadm.templates91
-rw-r--r--debian/mkconf56
-rwxr-xr-xdebian/rules4
25 files changed, 489 insertions, 307 deletions
diff --git a/debian/FAQ b/debian/FAQ
index 08c04f54..7fbf3abc 100644
--- a/debian/FAQ
+++ b/debian/FAQ
@@ -3,8 +3,8 @@ Frequently asked questions -- Debian mdadm
Also see /usr/share/doc/mdadm/README.recipes.gz
-1. How do I change the preferred minor of a RAID array?
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+1. How do I change the preferred minor of a MD array?
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
See item 12 in /usr/share/doc/mdadm/README.recipes.gz and read the mdadm
manpage (search for 'preferred').
diff --git a/debian/NEWS b/debian/NEWS
index b6c27b1f..9dbecd55 100644
--- a/debian/NEWS
+++ b/debian/NEWS
@@ -1,3 +1,14 @@
+mdadm (2.5.3.git200608201206-1) unstable; urgency=low
+
+ This version makes mdadm.conf mandatory. If you do not have such a file, it
+ will be created for you.
+
+ You must verify the contents of this file and ensure that it represents your
+ local configuration. See /usr/share/doc/mdadm/README.upgrading-2.5.3 for
+ more information.
+
+ -- martin f. krafft <madduck@debian.org> Sun, 20 Aug 2006 21:58:43 +0100
+
mdadm (2.5-1) unstable; urgency=low
mdrun has been (finally) obsoleted, and an appropriate warning message is
diff --git a/debian/README.initramfs-transition b/debian/README.initramfs-transition
index 29e6b040..ea72e2ec 100644
--- a/debian/README.initramfs-transition
+++ b/debian/README.initramfs-transition
@@ -1,18 +1,16 @@
mdadm for Debian - initramfs transition
=======================================
-None of the following needs to concern you if you are using monolithic kernels
-(no modules), yaird, or initrd-tools/mkinitrd.
+If you are using monolithic kernels (no modules), you need not concern
+yourself with any of this.
-This information is about #367567. The gist is that the hooks and scripts to
-take care of RAID during boot with an initramfs have been improved and moved
-into the mdadm package. mdrun has been deprecated on the way.
+If you are using yaird or initrd-tools/mkinitrd, please see README.mdrun. The
+following information is irrelevant to you.
-As long as the version of initramfs-tools you have installed still provides
-the old hooks and scripts (which use mdrun), the new ones will simply not do
-anything (which allows me to get rid of the conflict I needed previously).
-Version 0.70 and later does not provide these hooks anymore, so the new mdadm
-hooks will be used, which use mdadm instead of mdrun.
+The following information is about #367567. The gist is that the hooks and
+scripts to take care of MD arrays during boot with an initramfs have been
+improved and moved into the mdadm package. mdrun has been deprecated on the
+way.
initramfs-tools does *not* conflict with older mdadm but instead provides
fallback code in case mdadm << 2.5-1 is installed (which does not provide the
@@ -29,7 +27,7 @@ is sane after installation and before you reboot.
Also, you may want to provide yourself a safety net by making a copy of the
initrd:
- cp /boot/initrd.img-$(uname -r) /boot/initrd.img-$(uname -r).before-mdadm25
+ cp /boot/initrd.img-$(uname -r) /boot/initrd.img-$(uname -r).before-mdadm2
and then to duplicate your main grub or lilo stanzas (rerun lilo!) and point
them to the saved initrd. If things go haywire, you should be able to restore
@@ -49,6 +47,6 @@ don't want it overwritten.
Again, please report success or failure to me.
- -- martin f. krafft <madduck@debian.org> Mon, 31 Jul 2006 14:32:21 +0100
+ -- martin f. krafft <madduck@debian.org> Mon, 20 Aug 2006 17:32:21 +0100
$Id$
diff --git a/debian/README.mdrun b/debian/README.mdrun
index 7e4718e7..a325d2b0 100644
--- a/debian/README.mdrun
+++ b/debian/README.mdrun
@@ -2,7 +2,7 @@ mdadm for Debian -- notes on mdrun
==================================
mdadm for Debian ships with /sbin/mdrun, which is a sledgehammer approach to
-assembling RAID volumes during boot. Unfortunately, the script has several
+assembling MD arrays during boot. Unfortunately, the script has several
problems (see e.g. #354705) and can cause major headaches.
Fortunately, mdadm has since added all the functionality needed to replace
@@ -23,8 +23,8 @@ do to rid yourself of mdrun:
to be able to run this command, you need to ensure that
/etc/mdadm/mdadm.conf (or /etc/mdadm.conf, which is less preferred)
- properly describes your RAID volumes. You can use the output generated by
- the script /usr/share/mdadm/mkconf to help you migrate an existing
+ properly describes your MD arrays. You can use the output generated by the
+ script /usr/share/mdadm/mkconf to help you migrate an existing
configuration or to create a new configuration file.
You can find more information in the mdadm(8) and mdadm.conf(5) manpages.
diff --git a/debian/README.recipes b/debian/README.recipes
index 186df9bf..fc638ed0 100644
--- a/debian/README.recipes
+++ b/debian/README.recipes
@@ -125,8 +125,8 @@ Enjoy. Submissions welcome.
mount /dev/md0 /home # also change /etc/fstab
mdadm --add /dev/md0 /dev/sda1
-12. change the preferred minor of a RAID array
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+12. change the preferred minor of an MD array
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# you need to manually assemble the array to change the preferred minor
# if you manually assemble, the superblock will be updated to reflect
# the preferred minor as you indicate with the assembly.
diff --git a/debian/README.upgrading-2.5.3 b/debian/README.upgrading-2.5.3
new file mode 100644
index 00000000..a0862944
--- /dev/null
+++ b/debian/README.upgrading-2.5.3
@@ -0,0 +1,33 @@
+upgrading to mdadm 2.5.3 from previous versions
+===============================================
+
+With version 2.5.3, the Debian mdadm package now requires a mdadm.conf file.
+This file should be in /etc/mdadm/mdadm.conf, although /etc/mdadm.conf will
+also be read if the former is not present, but it is less preferred.
+
+The reason the configuration file is now required is because it was impossible
+to come up with robust heuristics to replace the previously used mdrun, while
+addressing its primary deficiency of not honouring the super-minor field and
+randomly assembling devices (see #354705).
+
+Systems without a mdadm.conf file
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+If your system does not have an mdadm.conf file, the package creates one for
+your during the installation phase. Furthermore, a configuration file is
+created during the updating of the initramfs (initial ramdisk), if no file is
+found at the time. In both cases, the running system is used as a reference,
+meaning that the file is generated automatically in such a way as to reflect
+the running system.
+
+This should work in most cases. I strongly suggest, however, that you inspect
+the generated file (/etc/mdadm/mdadm.conf) before you reboot. If you find any
+anomaly or mistakes, correct them and proceed with the next step ("Systems
+with a mdadm.conf file").
+
+Systems with a mdadm.conf file
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+If an existing configuration file was found,
+
+ -- martin f. krafft <madduck@debian.org> Mon, 20 Aug 2006 19:11:21 +0100
+
+$Id: README.initramfs-transition 89 2006-08-08 09:33:05Z madduck $
diff --git a/debian/UPGRADE-STRATEGY b/debian/UPGRADE-STRATEGY
index 133f3ece..40f30c65 100644
--- a/debian/UPGRADE-STRATEGY
+++ b/debian/UPGRADE-STRATEGY
@@ -10,7 +10,7 @@ sarge. The plan is to support
We want to be able to deal with:
- - any filesystem on RAID, including root and swap
+ - any filesystem on MD, including root and swap
- assembly/starting by kernel, mdadm -A, and mdadm -As (mdrun)
- partitionable arrays
- plain /dev, udev, or devfs
@@ -22,8 +22,8 @@ We explicitly do not support:
What do we have to worry about?
- root must be mounted either by the initrd or by the kernel
- - other RAIDs must be mounted either by the initrd or by the kernel or by
- the init script
+ - other MD arrays must be mounted either by the initrd or by the kernel or
+ by the init script
- device nodes must exist by the time the init script finished
- no real need to worry about root, but good to have a device node on the
running system anyway. See next point.
diff --git a/debian/bugscript b/debian/bugscript
index 96ccde7c..ff1a7fed 100644
--- a/debian/bugscript
+++ b/debian/bugscript
@@ -13,8 +13,8 @@
set -eu
if [ ! -r /proc/mdstat ]; then
- echo "The local system does not have RAID support (no drivers loaded)."
- echo "Without RAID support, I cannot collect as much information as I'd like."
+ echo "The local system does not have MD support (no drivers loaded)."
+ echo "Without MD support, I cannot collect as much information as I'd like."
#yesno "Are you sure you want to report a bug at this time? " yep
yesno "Hit any key to continue..."
diff --git a/debian/changelog b/debian/changelog
index ac143bcc..ef1a572f 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,45 +1,52 @@
-mdadm (2.5.3.git200608201206-1~unreleased.1) UNRELEASED; urgency=low
+mdadm (2.5.3.git200608202239-1~unreleased.1) UNRELEASED; urgency=low
- * Tracking upstream git now.
-
- -- martin f. krafft <madduck@debian.org> Fri, 11 Aug 2006 10:25:30 +0100
-
-mdadm (2.5.3-1~unreleased.5) UNRELEASED; urgency=low
-
- * Improved udev integration.
- * Updated debconf translations:
- - French by Florentin Duneau (closes: #382389).
- * Pushed build dependency to 5.0.32 and DH compatibility level to 5 because
- of dh_installudev use (closes: #382480).
- * Don't fail mdadm-raid when /dev is on a read-only filesystem
- (closes: #382876).
-
- -- martin f. krafft <madduck@debian.org> Sun, 13 Aug 2006 23:40:27 +0100
-
-mdadm (2.5.3-1~unreleased.4) UNRELEASED; urgency=low
-
- * Readded udev rules, but consult a script now to figure out the name to
- use. This should address #382263 appropriately. In the long run, I should
- give the user a debconf question to decide which naming scheme to use.
- Thanks to Marco d'Itri for his help.
-
- -- martin f. krafft <madduck@debian.org> Thu, 10 Aug 2006 20:30:42 +0100
-
-mdadm (2.5.3-1~unreleased.3) UNRELEASED; urgency=low
-
- * New upstream release.
+ * Tracking upstream git releases.
- now the --run switch behaves as stated in the manpage. This properly
fixes #287415
- new version-1 partitionable arrays are now named X instead of _dX (e.g.
0 instead of _d0) for device names like md_dX. I actually think this is
a bug and hope upstream will use dX (e.g. d0) instead in a future
version.
+ * Instead of trying to do a whole lot of magic with respect to detecting
+ RAID devices to start, mdadm from now on requires a valid mdadm.conf file
+ to be installed. It still tries to do what it can, but there are no
+ heuristics anymore. See /usr/share/doc/mdadm/README.upgrading-2.5.3 .
+ * Removed the zero-superblock warning because we require the user to sign
+ off the configuration file anyway.
+ * This also enables us to use mdadm.conf from the initial ramdisk and thus
+ closes: #381303.
+ * In case the user chooses to assemble all arrays from the initial ramdisk,
+ use the new homehost feature of mdadm (closes: #381057). This will start
+ only those arrays belonging to the local system, unless it is the first
+ run on a system, in which case it will start all arrays and mark them as
+ belonging to the local system.
+ * Improved the debconf control script: integrated error messages into the
+ frontends, and made it a bit smarter. Error messages can now be
+ translated, and the script checks whether the user's choice is listed in
+ the configuration file and only proceeds if it is, or the user chooses to
+ ignore that it is not.
+ * mkconf can now take a generate/force-generate parameter to write directly
+ to /etc/mdadm/mdadm.conf. A second parameter specifies an alternate
+ filename.
+ * mkconf now outputs comments for the settings it suggests.
+ * Removed all udev-related stuff. We must coexist with udev because there
+ are setups that assemble arrays without mdadm, so the device nodes must be
+ created by udev, if that is used.
+ (closes: #382263, #382450, #383688, #383891, #383806, #382480)
+ Staying at low urgency since these (RC) bugs only exist in unstable.
+ * Now installs MD modules and mdadm/mdrun into initial ramdisk regardless of
+ whether the hook script thinks there are devices to start. This was done
+ to enable recovery from the initramfs shell.
+ * Now uses 'MD' instead of 'RAID' consistently in all messages.
* Now rebuilds initramfs for all installed kernels.
- * Removed udev rules because it was causing unbootable systems when the
- kernel autoassembly assembled the RAIDs (and not mdadm) and thus no device
- nodes were created (closes: #382263).
+ * Now breaks the endless config loop only when the user does not see the
+ question (see #381284, #381007).
+ * Don't fail mdadm-raid when /dev is on a read-only filesystem
+ (closes: #382876).
+ * Updated debconf translations:
+ - French by Florentin Duneau (closes: #382389).
- -- martin f. krafft <madduck@debian.org> Thu, 10 Aug 2006 14:56:47 +0100
+ -- martin f. krafft <madduck@debian.org> Sun, 20 Aug 2006 22:38:03 +0100
mdadm (2.5.2-10) unstable; urgency=low
diff --git a/debian/checkarray b/debian/checkarray
index a116d079..bdd75d8f 100644
--- a/debian/checkarray
+++ b/debian/checkarray
@@ -1,6 +1,6 @@
#!/bin/sh
#
-# checkarray -- initiates a check run of an array's redundancy information.
+# checkarray -- initiates a check run of an MD array's redundancy information.
#
# Copyright © martin f. krafft <madduck@debian.org>
# distributed under the terms of the Artistic Licence 2.0
@@ -14,7 +14,7 @@ PROGNAME=${0##*/}
about()
{
- echo "$PROGNAME -- RAID redundancy checker tool"
+ echo "$PROGNAME -- MD array redundancy checker tool"
echo '$Id$'
echo "Copyright © martin f. krafft <madduck@debian.org>"
echo "Released under the terms of the Artistic Licence 2.0"
@@ -99,7 +99,7 @@ if [ $cron = 1 ] && ! is_true ${AUTOCHECK:-false}; then
fi
if [ ! -f /proc/mdstat ]; then
- [ $quiet -lt 2 ] && echo "$PROGNAME: E: RAID subsystem not loaded, or /proc unavailable." >&2
+ [ $quiet -lt 2 ] && echo "$PROGNAME: E: MD subsystem not loaded, or /proc unavailable." >&2
exit 2
fi
@@ -109,7 +109,7 @@ if [ ! -d /sys/block ]; then
fi
if [ -z "$(ls /sys/block/md* 2>/dev/null)" ]; then
- [ $quiet -lt 2 ] && echo "$PROGNAME: W: no active RAID arrays found." >&2
+ [ $quiet -lt 2 ] && echo "$PROGNAME: W: no active MD arrays found." >&2
[ $quiet -lt 2 ] && echo "$PROGNAME: W: (maybe uninstall the mdadm package?)" >&2
exit 5
fi
diff --git a/debian/control b/debian/control
index e91771cf..a790d14a 100644
--- a/debian/control
+++ b/debian/control
@@ -12,7 +12,7 @@ Depends: ${shlibs:Depends}, makedev, ${misc:Depends}, lsb-base (>= 3.1-6)
Recommends: mail-transport-agent
Replaces: mdctl
Conflicts: mdctl (<< 0.7.2), raidtools2 (<< 1.00.3-12.1), initramfs-tools (<< 0.65)
-Description: tool to administer Linux MD device arrays (software RAID)
+Description: tool to administer Linux MD arrays (software RAID)
mdadm is a program that can be used to create, manage, and monitor MD
devices (software RAID), as well as multipath devices.
@@ -21,7 +21,7 @@ Section: debian-installer
XC-Package-Type: udeb
Architecture: any
Depends: ${shlibs:Depends}
-Description: tool to administer Linux MD device arrays (software RAID)
+Description: tool to administer Linux MD arrays (software RAID)
mdadm is a program that can be used to create, manage, and monitor MD
devices (software RAID), as well as multipath devices.
.
diff --git a/debian/initramfs/hook b/debian/initramfs/hook
index 97197d27..a7af4c35 100644
--- a/debian/initramfs/hook
+++ b/debian/initramfs/hook
@@ -1,9 +1,13 @@
-#!/bin/sh -eu
+#!/bin/sh
#
# Copyright © 2006 Martin F. Krafft <madduck@debian.org>
# based on the scripts in the initramfs-tools package.
# released under the terms of the Artistic Licence.
#
+# $Id$
+#
+
+set -eu
PREREQ=""
@@ -33,94 +37,127 @@ if [ -e /etc/initramfs-tools/hooks/md ]; then
exit 0
fi
-MDADM=$(command -v mdadm)
+MDADM=$(command -v mdadm 2>/dev/null) || :
[ -x $MDADM ] || exit 0
[ -r /usr/share/initramfs-tools/hook-functions ] || exit 0
. /usr/share/initramfs-tools/hook-functions
+DEBIANCONFIG=/etc/default/mdadm
+CONFIG=/etc/mdadm/mdadm.conf
+ALTCONFIG=/etc/mdadm.conf
+
INITRDSTART=all
-[ -s /etc/default/mdadm ] && . /etc/default/mdadm
-
-DEVS=''; LEVELS=''
-if [ "$INITRDSTART" != none ]; then
- eval $(mdadm --examine --scan --config=partitions \
- | while read a dev level num uuid; do
- case "$dev" in
- (/dev/md[0-9]*|/dev/md_d[0-9]*)
- dev_part="${dev#/dev/md}"
- devfs_name="/dev/md/${dev_part#_}"
- if [ -b "$dev" ] && [ -b "$devfs_name" ] \
- && expr "$INITRDSTART" : ".*${devfs_name}.*" >/dev/null; then
- echo "W: mdadm: both $dev and $devfs_name exist, and $devfs_name appears to be used." >&2
- echo "W: mdadm: applying workaround for mdadm bug, don't worry! (see #381181)" >&2
- dev="$devfs_name"
- fi
- ;;
- esac
+[ -s $DEBIANCONFIG ] && . $DEBIANCONFIG
- if [ "$INITRDSTART" = all ] || expr "$INITRDSTART" : ".*${dev}.*" >/dev/null; then
- uuid="${uuid#*UUID=}"
- DEVS="$DEVS ${dev}=${uuid%% *}"
- LEVELS="$LEVELS ${level#level=}"
- fi
+[ ! -f $CONFIG ] && [ -f $ALTCONFIG ] && CONFIG=$ALTCONFIG
+if [ -f $CONFIG ]; then
+ if [ -e /var/lib/mdadm/CONF-UNCHECKED ]; then
+ # the file comes from an old installation and hence is not guaranteed to
+ # work. We thus refuse to work.
- echo "DEVS='$DEVS'"
- echo "LEVELS='$LEVELS'"
- done)
+ echo "E: mdadm: unchecked mdadm.conf file found." >&2
+ echo "I: mdadm: please read /usr/share/doc/mdadm/README.upgrading-2.5.3 ." >&2
+ echo "I: mdadm: leaving RAID initialisation to initramfs (mdrun)." >&2
+ exit 0
+ fi
- [ "$INITRDSTART" = all ] && DEVS=all
+else
+ # there is no configuration file, so let's create one
+ if /usr/share/mdadm/mkconf generate $CONFIG; then
+ echo "I: mdadm: auto-generated the mdadm.conf configuration file." >&2
+ else
+ echo "E: mdadm: failed to autogenerate the mdadm.conf file." >&2
+ echo "I: mdadm: leaving RAID initialisation to initramfs (mdrun)." >&2
+ rm -f $CONFIG
+ exit 0
+ fi
fi
+# install the configuration file
+mkdir -p $DESTDIR/etc/mdadm
+sed -e :a -re '$!N;s/\n[[:space:]]+/ /;ta' -ne '/^(ARRAY|DEVICE)/P;D' \
+ < $CONFIG > $DESTDIR/etc/mdadm/mdadm.conf
+
+# obtain dev:level pairs from config file, honouring multiline entries
+devpairs="$(
+ while read line; do
+ for atom in $line; do
+ case "$atom" in
+ (/dev*) dev=$atom;;
+ (level=*) level=${atom#level=};;
+ (*) :;;
+ esac
+ done
+ [ -n "${dev:-}" ] && echo -n "${dev}:${level} "
+ done < $DESTDIR/etc/mdadm/mdadm.conf)"
+
+copy_exec $MDADM /sbin
+
+# copy all modules into the initramfs, just for safety.
+# we copy raid456 / raid5+raid6 because the hook script just won't do
+# anything when the module cannot be found.
+modules="linear multipath raid0 raid1 raid456 raid5 raid6 raid10"
+for mod in $modules; do manual_add_modules $mod; done
+
uniquify()
{
for i in $@; do echo "$i"; done | sort -u
}
-if [ -n "$DEVS" ]; then
-
- homehost=$(sed -ne 's,^[[:space:]]*HOMEHOST[[:space:]]*,,p' \
- /etc/mdadm.conf /etc/mdadm/mdadm.conf 2>/dev/null || :)
+if [ "$INITRDSTART" != none ] && [ -n "$devpairs" ]; then
+ # save the homehost for now, even if we don't use it yet
+ homehost="$(sed -ne 's,^[[:space:]]*HOMEHOST[[:space:]]*,,p' $CONFIG)"
if [ -z "$homehost" ] || [ "$homehost" = '<system>' ]; then
homehost="$(hostname)"
fi
- echo "RAID_HOMEHOST='$homehost'" > DESTDIR/conf/raid.conf
- echo "RAID_DEVS='${DEVS## }'" >> $DESTDIR/conf/raid.conf
- echo "RAID_LEVELS='${LEVELS## }'" >> $DESTDIR/conf/raid.conf
+ echo "MD_HOMEHOST='$homehost'" > $DESTDIR/conf/md.conf
+ echo "MD_DEVPAIRS='${devpairs% }'" >> $DESTDIR/conf/md.conf
+
+ devs=''; levels=''
+ for i in $devpairs; do
+ dev=${i%:*}
+ level=${i##*:}
+ case "$INITRDSTART" in
+ all|*${dev}*)
+ devs="${devs:+$devs }$dev"
+ levels="${levels:+$levels }$level"
+ ;;
+ *) :;;
+ esac
+ done
+
+ echo "MD_LEVELS='$levels'" >> $DESTDIR/conf/md.conf
+ if [ "$INITRDSTART" = all ]; then
+ echo "MD_DEVS=all" >> $DESTDIR/conf/md.conf
+ else
+ echo "MD_DEVS='$devs'" >> $DESTDIR/conf/md.conf
+ fi
# raid4 is handled by raid5
- MODULES="$(echo $LEVELS | sed -e 's,raid4,raid5,g')"
+ modules="$(echo $levels | sed -e 's,raid4,raid5,g')"
# if raid456 module is present, use it for raid[456]
modprobe --set-version="$version" --show-depends raid456 >/dev/null 2>&1 \
- && MODULES="$(echo $MODULES | sed -e 's,raid[456],raid456,g')"
-
- MODULES="$(uniquify $MODULES | tr '\n' ' ')"
- echo "RAID_MODULES='${MODULES%% }'" >> $DESTDIR/conf/raid.conf
+ && modules="$(echo $modules | sed -e 's,raid[456],raid456,g')"
- copy_exec $MDADM /sbin
+ modules="$(uniquify $modules | tr '\n' ' ')"
+ echo "MD_MODULES='${modules% }'" >> $DESTDIR/conf/md.conf
- # copy all modules into the initramfs, just for safety.
- # we copy raid456 / raid5+raid6 because the hook script just won't do
- # anything when the module cannot be found.
- MODULES="linear multipath raid0 raid1 raid456 raid5 raid6 raid10"
- for mod in $MODULES; do manual_add_modules $mod; done
-
- if [ "$DEVS" = all ]; then
- DEVNAMES="all RAID arrays"
+ if [ "$INITRDSTART" = all ]; then
+ echo "I: mdadm: will start all available MD arrays from the initial ramdisk." >&2
else
- DEVNAMES="$(for i in $DEVS; do echo -n "${i%=*},"; done)"
- DEVNAMES="${DEVNAMES%,}"
+ for i in $devs; do
+ echo "I: mdadm: will start MD array $i from the initial ramdisk." >&2
+ done
fi
- echo "I: mdadm: RAID support installed to mount $DEVNAMES during boot." >&2
-
else
- echo "I: mdadm: no RAID devices selected for initrd initialisation." >&2
- echo "I: mdadm: not including RAID stuff." >&2
+ echo "I: mdadm: no MD arrays will be started from the initial ramdisk." >&2
fi
+# only output this on Debian systems
[ -s /etc/default/mdadm ] && \
- echo 'I: mdadm: use `dpkg-reconfigure -plow mdadm` to change this.' >&2
+ echo 'I: mdadm: use `dpkg-reconfigure --priority=low mdadm` to change this.' >&2
exit 0
diff --git a/debian/initramfs/script.local-top b/debian/initramfs/script.local-top
index f462e4e6..8146c6d7 100644
--- a/debian/initramfs/script.local-top
+++ b/debian/initramfs/script.local-top
@@ -1,9 +1,13 @@
-#!/bin/sh -eu
+#!/bin/sh
#
# Copyright © 2006 Martin F. Krafft <madduck@debian.org>
# based on the scripts in the initramfs-tools package.
# released under the terms of the Artistic Licence.
#
+# $Id$
+#
+
+set -eu
PREREQ="udev_helper"
@@ -22,7 +26,7 @@ esac
. /scripts/functions
if [ -e /scripts/local-top/md ]; then
- log_failure_msg "old RAID initialisation script found, getting out of its way..."
+ log_failure_msg "old md initialisation script found, getting out of its way..."
exit 1
fi
@@ -38,12 +42,17 @@ verbose()
esac
}
-[ -s /conf/raid.conf ] && . /conf/raid.conf
+MD_DEVS=all
+MD_MODULES='linear multipath raid0 raid1 raid456 raid5 raid6 raid10'
+[ -s /conf/md.conf ] && . /conf/md.conf
-$MDADM --examine --scan --config=partitions > /etc/mdadm.conf
+CONFIG=/etc/mdadm/mdadm.conf
+# this really should not be needed, but also doesn't hurt.
+[ -e $CONFIG ] || \
+ $MDADM --examine --scan --config=partitions > $CONFIG
-verbose && log_begin_msg Loading RAID modules
-for module in ${RAID_MODULES:-}; do
+verbose && log_begin_msg Loading MD modules
+for module in ${MD_MODULES:-}; do
if modprobe --syslog "$module"; then
verbose && log_success_msg "loaded module ${module}."
else
@@ -53,18 +62,21 @@ done
log_end_msg
if [ ! -f /proc/mdstat ]; then
- verbose && panic "cannot initialise RAID subsystem (/proc/mdstat missing)"
+ verbose && panic "cannot initialise MD subsystem (/proc/mdstat missing)"
exit 1
fi
# handle /dev/md/X nodes
mkdir --parent /dev/md
-if [ ${RAID_DEVS:-all} = all ]; then
+if [ "$MD_DEVS" = all ]; then
- verbose && log_begin_msg "Assembling all RAID arrays"
+ verbose && log_begin_msg "Assembling all MD arrays"
- if $MDADM --assemble --config=/etc/mdadm.conf --scan --run --auto=yes; then
+ extra_args=''
+ [ -n "$MD_HOMEHOST" ] && \
+ extra_args="--homehost='$MD_HOMEHOST' --auto-update-homehost"
+ if $MDADM --assemble --scan --run --auto=yes $extra_args; then
verbose && log_success_msg "success"
else
verbose && log_failure_msg "failed"
@@ -73,17 +85,14 @@ if [ ${RAID_DEVS:-all} = all ]; then
verbose && log_end_msg
else
- for dev in ${RAID_DEVS:-}; do
-
- DEV=${dev%=*}
- UUID=${dev#*=}
+ for dev in $MD_DEVS; do
- verbose && log_begin_msg "Assembling RAID array $DEV ($UUID)"
+ verbose && log_begin_msg "Assembling MD array $dev"
- if $MDADM --assemble --config=partitions --run --auto=yes --uuid $UUID $DEV; then
- verbose && log_success_msg "started $DEV ($UUID)"
+ if $MDADM --assemble --run --auto=yes $dev; then
+ verbose && log_success_msg "started $dev"
else
- verbose && log_failure_msg "failed to start $DEV ($UUID)"
+ verbose && log_failure_msg "failed to start $dev"
fi
verbose && log_end_msg
diff --git a/debian/mdadm-raid b/debian/mdadm-raid
index 30e96848..1299914c 100644
--- a/debian/mdadm-raid
+++ b/debian/mdadm-raid
@@ -69,14 +69,14 @@ is_true()
case "${1:-}" in
start)
- PREFIX="Assembling RAID array"
+ PREFIX="Assembling MD array"
if is_true $AUTOSTART; then
if [ ! -f /proc/mdstat ] && [ -x "$(command -v modprobe)" ] ; then
modprobe -kq md 2>/dev/null || :
fi
if [ ! -f /proc/mdstat ]; then
- log_problem "failed to load RAID subsystem"
+ log_problem "failed to load MD subsystem"
exit 0
fi
@@ -152,11 +152,11 @@ case "${1:-}" in
;;
stop)
- PREFIX="Stopping RAID array"
+ PREFIX="Stopping MD array"
if is_true $AUTOSTART; then
if [ ! -f /proc/mdstat ]; then
- log_problem "no RAID subsystem loaded"
+ log_problem "no MD subsystem loaded"
exit 0
fi
@@ -206,7 +206,7 @@ case "${1:-}" in
;;
reload)
- PREFIX="Reloading RAID array"
+ PREFIX="Reloading MD array"
log_notice "never anything to do"
;;
diff --git a/debian/mdadm.config b/debian/mdadm.config
index d93d47ac..0c5b5320 100644
--- a/debian/mdadm.config
+++ b/debian/mdadm.config
@@ -50,26 +50,28 @@ if [ -s $DEBIANCONFIG ] ; then
[ -n "$MAILADDR" ] && db_set mdadm/mail_to "$MAILADDR"
fi
-db_input high mdadm/warning || true
-db_go
-
-db_fget mdadm/initrdstart seen || true
+db_fget mdadm/initrdstart seen
if [ -z "$INITRDSTART" ] || [ "$RET $INITRDSTART" = "false all" ]; then
- ROOTRAIDDEV="$(df / | sed -rne 's,^(/dev/[^[:space:]]+).*,\1,p')"
- if ! mdadm --detail $ROOTRAIDDEV >/dev/null 2>&1; then
+ rootraiddev="$(df / | sed -rne 's,^(/dev/[^[:space:]]+).*,\1,p')"
+ if ! mdadm --detail $rootraiddev >/dev/null 2>&1; then
# you are using some funky setup. Let's be save...
# (could also happen during preconfigure, when no mdadm present)
INITRDSTART=all
else
- INITRDSTART="$ROOTRAIDDEV"
+ # remove partition from partitionable array
+ INITRDSTART="${rootraiddev%p[0-9]*}"
fi
fi
[ -n "$INITRDSTART" ] && db_set mdadm/initrdstart "$INITRDSTART"
-cnt=0
+db_capb escape
+
+msg=intro; suffix=''
while true; do
- db_input low mdadm/initrdstart || true
+ db_metaget mdadm/initrdstart_msg_${msg} extended_description || :
+ db_subst mdadm/initrdstart msg "$(echo -e "${RET}${suffix}" | debconf-escape -e)"
+ ret=0; db_input low mdadm/initrdstart || ret=$?
db_go
db_get mdadm/initrdstart
@@ -80,44 +82,65 @@ while true; do
all) break;;
*)
- ARRAYS=''
- ERROR=0
+ arrays=''
+ error=0
for i in $INITRDSTART; do
# standardise by prefixing /dev/
i="/dev/${i#/dev/}"
if [ ! -e "$i" ]; then
- echo "E: device node does not exist: $i" >&2
- ERROR=1; break
+ error=1; msg=errexist; suffix=": $i"; break
fi
if [ ! -b "$i" ]; then
- echo "E: not a block device: $i" >&2
- ERROR=1; break
+ t="$(readlink -nf "$i")"
+ if [ ! -b "$t" ]; then
+ suffix=": $t"
+ else
+ suffix=": $i"
+ fi
+ error=1; msg=errblock; break
fi
if ! mdadm --detail "$i" >/dev/null 2>&1; then
- echo "E: not a RAID array: $i" >&2
- ERROR=1; break
+ error=1; msg=errmd; suffix=": $i"; break
fi
- # remove partition from name of partitionable devices
- i="${i%p[0-9]*}"
+ if [ -f $CONFIG ]; then
+ if ! egrep -q "^ARRAY[[:space:]]+$i[[:space:]]+" $CONFIG; then
+ t="$(readlink -nf "$i")"
+ if [ -L "$i" ] \
+ && egrep -q "^ARRAY[[:space:]]+$t[[:space:]]+" $CONFIG; then
+ i="$t"
+ else
+ db_subst mdadm/initrdstart_notinconf array "$i"
+ db_subst mdadm/initrdstart_notinconf config "$CONFIG"
+ db_input high mdadm/initrdstart_notinconf || :
+ db_go
+ db_get mdadm/initrdstart_notinconf
+ if [ "$RET" = true ]; then
+ md5sum $CONFIG > /var/lib/mdadm/CONF-UNCHECKED
+ else
+ db_fset mdadm/initrdstart seen false
+ error=1; msg=errconf; suffix=": $i"; break
+ fi
+ fi
+ fi
+ fi
# uniquely add device name
- echo $ARRAYS | egrep -q "\b${i}\b" || ARRAYS="${ARRAYS:+$ARRAYS }$i"
+ echo $arrays | egrep -q "\b${i}\b" || arrays="${arrays:+$arrays }$i"
done
- if [ $ERROR -eq 0 ]; then
- INITRDSTART="$ARRAYS"
+ if [ $error -eq 0 ]; then
+ INITRDSTART="$arrays"
# exit the while true loop
break
fi
- cnt=$((cnt + 1))
- if [ $cnt -eq 3 ]; then
- echo "W: unable to determine RAID arrays needed for boot." >&2
+ if [ $ret -eq 30 ]; then
+ echo "W: unable to determine MD arrays needed for boot." >&2
echo "W: falling back to starting all of them..." >&2
INITRDSTART=all
break
@@ -129,18 +152,18 @@ done
db_set mdadm/initrdstart "$INITRDSTART"
if [ "$INITRDSTART" != all ]; then
- db_input high mdadm/autostart || true
+ db_input high mdadm/autostart || :
db_go
fi
-db_input medium mdadm/autocheck || true
+db_input medium mdadm/autocheck || :
db_go
-db_input medium mdadm/start_daemon || true
+db_input medium mdadm/start_daemon || :
db_go
-db_get mdadm/start_daemon
+db_get mdadm/start_daemon || :
if [ "$RET" = true ]; then
- db_input medium mdadm/mail_to || true
+ db_input medium mdadm/mail_to || :
db_go
fi
diff --git a/debian/mdadm.cron.d b/debian/mdadm.cron.d
index e8c68b5c..5acf8b94 100644
--- a/debian/mdadm.cron.d
+++ b/debian/mdadm.cron.d
@@ -1,5 +1,5 @@
#
-# cron.d/mdadm -- schedules periodic parity checks of RAID devices
+# cron.d/mdadm -- schedules periodic redundancy checks of MD devices
#
# Copyright © martin f. krafft <madduck@madduck.net>
# distributed under the terms of the Artistic Licence 2.0
diff --git a/debian/mdadm.dirs b/debian/mdadm.dirs
index 47e7a86c..4758e560 100644
--- a/debian/mdadm.dirs
+++ b/debian/mdadm.dirs
@@ -6,4 +6,4 @@ usr/share/initramfs-tools/scripts/local-top
usr/share/bug/mdadm
usr/share/lintian/overrides
var/lib/mdadm
-lib/udev
+#lib/udev
diff --git a/debian/mdadm.docs b/debian/mdadm.docs
index 6282b256..2a34ed24 100644
--- a/debian/mdadm.docs
+++ b/debian/mdadm.docs
@@ -1,6 +1,7 @@
TODO
debian/README.recipes
debian/README.initramfs-transition
+debian/README.upgrading-2.5.3
debian/README.mdrun
debian/README.checkarray
debian/FAQ
diff --git a/debian/mdadm.init b/debian/mdadm.init
index 7e201751..1d74a597 100644
--- a/debian/mdadm.init
+++ b/debian/mdadm.init
@@ -1,6 +1,6 @@
#!/bin/sh
#
-# Start the RAID monitor daemon for all active md arrays if desired.
+# Start the MD monitor daemon for all active MD arrays if desired.
#
# Copyright © 2001-2005 Mario Jou/3en <joussen@debian.org>
# Copyright © 2005-2006 Martin F. Krafft <madduck@debian.org>
@@ -36,7 +36,7 @@ is_true()
case "${1:-}" in
start)
if is_true $START_DAEMON; then
- log_daemon_msg "Starting RAID monitoring service" "mdadm --monitor"
+ log_daemon_msg "Starting MD monitoring service" "mdadm --monitor"
mkdir -p $RUNDIR
set +e
start-stop-daemon -S -p $PIDFILE -x $MDADM -- \
@@ -47,7 +47,7 @@ case "${1:-}" in
;;
stop)
if [ -f $PIDFILE ] ; then
- log_daemon_msg "Stopping RAID monitoring service" "mdadm --monitor"
+ log_daemon_msg "Stopping MD monitoring service" "mdadm --monitor"
set +e
start-stop-daemon -K -p $PIDFILE -x $MDADM
rm -f $PIDFILE
diff --git a/debian/mdadm.postinst b/debian/mdadm.postinst
index 8e1841f4..931c1484 100644
--- a/debian/mdadm.postinst
+++ b/debian/mdadm.postinst
@@ -6,74 +6,71 @@
# $Id$
#
+. /usr/share/debconf/confmodule
+# See #369953 for ordering
set -eu
-if [ "${1:-}" = "configure" ]; then
+case "${1:-}" in
+ configure|reconfigure)
- set +u # debconf workaround. See #369953
- . /usr/share/debconf/confmodule
- set -u
+ if [ ! -f /proc/mdstat ] && [ -x $(command -v modprobe) ]; then
+ modprobe -k md >/dev/null 2>&1 || :
+ fi
+ if [ ! -f /proc/mdstat ]; then
+ echo 'W: failed to load MD subsystem.' >&2
+ fi
- if [ ! -f /proc/mdstat ] && [ -x $(command -v modprobe) ]; then
- modprobe -k md >/dev/null 2>&1 || :
- fi
- if [ ! -f /proc/mdstat ]; then
- echo 'W: failed to load RAID subsystem.' >&2
- fi
+ if [ ! -e /dev/md15 ] \
+ && [ ! -e /dev/.static/dev/md15 ] \
+ && [ ! -e /dev/.devfsd ]; then
+
+ echo -n 'Generating array device nodes... ' >&2
+ cd /dev
+ if /sbin/MAKEDEV md >&2 >/dev/null; then
+ echo 'done.' >&2
+ else
+ echo 'failed.' >&2
+ fi
+ fi
- if [ ! -e /dev/md15 ] \
- && [ ! -e /dev/.static/dev/md15 ] \
- && [ ! -e /dev/.devfsd ]; then
+ DEBIANCONFIG=/etc/default/mdadm
+ CONFIG=/etc/mdadm/mdadm.conf
+ ALTCONFIG=/etc/mdadm.conf
+ MDADM=/sbin/mdadm
- echo -n 'Generating array device nodes... ' >&2
- cd /dev
- if /sbin/MAKEDEV md >&2 >/dev/null; then
- echo 'done.' >&2
+ if [ -z "$2" ] && [ -s /etc/mdctl/mdctl.conf ] \
+ && [ ! -f /etc/mdadm/mdadm.conf ]; then
+ cp -a /etc/mdctl/mdctl.conf /etc/mdadm/mdadm.conf
+ fi
+
+ [ ! -f $CONFIG ] && [ -f $ALTCONFIG ] && CONFIG=$ALTCONFIG
+ if [ ! -f $CONFIG ]; then
+ echo -n 'Generating mdadm.conf... ' >&2
+ if /usr/share/mdadm/mkconf generate $CONFIG 2>/dev/null; then
+ echo done. >&2
else
- echo 'failed.' >&2
+ echo "failed (/proc probably not mounted)." >&2
+ rm -f $CONFIG
fi
- fi
-
- DEBIANCONFIG=/etc/default/mdadm
- CONFIG=/etc/mdadm/mdadm.conf
- ALTCONFIG=/etc/mdadm.conf
- MDADM=/sbin/mdadm
-
- if [ -z "$2" ] && [ -s /etc/mdctl/mdctl.conf ] \
- && [ ! -f /etc/mdadm/mdadm.conf ]; then
- cp -a /etc/mdctl/mdctl.conf /etc/mdadm/mdadm.conf
- fi
-
- if [ ! -f $CONFIG ] && [ ! -f $ALTCONFIG ]; then
- echo -n 'Generating mdadm.conf... ' >&2
- if /usr/share/mdadm/mkconf >$CONFIG 2>/dev/null; then
- md5sum $CONFIG > /var/lib/mdadm/mdadm.conf-generated
- echo done. >&2
- else
- echo "failed (/proc probably not mounted)." >&2
- rm -f $CONFIG
+ elif dpkg --compare-versions "${2:-2.5.3-1}" le 2.5.3-1; then
+ # we're upgrading from before 2.5.3-1 and there's apparently already
+ # a connfiguration file which we cannot verify. We'll use the sentinel
+ # during initramfs creation.
+ md5sum $CONFIG > /var/lib/mdadm/CONF-UNCHECKED
fi
- elif dpkg --compare-versions "${2:-2.5.3-1}" le 2.5.3-1
- # we're upgrading from before 2.5.3-1 and there's apparently already
- # a connfiguration file which we cannot verify. We'll use the sentinel
- # during initramfs creation.
- touch /var/lib/mdadm/CONF-UNCHECKED
- fi
-
- [ ! -f $CONFIG ] && CONFIG=$ALTCONFIG
-
- db_get mdadm/initrdstart
- INITRDSTART="${RET:-all}"
- db_get mdadm/autostart
- AUTOSTART="${RET:-true}"
- db_get mdadm/autocheck
- AUTOCHECK="${RET:-true}"
- db_get mdadm/start_daemon
- START_DAEMON="${RET:-true}"
- db_get mdadm/mail_to
- MAILADDR="${RET:-root}"
- cat <<_eof > $DEBIANCONFIG
+ db_get mdadm/initrdstart
+ INITRDSTART="${RET:-all}"
+ db_get mdadm/autostart
+ AUTOSTART="${RET:-true}"
+ db_get mdadm/autocheck
+ AUTOCHECK="${RET:-true}"
+ db_get mdadm/start_daemon
+ START_DAEMON="${RET:-true}"
+ db_get mdadm/mail_to
+ MAILADDR="${RET:-root}"
+
+ cat <<_eof > $DEBIANCONFIG
# mdadm Debian configuration
#
# You can run 'dpkg-reconfigure mdadm' to modify the values in this file, if
@@ -99,7 +96,7 @@ AUTOSTART=$AUTOSTART
AUTOCHECK=$AUTOCHECK
# START_DAEMON:
-# should mdadm start the RAID monitoring daemon during boot?
+# should mdadm start the MD monitoring daemon during boot?
START_DAEMON=$START_DAEMON
# MAIL_TO
@@ -115,15 +112,27 @@ START_DAEMON=$START_DAEMON
USE_DEPRECATED_MDRUN=false
_eof
- if grep -q '^MAILADDR' $CONFIG; then
- sed -i -e "s,^MAILADDR.*,MAILADDR $MAILADDR," $CONFIG
- else
- echo "MAILADDR $MAILADDR" >> $CONFIG
- fi
+ if grep -q '^MAILADDR' $CONFIG; then
+ sed -i -e "s,^MAILADDR.*,MAILADDR $MAILADDR," $CONFIG
+ else
+ echo "MAILADDR $MAILADDR" >> $CONFIG
+ fi
+
+ db_stop
- db_stop
+ command -v update-initramfs >/dev/null && update-initramfs -u -k all
+ ;;
+esac
- command -v update-initramfs >/dev/null && update-initramfs -u -k all
+# remove S04 installed as a fix to #294404 as it does not work
+# we only remove the startup links if the previous version was 1.9.0-2.1 (the
+# one with the erroneous fix) and the S04 link exists to make sure that
+# chances are minimised to overwrite admin changes (even though this would
+# not affect woody upgraders)
+if [ "${1:-}" = "configure" ] && [ "${2:-}" = "1.9.0-2.1" ] \
+ && test -L /etc/rcS.d/S04mdadm-raid;
+then
+ update-rc.d -f mdadm-raid remove
fi
# See #369953
@@ -141,17 +150,6 @@ if [ -x /etc/init.d/mdadm-raid ]; then
fi
fi
-# remove S04 installed as a fix to #294404 as it does not work
-# we only remove the startup links if the previous version was 1.9.0-2.1 (the
-# one with the erroneous fix) and the S04 link exists to make sure that
-# chances are minimised to overwrite admin changes (even though this would
-# not affect woody upgraders)
-if [ "${1:-}" = "configure" ] && [ "${2:-}" = "1.9.0-2.1" ] \
- && test -L /etc/rcS.d/S04mdadm-raid;
-then
- update-rc.d -f mdadm-raid remove
-fi
-
# try to undo udev rules (installed by 2.5.2-10, see 2.5.3-1 changelog)
# commented original install snippet included below
if false && [ "${1:-}" = "configure" ] && [ "${2:-}" = "2.5.2-10" ]; then
diff --git a/debian/mdadm.postrm b/debian/mdadm.postrm
index 0ba43cc6..01c5dc67 100644
--- a/debian/mdadm.postrm
+++ b/debian/mdadm.postrm
@@ -11,7 +11,7 @@ set -eu
case "${1:-}" in
remove)
if command -v update-initramfs >/dev/null; then
- echo "W: mdadm: I'll update the initramfs, but if you need RAID to boot" >&2
+ echo "W: mdadm: I'll update the initramfs, but if you need MD to boot" >&2
echo "W: mdadm: with initramfs, you'll be screwed!" >&2
update-initramfs -u -k all
fi
@@ -19,10 +19,11 @@ case "${1:-}" in
purge)
rm -f /etc/default/mdadm
- if [ -f /var/lib/mdadm/mdadm.conf-generated ]; then
- rm -f /etc/mdadm/mdadm.conf
+ GEN_SENTINEL=/var/lib/mdadm/mdadm.conf-generated
+ if [ -r $GEN_SENTINEL ]; then
+ rm -f "$(sed -rne 's,[[:xdigit:]]+ ,,p' $GEN_SENTINEL)"
fi
- rm -rf /var/lib/mdadm/CONF-UNCHECKED
+ rm -rf /var/lib/mdadm
;;
*) :;;
diff --git a/debian/mdadm.preinst b/debian/mdadm.preinst
index 28bcf55e..86182270 100644
--- a/debian/mdadm.preinst
+++ b/debian/mdadm.preinst
@@ -19,12 +19,13 @@ case "$1" in
fi
# save the v1 output of -Es just in case we need it for upgrades
- MDADM="$(command -v mdadm 2>/dev/null)"
- if [ -x "$MDADM" ] && dpkg --compare-versions "${2:-1}" lt 2; then
+ MDADM="$(command -v mdadm 2>/dev/null || :)"
+ if [ -x "$MDADM" ] && [ -n "${2:-}" ] && \
+ dpkg --compare-versions $2 lt 2; then
echo DEVICE partitions > /var/backups/mdadm-Es_v1.dump
- $MDADM -Esc /var/backups/mdadm-Es_v1.dump >> /var/backups/mdadm-Es_v1.dump
+ $MDADM -Esc /var/backups/mdadm-Es_v1.dump >> /var/backups/mdadm-Es_v1.dump || :
fi
- ;;
+ ;;
*) :;;
esac
diff --git a/debian/mdadm.templates b/debian/mdadm.templates
index da5d98b4..c2337a44 100644
--- a/debian/mdadm.templates
+++ b/debian/mdadm.templates
@@ -1,56 +1,73 @@
-Template: mdadm/warning
-Type: note
-_Description: Initialise the superblock if you reuse hard disks
- WARNING! If you are using hard disks which have RAID superblocks from earlier
- installations in different RAID arrays, you MUST zero each superblock
- *before* activating the autostart feature.
- .
- To do this, do not start the RAID devices automatically. First, zero the
- superblock (mdadm --zero-superblock /dev/mdX). Next, use `dpkg-reconfigure
- mdadm` to reactivate the autostart feature.
- .
- If you manage your RAIDs otherwise (e.g. EVMS), either disable autostart, or
- ensure that /etc/mdadm/mdadm.conf only lists those arrays you want to start
- by mdadm.
-
Template: mdadm/initrdstart
Type: string
Default: all
-_Description: RAID arrays needed for the root filesystem:
- If your system has its root filesystem on a RAID volume, it needs to be
+_Description: MD arrays needed for the root filesystem:
+ ${msg}
+ .
+ Please enter a space-separated list of devices, 'all', or 'none'. You may
+ omit the leading '/dev/' and just enter e.g. "md0 md1", or "md/1 md/d0".
+
+Template: mdadm/initrdstart_msg_intro
+Type: text
+_Description:
+ If your system has its root filesystem on a MD volume, it needs to be
started early during the boot sequence. If your root filesystem is on
- a logical volume (LVM), which is on RAID, all constituent arrays need to be
+ a logical volume (LVM), which is on MD, all constituent arrays need to be
started.
.
If you know exactly which arrays are needed to bring up the root filesystem,
- enter them here. Alternatively, enter 'all' to simply start all available
- arrays. If you do not need or want to start any arrays for the root
- filesystem, leave the answer blank (or enter 'none').
- .
- You have the option to start all other arrays (those not needed for the root
- filesystem) later in the boot sequence. Doing so will give you greater
- control over the arrays with the mdadm configuration file. Starting all
- arrays at boot-time may be safer though.
+ and you want to postpone starting all other arrays to a later point in the
+ boot sequence, enter the arrays to start here. Alternatively, enter 'all' to
+ simply start all available arrays. If you do not need or want to start any
+ arrays for the root filesystem, leave the answer blank (or enter 'none').
+
+Template: mdadm/initrdstart_msg_errexist
+Type: text
+_Description:
+ An error occurred: device node does not exist
+
+Template: mdadm/initrdstart_msg_errblock
+Type: text
+_Description:
+ An error occurred: not a block device
+
+Template: mdadm/initrdstart_msg_errmd
+Type: text
+_Description:
+ An error occurred: not a MD array
+
+Template: mdadm/initrdstart_msg_errconf
+Type: text
+_Description:
+ An error occurred: array not listed in mdadm.conf file
+
+Template: mdadm/initrdstart_notinconf
+Type: boolean
+Default: false
+_Description: Proceed with starting arrays not listed in mdadm.conf?
+ The array you have specified (${array}) is not listed in the configuration
+ file ${config}. Therefore it cannot be started during boot, unless you
+ correct the configuration file and recreate the initial ramdisk.
.
- Please enter a space-separated list of devices, or 'all'. You may omit the
- leading '/dev/' and just enter e.g. "md0 md1".
+ Please refer to /usr/share/doc/mdadm/README.upgrading-2.5.3 if you intend to
+ continue.
Template: mdadm/autostart
Type: boolean
Default: true
-_Description: Do you want to start RAID devices automatically?
- Once the base system has come up, mdadm can start all RAID devices specified
+_Description: Do you want to start MD devices automatically?
+ Once the base system has come up, mdadm can start all MD devices specified
in /etc/mdadm/mdadm.conf, which have not yet been started. Unless you have
- compiled RAID support into the kernel (in which case all RAID arrays with
+ compiled MD support into the kernel (in which case all MD arrays with
partitions of type 0xfd (and only those) are started automatically anyway),
this is probably what you want.
Template: mdadm/autocheck
Type: boolean
Default: true
-_Description: Should mdadm run monthly redundancy checks of the RAID arrays?
+_Description: Should mdadm run monthly redundancy checks of the MD arrays?
If your kernel supports it (>> 2.6.14), mdadm can periodically check the
- redundancy of your RAID devices. This may be a resource-intensive process,
+ redundancy of your MD devices. This may be a resource-intensive process,
depending on your setup, but it could help prevent rare cases of data loss.
Note that this is a read-only check unless errors are found; if errors are
found, mdadm will try to correct them, which may result in write access to
@@ -62,13 +79,13 @@ _Description: Should mdadm run monthly redundancy checks of the RAID arrays?
Template: mdadm/start_daemon
Type: boolean
Default: true
-_Description: Do you want to start the RAID monitoring daemon?
- The RAID monitor daemon sends email notifications in response to important
- RAID events (such as a disk failure). You probably want to enable it.
+_Description: Do you want to start the MD monitoring daemon?
+ The MD monitor daemon sends email notifications in response to important
+ MD events (such as a disk failure). You probably want to enable it.
Template: mdadm/mail_to
Type: string
Default: root
_Description: Recipient for email notifications:
Please enter the email address of the user who should get the email
- notification for these important RAID events.
+ notification for these important MD events.
diff --git a/debian/mkconf b/debian/mkconf
index 3f59317e..eb661f1a 100644
--- a/debian/mkconf
+++ b/debian/mkconf
@@ -20,21 +20,67 @@ fi
test -f $DEBIANCONFIG && . $DEBIANCONFIG
+generate=0
+CONFIG=/etc/mdadm/mdadm.conf
+[ "${1:-}" = force-generate ] && rm -f $CONFIG
+case "${1:-}" in
+ generate|force-generate)
+ [ -n "${2:-}" ] && CONFIG=$2
+ if [ -e $CONFIG ]; then
+ echo "E: ${##*/}: $CONFIG already exists." >&2
+ exit 3
+ fi
+
+ mkdir --parent ${CONFIG%/*}
+ exec >$CONFIG
+ generate=1
+ ;;
+esac
+
+cat <<_eof
+# mdadm.conf
+#
+# This file was auto-generated on $(date -R)
+# by mkconf \$Id$
+#
+# Please refer to mdadm.conf(5) for information about this file.
+#
+
+_eof
+
if [ -r /proc/partitions ]; then
- echo DEVICE partitions
+ cat <<_eof
+# scan all partitions (/proc/partitions) for MD superblocks"
+DEVICE partitions
+
+_eof
else
echo E: cannot read /proc/partitions and thus cannot do my magic. >&2
exit 1
fi
-echo CREATE owner=root group=disk mode=0660 auto=yes metadata=1
-echo HOMEHOST '<system>'
-echo MAILADDR root
+cat <<_eof
+# auto-create devices with Debian standard permissions and v1 superblocks
+CREATE owner=root group=disk mode=0660 auto=yes metadata=1
+
+# automatically tag new arrays as belonging to the local system
+HOMEHOST <system>
+
+# instruct the monitoring daemon to send mail alerts to root
+MAILADDR root
+
+_eof
if [ ! -r /proc/mdstat ]; then
- echo W: RAID subsystem is not loaded, thus I cannot scan for arrays. >&2
+ echo W: MD subsystem is not loaded, thus I cannot scan for arrays. >&2
else
+ echo "# definitions of existing MD arrays"
$MDADM --examine --scan --config=partitions
fi
+if [ $generate -eq 1 ]; then
+ mkdir -p /var/lib/mdadm
+ md5sum $CONFIG > /var/lib/mdadm/mdadm.conf-generated
+fi
+
exit 0
diff --git a/debian/rules b/debian/rules
index c2c3f9d3..fccb4dca 100755
--- a/debian/rules
+++ b/debian/rules
@@ -83,7 +83,7 @@ install: build
install -m0755 debian/mkconf $(DESTDIR)/usr/share/mdadm
install -m0755 debian/checkarray $(DESTDIR)/usr/share/mdadm
install -m0755 debian/bugscript $(DESTDIR)/usr/share/bug/mdadm/script
- install -m0755 debian/mdadm-name-generator.sh $(DESTDIR)/lib/udev
+# install -m0755 debian/mdadm-name-generator.sh $(DESTDIR)/lib/udev
install -m0644 debian/mdadm.lintian-overrides \
$(DESTDIR)/usr/share/lintian/overrides/mdadm
@@ -102,7 +102,7 @@ binary-arch: build install
dh_installcron
dh_installchangelogs ChangeLog
dh_installlogcheck
- dh_installudev
+# dh_installudev
dh_strip
dh_compress
dh_fixperms