Merge lp:~csurbhi/mdadm/mdadm-fix.728435 into lp:~ubuntu-core-dev/mdadm/ubuntu

Proposed by Surbhi Palande
Status: Merged
Merged at revision: 6
Proposed branch: lp:~csurbhi/mdadm/mdadm-fix.728435
Merge into: lp:~ubuntu-core-dev/mdadm/ubuntu
Diff against target: 43 lines (+20/-3)
2 files modified
debian/changelog (+12/-0)
debian/initramfs/init-premount (+8/-3)
To merge this branch: bzr merge lp:~csurbhi/mdadm/mdadm-fix.728435
Reviewer Review Type Date Requested Status
Colin Watson Approve
Review via email: mp+54011@code.launchpad.net

Description of the change

The udev rule for mdadm uses incremental mode to create an array and/or to add member disks to it. The correct way to start such a partially assembled array in degraded is to use the Incremental mode. So, adding the " mdadm --incremental --scan --run " to the mdadm/mountroot_failure().

Previously mdadm --assemble --scan --run worked because the arrays were stopped before scan assembling them. Assemble scan mode is good for assembling arrays not created by Incremental mode, when member disks unassociated with any array are available for assembling a *new* array. So keeping the "mdadm --assemble --scan --run" for assembling arrays which were not partially created by Incremental mode. We should ideally not land in a situation where the arrays were not incrementally created. However, should we do (due to udevd failure say), then mdadm --assemble scan will never the less assemble a new array.

Please consider this change for natty.

To post a comment you must log in.
Revision history for this message
Colin Watson (cjwatson) wrote :

Thanks for your contribution to Ubuntu!

I've updated lp:~ubuntu-core-dev/mdadm/ubuntu to match the current archive. Please could you merge from that branch, resolve any changelog conflicts, and then re-push to lp:~csurbhi/mdadm/mdadm-fix.728435? (You don't need to file a new merge proposal - this one will update automatically.)

Secondly, patch files in debian/patches/ should only be used when patching upstream source code. When changing files in debian/, you should just change them directly rather than with a patch file. In this case, you should just be able to undo your changes to debian/patches/, since your branch already changes debian/initramfs/init-premount as well.

Finally, there are some confusing typos in the changelog - according to mdadm(8), -r is short for --remove while -R is short for --run. As such, I think the two mentions of -Ars should be corrected to -ARs, while the mention of -Irs should be corrected to -IRs.

review: Needs Fixing
lp:~csurbhi/mdadm/mdadm-fix.728435 updated
6. By Surbhi Palande

mdadm udev rule incrementally adds mdadm member when detected. Starting
such an array in degraded mode is possible by mdadm -IRs. Using mdadm -ARs
without stopping the array first does nothing when no mdarray-unassociated
device is available. Using mdadm -IRs to start a previously partially
assembled array through incremental mode. Keeping the mdadm -ARs for
assembling arrays which were for some reason not assembled through
incremental mode (i.e through mdadm's udev rule). (LP: #728435)

Revision history for this message
Colin Watson (cjwatson) wrote :

Thanks for the fixes!

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'debian/changelog'
2--- debian/changelog 2011-02-20 18:17:41 +0000
3+++ debian/changelog 2011-03-23 16:34:26 +0000
4@@ -1,3 +1,15 @@
5+mdadm (3.1.4-1+8efb9d1ubuntu4) maverick; urgency=low
6+
7+ * mdadm udev rule incrementally adds mdadm member when detected. Starting
8+ such an array in degraded mode is possible by mdadm -IRs. Using mdadm -ARs
9+ without stopping the array first does nothing when no mdarray-unassociated
10+ device is available. Using mdadm -IRs to start a previously partially
11+ assembled array through incremental mode. Keeping the mdadm -ARs for
12+ assembling arrays which were for some reason not assembled through
13+ incremental mode (i.e through mdadm's udev rule). (LP: #728435)
14+
15+ -- Surbhi Palande <surbhi.palande@canonical.com> Wed, 23 Mar 2011 18:28:55 +0200
16+
17 mdadm (3.1.4-1+8efb9d1ubuntu3) natty; urgency=low
18
19 * Build udeb with -O2 on ppc64, working around a link error.
20
21=== modified file 'debian/initramfs/init-premount'
22--- debian/initramfs/init-premount 2010-10-19 14:12:13 +0000
23+++ debian/initramfs/init-premount 2011-03-23 16:34:26 +0000
24@@ -70,11 +70,16 @@
25 fi
26 if [ "$BOOT_DEGRADED" = "true" ]; then
27 echo "Attempting to start the RAID in degraded mode..."
28- if mdadm --assemble --scan --run; then
29+ if mdadm --incremental --run --scan; then
30 echo "Started the RAID in degraded mode."
31 exit 0
32- else
33- echo "Could not start the RAID in degraded mode."
34+ else
35+ if mdadm --assemble --scan --run; then
36+ echo "Started the RAID in degraded mode."
37+ exit 0
38+ else
39+ echo "Could not start the RAID in degraded mode."
40+ fi
41 fi
42 fi
43 fi

Subscribers

People subscribed via source and target branches