Subject: Debian mdadm not using upstream DEVICE line in mdadm.conf
Package: mdadm
Version: 3.1.4-1+8efb9d1
Severity: normal
Tags: upstream
*** Please type your report below this line ***
As pointed out to me by Neil Brown the default DEVICE line generated by the
Debian mdadm package in the mdadm.conf file is simply:
DEVICE partitions
When the DEVICE line is commented out, the mdadm default (in both upstream and
Debian's mdadm) is the same behaviour as:
DEVICE partitions containers
The advantage of this behaviour is that if the hard disk in the array have the
partition type 8e for use as a physical LVM partition, then the array is both
brought up and built, where as with a DEVICE line only containing partitions
would require the incremental command to bring up the LVM, for example:
mdadm -I /dev/md/imsm0
This discovery was made through the mailing lists of debian-user and
[email protected] as part of the thread at:
http://lists.debian.org/debian-user/2010/11/msg01547.html
I propose that the initial mdadm.conf generated setup file (by mkconf)be
changed to either use the DEVICE line:
DEVICE partitions containers
or
#DEVICE partitions containers
As this seems to be the default when the line is completed commented out
anyways.
-- Package-specific info:
--- mdadm.conf
DEVICE partitions
CREATE owner=root group=disk mode=0660 auto=yes
HOMEHOST <system>
MAILADDR root
--- /etc/default/mdadm
INITRDSTART='all'
AUTOSTART=true
AUTOCHECK=true
START_DAEMON=true
DAEMON_OPTIONS="--syslog"
VERBOSE=false
-- System Information:
Debian Release: squeeze/sid
APT prefers testing
APT policy: (500, 'testing')
Architecture: amd64 (x86_64)
Kernel: Linux 2.6.32-5-xen-amd64 (SMP w/2 CPU cores)
Locale: LANG=en_CA.utf8, LC_CTYPE=en_CA.utf8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Versions of packages mdadm depends on:
ii debconf 1.5.36 Debian configuration management sy
ii libc6 2.11.2-7 Embedded GNU C Library: Shared lib
ii lsb-base 3.2-23.1 Linux Standard Base 3.2 init scrip
ii udev 164-2 /dev/ and hotplug management daemo
Versions of packages mdadm recommends:
ii exim4-daemon-light [mail-tran 4.72-2 lightweight Exim MTA (v4) daemon
ii module-init-tools 3.12-1 tools for managing Linux kernel mo
mdadm suggests no packages.
-- debconf information:
mdadm/initrdstart_msg_errexist:
mdadm/initrdstart_msg_intro:
mdadm/autostart: true
mdadm/autocheck: true
mdadm/initrdstart_msg_errblock:
mdadm/mail_to: root
mdadm/initrdstart_msg_errmd:
* mdadm/initrdstart: all
mdadm/initrdstart_msg_errconf:
mdadm/initrdstart_notinconf: false
mdadm/start_daemon: true
------------------------------------------------------------------
Working configuration with DEVICE commented out:
cat /etc/mdadm/mdadm.conf
# mdadm.conf
#
# Please refer to mdadm.conf(5) for information about this file.
#
# by default, scan all partitions (/proc/partitions) for MD superblocks.
# alternatively, specify devices to scan, using wildcards if desired.
#DEVICE partitions
# auto-create devices with Debian standard permissions
CREATE owner=root group=disk mode=0660 auto=yes
# automatically tag new arrays as belonging to the local system
HOMEHOST <system>
# instruct the monitoring daemon where to send mail alerts
MAILADDR root
# definitions of existing MD arrays
ARRAY metadata=imsm UUID=084b969a:0808f5b8:6c784fb7:62659383
ARRAY /dev/md/OneTB-RAID1-PV container=084b969a:0808f5b8:6c784fb7:62659383
member=0 UUID=ae4a1598:72267ed7:3b34867b:9c56497a
# This file was auto-generated on Fri, 05 Nov 2010 16:29:48 -0400
# by mkconf 3.1.4-1+8efb9d1
dpkg-reconfigure mdadm
If the system's root file system is located on an MD array (RAID), it
needs to be started early during the boot sequence. If it is located on
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 file
system, 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 file system,
leave the answer blank (or enter 'none'). This may be the case if you
are using kernel autostart or do not need any arrays to boot.
âââââââââââââ⤠Configuring mdadm
ââââââââââââââ
â MD arrays needed for the root file system: â
â â
â all________________________________________ â
â â
â <Ok> â
â â
âââââââââââââââââââââââââââââââââââââââââââââââ
ââââââââââââââââââââââââââââ¤
Configuring mdadm
âââââââââââââââââââââââââââââ
â
â
â If the kernel supports it (versions greater than 2.6.14), mdadm can
â
â periodically check the redundancy of MD arrays (RAIDs). This may be a
â
â resource-intensive process, depending on the local 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 the media.
â
â
â
â The default, if turned on, is to check on the first Sunday of every
â
â month at 01:06.
â
â
â
â Should mdadm run monthly redundancy checks of the MD arrays?
â
â
â
â <Yes> <No>
â
â
â
ââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââ
YES
ââââââââââââââââââââââââââââ¤
Configuring mdadm
ââââââââââââââââââââââââââââ
â â
â The MD (RAID) monitor daemon sends email notifications in response to â
â important MD events (such as a disk failure). â
â â
â Enabling this option is recommended. â
â â
â Do you want to start the MD monitoring daemon? â
â â
â <Yes> <No> â
â â
âââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââ
YES
âââââââââââââââââââââââââââ¤
Configuring mdadm
âââââââââââââââââââââââââââ
â Please enter the email address of the user who should get the email
â
â notifications for important MD events.
â
â
â
â Recipient for email notifications:
â
â
â
â root_________________________________________________________________
â
â
â
â <Ok>
â
â
â
âââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââ
-----------------------------------------------------
This DEFAULT configuarition spits out a configuration like below:
# mdadm.conf
#
# Please refer to mdadm.conf(5) for information about this file.
#
# by default, scan all partitions (/proc/partitions) for MD superblocks.
# alternatively, specify devices to scan, using wildcards if desired.
DEVICE partitions
# auto-create devices with Debian standard permissions
CREATE owner=root group=disk mode=0660 auto=yes
# automatically tag new arrays as belonging to the local system
HOMEHOST <system>
# instruct the monitoring daemon where to send mail alerts
MAILADDR root
# definitions of existing MD arrays
# This file was auto-generated on Tue, 23 Nov 2010 10:00:13 -0500
# by mkconf 3.1.4-1+8efb9d1
----------------------------------------------------
If the hard disk in the array have the partition type 8e for use as a physical
LVM partition, then the array is both brought up and built, where as with a
DEVICE line only containing partitions would require the incremental command
to bring up the LVM, for example:
mdadm -I /dev/md/imsm0
-----------------------------------------------------
After either commenting out the DEVICE line or changing it to
DEVICE partitions containers mdadm -As was able to automatically
bring up the physical LVM on the RAID array.
-----------------------------------------------------
mdadm -Asvv
mdadm: looking for devices for further assembly
mdadm: no RAID superblock on /dev/dm-3
mdadm: /dev/dm-3 has wrong uuid.
mdadm: no RAID superblock on /dev/dm-2
mdadm: /dev/dm-2 has wrong uuid.
mdadm: no RAID superblock on /dev/dm-1
mdadm: /dev/dm-1 has wrong uuid.
mdadm: no RAID superblock on /dev/dm-0
mdadm: /dev/dm-0 has wrong uuid.
mdadm: no RAID superblock on /dev/loop0
mdadm: /dev/loop0 has wrong uuid.
mdadm: cannot open device /dev/sdc7: Device or resource busy
mdadm: /dev/sdc7 has wrong uuid.
mdadm: cannot open device /dev/sdc6: Device or resource busy
mdadm: /dev/sdc6 has wrong uuid.
mdadm: cannot open device /dev/sdc5: Device or resource busy
mdadm: /dev/sdc5 has wrong uuid.
mdadm: no RAID superblock on /dev/sdc2
mdadm: /dev/sdc2 has wrong uuid.
mdadm: cannot open device /dev/sdc1: Device or resource busy
mdadm: /dev/sdc1 has wrong uuid.
mdadm: cannot open device /dev/sdc: Device or resource busy
mdadm: /dev/sdc has wrong uuid.
mdadm: /dev/sdb is identified as a member of /dev/md/imsm0, slot -1.
mdadm: /dev/sda is identified as a member of /dev/md/imsm0, slot -1.
mdadm: added /dev/sda to /dev/md/imsm0 as -1
mdadm: added /dev/sdb to /dev/md/imsm0 as -1
mdadm: Container /dev/md/imsm0 has been assembled with 2 drives
mdadm: looking for devices for /dev/md/OneTB-RAID1-PV
mdadm: no recogniseable superblock on /dev/dm-3
mdadm/dev/dm-3 is not a container, and one is required.
mdadm: no recogniseable superblock on /dev/dm-2
mdadm/dev/dm-2 is not a container, and one is required.
mdadm: no recogniseable superblock on /dev/dm-1
mdadm/dev/dm-1 is not a container, and one is required.
mdadm: no recogniseable superblock on /dev/dm-0
mdadm/dev/dm-0 is not a container, and one is required.
mdadm: no recogniseable superblock on /dev/loop0
mdadm/dev/loop0 is not a container, and one is required.
mdadm: cannot open device /dev/sdc7: Device or resource busy
mdadm/dev/sdc7 is not a container, and one is required.
mdadm: cannot open device /dev/sdc6: Device or resource busy
mdadm/dev/sdc6 is not a container, and one is required.
mdadm: cannot open device /dev/sdc5: Device or resource busy
mdadm/dev/sdc5 is not a container, and one is required.
mdadm: no recogniseable superblock on /dev/sdc2
mdadm/dev/sdc2 is not a container, and one is required.
mdadm: cannot open device /dev/sdc1: Device or resource busy
mdadm/dev/sdc1 is not a container, and one is required.
mdadm: cannot open device /dev/sdc: Device or resource busy
mdadm/dev/sdc is not a container, and one is required.
mdadm: cannot open device /dev/sdb: Device or resource busy
mdadm/dev/sdb is not a container, and one is required.
mdadm: cannot open device /dev/sda: Device or resource busy
mdadm/dev/sda is not a container, and one is required.
mdadm: looking in container /dev/md127
mdadm: found match on member /md127/0 in /dev/md127
mdadm: Started /dev/md/OneTB-RAID1-PV with 2 devices
ls -al /dev/md/
total 0
drwxr-xr-x 2 root root 80 Nov 23 09:47 .
drwxr-xr-x 21 root root 3480 Nov 23 09:47 ..
lrwxrwxrwx 1 root root 8 Nov 23 09:47 imsm0 -> ../md127
lrwxrwxrwx 1 root root 8 Nov 23 09:47 OneTB-RAID1-PV -> ../md126