mdadm does not add spares to arrays on boot
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
initramfs-tools |
Fix Released
|
Undecided
|
Unassigned | ||
mdadm (Ubuntu) |
Invalid
|
Undecided
|
Unassigned |
Bug Description
Binary package hint: mdadm
After rebooting my server, spares are not automatically re-inserted into my RAID5 and RAID1 arrays.
I was able to get the above to work correctly by explicitly telling mdadm which partitions to scan:
# extract from /etc/mdadm/
#DEVICE partitions
DEVICE /dev/sd[abcdef][12]
I think that this should work properly also in the case of "DEVICE partitions".
Some information about my system below, followed by detailed disk and md configs.
root@via:~# apt-cache show mdadm
Package: mdadm
Priority: optional
Section: admin
Installed-Size: 612
Maintainer: Ubuntu Core Developers <email address hidden>
Original-
Architecture: i386
Version: 2.6.2-1ubuntu2
Replaces: mdctl
Depends: libc6 (>= 2.6), makedev, debconf (>= 0.5) | debconf-2.0, lsb-base (>= 3.1-6), udev (>= 113-0ubuntu1), initramfs-tools (>> 0.85eubuntu11), debconf (>= 1.4.72)
Recommends: mail-transport-
Conflicts: mdctl (<< 0.7.2), raidtools2 (<< 1.00.3-12.1)
Filename: pool/main/
Size: 219708
MD5sum: 67dc0977d581821
SHA1: adcf0faafc84a24
SHA256: 8a44014791a370f
Description: tool to administer Linux MD arrays (software RAID)
mdadm is a program that can be used to create, manage, and monitor MD
arrays (e.g. software RAID, multipath devices).
.
This package automatically configures mdadm to assemble arrays during the
system startup process. If not needed, this functionally can be disabled.
Bugs: mailto:<email address hidden>
Origin: Ubuntu
root@via:~# lsb_release -rd
Description: Ubuntu 7.10
Release: 7.10
root@via:~# cat /etc/mdadm/
# 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
DEVICE /dev/sd[abcdef][12]
# 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 /dev/md0 level=raid1 num-devices=2 spares=1 UUID=19e69537:
ARRAY /dev/md1 level=raid1 num-devices=2 spares=1 UUID=5e728621:
ARRAY /dev/md2 level=raid5 num-devices=4 spares=1 UUID=714e46f1:
# This file was auto-generated on Fri, 22 Jun 2007 19:12:10 +0000
# by mkconf $Id: mkconf 261 2006-11-09 13:32:35Z madduck $
MAILFROM <email address hidden>
root@via:~# sfdisk -l /dev/sda
Disk /dev/sda: 38913 cylinders, 255 heads, 63 sectors/track
Units = cylinders of 8225280 bytes, blocks of 1024 bytes, counting from 0
Device Boot Start End #cyls #blocks Id System
/dev/sda1 0+ 121 122- 979933+ fd Linux raid autodetect
/dev/sda2 122 38912 38791 311588707+ fd Linux raid autodetect
/dev/sda3 0 - 0 0 0 Empty
/dev/sda4 0 - 0 0 0 Empty
root@via:~# sfdisk -l /dev/sdb
Disk /dev/sdb: 38913 cylinders, 255 heads, 63 sectors/track
Units = cylinders of 8225280 bytes, blocks of 1024 bytes, counting from 0
Device Boot Start End #cyls #blocks Id System
/dev/sdb1 0+ 121 122- 979933+ fd Linux raid autodetect
/dev/sdb2 122 38912 38791 311588707+ fd Linux raid autodetect
/dev/sdb3 0 - 0 0 0 Empty
/dev/sdb4 0 - 0 0 0 Empty
root@via:~# sfdisk -l /dev/sdc
Disk /dev/sdc: 38913 cylinders, 255 heads, 63 sectors/track
Units = cylinders of 8225280 bytes, blocks of 1024 bytes, counting from 0
Device Boot Start End #cyls #blocks Id System
/dev/sdc1 0+ 121 122- 979933+ fd Linux raid autodetect
/dev/sdc2 122 38912 38791 311588707+ fd Linux raid autodetect
/dev/sdc3 0 - 0 0 0 Empty
/dev/sdc4 0 - 0 0 0 Empty
root@via:~# sfdisk -l /dev/sdd
Disk /dev/sdd: 38913 cylinders, 255 heads, 63 sectors/track
Units = cylinders of 8225280 bytes, blocks of 1024 bytes, counting from 0
Device Boot Start End #cyls #blocks Id System
/dev/sdd1 0+ 121 122- 979933+ fd Linux raid autodetect
/dev/sdd2 122 38912 38791 311588707+ fd Linux raid autodetect
/dev/sdd3 0 - 0 0 0 Empty
/dev/sdd4 0 - 0 0 0 Empty
root@via:~# sfdisk -l /dev/sde
Disk /dev/sde: 60801 cylinders, 255 heads, 63 sectors/track
Units = cylinders of 8225280 bytes, blocks of 1024 bytes, counting from 0
Device Boot Start End #cyls #blocks Id System
/dev/sde1 0+ 60800 60801- 488384001 83 Linux
/dev/sde2 0 - 0 0 0 Empty
/dev/sde3 0 - 0 0 0 Empty
/dev/sde4 0 - 0 0 0 Empty
root@via:~# sfdisk -l /dev/sdf
Disk /dev/sdf: 60801 cylinders, 255 heads, 63 sectors/track
Units = cylinders of 8225280 bytes, blocks of 1024 bytes, counting from 0
Device Boot Start End #cyls #blocks Id System
/dev/sdf1 0+ 121 122- 979933+ fd Linux raid autodetect
/dev/sdf2 122 38912 38791 311588707+ fd Linux raid autodetect
/dev/sdf3 38913 60800 21888 175815360 83 Linux
/dev/sdf4 0 - 0 0 0 Empty
root@via:~# mdadm --detail /dev/md0
/dev/md0:
Version : 00.90.03
Creation Time : Fri Jun 22 20:56:08 2007
Raid Level : raid1
Array Size : 979840 (957.04 MiB 1003.36 MB)
Used Dev Size : 979840 (957.04 MiB 1003.36 MB)
Raid Devices : 2
Total Devices : 3
Preferred Minor : 0
Persistence : Superblock is persistent
Update Time : Sun Jul 27 18:18:46 2008
State : clean
Active Devices : 2
Working Devices : 3
Failed Devices : 0
Spare Devices : 1
UUID : 19e69537:
Events : 0.52
Number Major Minor RaidDevice State
0 8 1 0 active sync /dev/sda1
1 8 33 1 active sync /dev/sdc1
2 8 81 - spare /dev/sdf1
root@via:~# mdadm --detail /dev/md1
/dev/md1:
Version : 00.90.03
Creation Time : Fri Jun 22 20:56:31 2007
Raid Level : raid1
Array Size : 979840 (957.04 MiB 1003.36 MB)
Used Dev Size : 979840 (957.04 MiB 1003.36 MB)
Raid Devices : 2
Total Devices : 2
Preferred Minor : 1
Persistence : Superblock is persistent
Update Time : Sun Jul 27 18:51:38 2008
State : clean
Active Devices : 2
Working Devices : 2
Failed Devices : 0
Spare Devices : 0
UUID : 5e728621:
Events : 0.54
Number Major Minor RaidDevice State
0 8 17 0 active sync /dev/sdb1
1 8 49 1 active sync /dev/sdd1
root@via:~# mdadm --detail /dev/md2
/dev/md2:
Version : 00.90.03
Creation Time : Fri Jun 22 20:56:51 2007
Raid Level : raid5
Array Size : 934765824 (891.46 GiB 957.20 GB)
Used Dev Size : 311588608 (297.15 GiB 319.07 GB)
Raid Devices : 4
Total Devices : 5
Preferred Minor : 2
Persistence : Superblock is persistent
Update Time : Sun Jul 27 19:07:06 2008
State : clean
Active Devices : 4
Working Devices : 5
Failed Devices : 0
Spare Devices : 1
Layout : left-symmetric
Chunk Size : 64K
UUID : 714e46f1:
Events : 0.13760
Number Major Minor RaidDevice State
0 8 2 0 active sync /dev/sda2
1 8 18 1 active sync /dev/sdb2
2 8 34 2 active sync /dev/sdc2
3 8 50 3 active sync /dev/sdd2
4 8 82 - spare /dev/sdf2
root@via:~# mount
/dev/hda5 on / type ext3 (rw,noatime,
proc on /proc type proc (rw,noexec,
/sys on /sys type sysfs (rw,noexec,
varrun on /var/run type tmpfs (rw,noexec,
varlock on /var/lock type tmpfs (rw,noexec,
udev on /dev type tmpfs (rw,mode=0755)
devshm on /dev/shm type tmpfs (rw,size=102400000)
devpts on /dev/pts type devpts (rw,gid=5,mode=620)
lrm on /lib/modules/
/dev/hda1 on /boot type ext3 (rw,noatime,
/dev/md2 on /raid5 type ext3 (rw)
none on /sys/kernel/config type configfs (rw)
nfsd on /proc/fs/nfsd type nfsd (rw)
binfmt_misc on /proc/sys/
I can confirm this problem on Ubuntu Server 8.04. I have the same RAID5 configuration as the reporter (4 active disks, 1 spare).
In my case the spare isn't added to the array on boot no matter what changes are made to mdadm.conf. Stating the devices explicitly doesn't help.
$ cat /etc/mdadm/ mdadm.conf 1abc675c: 6e03419f: 9b214e6e
[snip]
DEVICE partitions
[snip]
ARRAY /dev/md0 level=raid5 num-devices=4 spares=1 UUID=d7ae6761:
$ sudo mdadm --detail --scan 1abc675c: 6e03419f: 9b214e6e
ARRAY /dev/md0 level=raid5 num-devices=4 spares=1 UUID=d7ae6761:
$ cat /proc/mdstat
Personalities : [linear] [multipath] [raid0] [raid1] [raid6] [raid5] [raid4] [raid10]
md0 : active raid5 sdf1[4](S) sda1[0] sdd1[3] sdc1[2] sdb1[1]
2197715712 blocks level 5, 64k chunk, algorithm 2 [4/4] [UUUU]
unused devices: <none>
$ sudo mdadm --detail /dev/md0
/dev/md0:
Version : 00.90.03
Creation Time : Thu Aug 9 15:29:00 2007
Raid Level : raid5
Array Size : 2197715712 (2095.91 GiB 2250.46 GB)
Used Dev Size : 732571904 (698.64 GiB 750.15 GB)
Raid Devices : 4
Total Devices : 5
Preferred Minor : 0
Persistence : Superblock is persistent
Update Time : Fri Nov 28 15:06:38 2008
State : clean
Active Devices : 4
Working Devices : 5
Failed Devices : 0
Spare Devices : 1
Layout : left-symmetric
Chunk Size : 64K
UUID : d7ae6761: 1abc675c: 6e03419f: 9b214e6e
Events : 0.76
Number Major Minor RaidDevice State
0 8 1 0 active sync /dev/sda1
1 8 17 1 active sync /dev/sdb1
2 8 33 2 active sync /dev/sdc1
3 8 49 3 active sync /dev/sdd1
4 8 81 - spare /dev/sdf1