mdadm doesn't start array with external bitmap

Bug #803737 reported by Andrey
18
This bug affects 4 people
Affects Status Importance Assigned to Milestone
mdadm
New
Undecided
Unassigned
mdadm (Debian)
Fix Released
Unknown
mdadm (Ubuntu)
Confirmed
Undecided
Unassigned

Bug Description

hi, all!

i've just created a raid5 array with mdadm:
root@nas:~# cat /proc/mdstat
Personalities : [linear] [multipath] [raid0] [raid1] [raid6] [raid5] [raid4] [raid10]
md0 : active raid5 sdf1[5] sde1[3] sdd1[2] sdc1[1] sdb1[0]
      7814047744 blocks super 1.2 level 5, 512k chunk, algorithm 2 [5/5] [UUUUU]
      bitmap: 0/466 pages [0KB], 2048KB chunk, file: /var/md0_wr_intent

unused devices: <none>

root@nas:~# mdadm --detail --scan
ARRAY /dev/md/0 metadata=1.2 bitmap=/var/md0_wr_intent name=nas:0 UUID=6b03bf85:5d6c5d4e:782f3370:ae7fbb89

root@nas:~# mdadm --detail --scan >> /etc/mdadm/mdadm.conf
root@nas:~# update-initramfs -k all -u

but after reboot i get te following:

root@nas:~# cat /proc/mdstat
Personalities : [linear] [multipath] [raid0] [raid1] [raid6] [raid5] [raid4] [raid10]
md0 : inactive sdf1[5](S) sde1[3](S) sdd1[2](S) sdc1[1](S) sdb1[0](S)
      9767562680 blocks super 1.2

unused devices: <none>

if i issue mdadm --stop /dev/md0 and mdadm --assemble --scan, it assembles as desired!

root@nas:~# cat /proc/mdstat
Personalities : [linear] [multipath] [raid0] [raid1] [raid6] [raid5] [raid4] [raid10]
md0 : active raid5 sdb1[0] sdf1[5] sde1[3] sdd1[2] sdc1[1]
      7814047744 blocks super 1.2 level 5, 512k chunk, algorithm 2 [5/5] [UUUUU]
      bitmap: 0/466 pages [0KB], 2048KB chunk, file: /var/md0_wr_intent

unused devices: <none>

and if i remove bitmap= option from mdadm.conf, array starts normally on boot.
array also starts okay with auto detection (if i remove ARRAY line from mdadm.conf), but with internal bitmap
/var is located on rootfs, not a separate partition

root@nas:~# lsb_release -rd
Description: Ubuntu 11.04
Release: 11.04
root@nas:~# apt-cache policy mdadm
mdadm:
  Installed: 3.1.4-1+8efb9d1ubuntu4.1
  Candidate: 3.1.4-1+8efb9d1ubuntu4.1
  Version table:
 *** 3.1.4-1+8efb9d1ubuntu4.1 0
        500 http://ru.archive.ubuntu.com/ubuntu/ natty-updates/main i386 Packages
        100 /var/lib/dpkg/status
     3.1.4-1+8efb9d1ubuntu4 0
        500 http://ru.archive.ubuntu.com/ubuntu/ natty/main i386 Packages

any glue how to set external bitmap without breaking things?
Thanks in advance!

Revision history for this message
Andrey (aol-nnov) wrote :

seems like rootfs is not yet available during raid assembly.

any ideas?

Changed in mdadm (Debian):
status: Unknown → Fix Released
Revision history for this message
Andrey (aol-nnov) wrote :

i ended up with the following solution:

as i have the only one array and it is not used for system boot, i've added AUTO -all to the /etc/mdadm/mdadm.conf

and created the file /etc/init/mounted-root.conf
mgr@nas:~$ cat /etc/init/mounted-root.conf

description "assemble MD with external bitmap"

start on mounted MOUNTPOINT=/
env MOUNTPOINT=/

task

script
 mdadm --stop /dev/md0
 mdadm --assemble --scan
end script

after that array assembles correctly with external bitmap on boot.

i'm not sure about the correctness of the solution, so, please comment!

Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in mdadm (Ubuntu):
status: New → Confirmed
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.