Comment 45 for bug 136252

Surbhi Palande (csurbhi) wrote :

Call for testing mdadm 2.7.1 autoassembly.

For hitherto Ubuntu releases the mdadm package shall stay at 2.7.1 However Natty would have mdadm at 3.4.1. This document is intended to test the mdadm fixes for 2.7.1. Here is the rough procedure that needs to be followed:

Testing auto-assembly of your md array when your rootfs lies on it:
1) Install the mdadm package and initramfs package kept at:
2) Run /usr/share/mdadm/mkconf and ensure that your /etc/mdadm/mdadm.conf has the array definition.
a) Save your original initramfs in /boot itself by say /boot/initrd-old.img.
b) Then run update-initramfs -c -k <your-kernel-version>. Store this iniramfs as /boot/initrd-new.img. We shall use this initramfs as a safety net. If you cannot boot with the auto-assembly fixes, then you should not land in a foot in your mouth situation. Through grub's edit menu, you can then resort to this safety net by editing the initrd=initrd-new.img (or if this does not work for some random reason then resort back to your older initrd=initrd-old.img) This way you will be sure that you can still boot your precious system.
c) Now comment or remove the ARRAY definitions from your /etc/mdadm/mdadm.conf and once again run the same “update-initramfs -c -k <your-kernel-version>” to generate a brand new initramfs.
3)Run mdadm –detail –scan and note the UUIDs in the array. Note the hostname stored in your array. Does it not match with your real hostname? Then we can fix that at the initramfs prompt that you inevitably will land at if you try auto-assembly. Also note the device components that form the root md-device. Keep this paper for cross checking when you reboot
5)If you are at the initramfs prompt here are the things that you should first ensure:
a) ls /bin/hostname /etc/hostname - are these files present?
b) run “hostname”. Does this show you the hostname that your system is intended to have? Is it the same as the contents of /etc/hostname.
c) ls /var/run – Is this dir there?
If you answer yes to the above three questions, then things are so far so good. Now run the following command:
mdadm –assemble -U uuid /dev/<md-name> <dev-components-listed here>
Your mdadm –detail –scan that you ran previously should have given you the component names if you dont know it right now. Hopefully you have them listed on your paper.
Eg in my case I ran:
mdadm –assemble -U uuid /dev/md0 /dev/sda1 /dev/sdb1
Again run:
mdadm –detail –scan <md-device> and verify that the uuids are indeed updated and the hostname reflects the hostname that is stored /etc/hostname. You can now press Ctr+D and you should come back to the root prompt. However you still need to test auto-assembly of your root md device. To do that simple reboot and you should not see the face of initramfs this time. You should land gently on your root prompt as you expected. If you do not see the light of the rootfs prompt this way or using this initramfs, then as mentioned earlier, please avail your saved initrd images through grub. Skip the further steps in this case. Update the launchpad bugs, saying you could not get to the root prompt with manual assembly as well. First we need to get manual assembly fixed for you before worrying about auto-assembly. But hopefully this wont be the case.
6)If in the first place your uuid matched with that of the hostname, because you already had updated the array meta data with the -U uuid command, then with these packages, ideally, you should directly see the root prompt without any problem.
7)If either way, you still see initramfs and are not seeing the root prompt, then kindly upload the following on the this launchpad bug:
a) output of /var/run/
b) output of /proc/mdstat.
c) output of hostname (in initramfs)
d) output of mdadm –detail –scan <root-md-device> (once you have assembled the array manually and have got at the root prompt)
In order to save this output when you are the initramfs prompt you should copy these files in /dev/ and then manually assemble your array. Once you get to the root prompt, you would find these files in /dev/. Please attach these to the launchpad bugs and we can start debugging from there.

For auto-assembly of your non root devices, this should not bring you to initramfs, unless you have the device mounted with a fs using fstab and are not using “nobootwait” in the options section for your fs. Once you are in the root fs, and your non -root array is not up with auto-assembly, then you can very easily attach the output of the /var/run/ and /proc/mdstat. If needed, I will also post a mdadm package which will output a lot of verbose information, to find out what is exactly going wrong.
Thanks very much for your help. Remember that this is a test package and your help is extremely appreciated :) I have tested these packages on test virtual machines.