PDA

View Full Version : [ubuntu] 11.04: RAID won't mount at boot



parish
May 3rd, 2011, 09:02 PM
I have a RAID 1 array comprising two disks built under 10.10 using mdadm, mounted on /raid, used for data only, Ubuntu boots from another disk. All worked fine under 10.10

Since u/g to 11.04 the array won't auto-mount at boot. I get a message that the disk for /raid doesn't exist or is not ready with the options to wait, Skip, or Manual Recovery. I hit S to continue and try to mount it from a terminal but get the error that device /dev/md0 does not exist.

cat /proc/mdstat reveals that the device is now /dev/md_d0 so I edit /etc/fstab and can now mount it manually just fine, but still the error at boot.

dmesg shows that both disks are found and named correctly (sda and sdb) and no errors/warnings

This is a bit more inconvenient than simply having to mount the array manually as I use a Bluetooth keyboard and at the point I have to type 'S' BT is not running so I've have to plug in an old PS/2 keyboard.

Any ideas how to fix this and also why has the device name changed?

mrfeely
May 4th, 2011, 07:25 AM
I have virtually the same configuration and am getting the same error since upgrading to 11.04. In my case, the RAID was created under 9.10 and worked fine under 10.04 and 10.10.

After some investigation, it appears that the problem is internal to the mountall command that is run at boot time. The RAID fails to mount under mountall, but mounts fine when directly invoking mount. I created a Launchpad bug on it: https://bugs.launchpad.net/ubuntu/+source/mountall/+bug/776908.

parish
May 4th, 2011, 01:23 PM
Thanks mrfeely for confirming that it's not just my system that is affected.

I've added a comment ot your bug report.

Quackers
May 4th, 2011, 01:32 PM
I'm not sure whether it will work, but have you tried installing kpartx? (Or checking whether it's installed)

TyIzaeL
May 5th, 2011, 02:12 AM
I am having the same issue with a RAID5 array on a headless machine. I am also mounting by UUID. I've added a comment to the bug report.

I guess my network storage box is going to be tied to a monitor and keyboard until further notice. :(

mbeltoft
May 8th, 2011, 12:16 AM
I'm having the same problem with my Raid5 after the upgrade to 11.04.
Made a comment about it in the bug report and hoping someone fix it quickly

deconstrained
May 8th, 2011, 12:28 AM
Check the contents of /etc/mdadm/mdadm.conf, and rebuild the initramfs/reinstall+update grub if necessary.

I ran LUKS on RAID 10 for /, /usr and /home and raid 1 for boot, and upgrading to 11.04 screwed everything up and I had to fix them all manually. I guess this is not an uncommon problem.

The first thing I'd try is boot to a livedisk, run 'apt-get update' in the livedisk environment/install mdadm, then assemble/mount the arrays and then run "mdadm --detail --scan" to get the output that should go in mdadm.conf to properly assemble them.

mbeltoft
May 8th, 2011, 12:38 AM
I wouldn't even know where to start doing that but I discovered that I could start my server in a previous version and the Raid mount just fine so apparently it's some update that screwed everything up.

I have on clue on which one though :(

deconstrained
May 8th, 2011, 08:23 AM
...This is software RAID we're talking about here, and not motherboard or controller RAID? If it's hardware RAID then it's just that Ubuntu has a problem with not including the proper modules in the initrd.

Scores of wiki pages and tutorials exist that contain detailed information on how to perform each of the tasks I mentioned. A condensed list of these steps, in order:
1. Boot to live disk
2. Install mdadm (in the live disk environment)
3. Assemble your arrays (see 'man mdadm' for details)
4. Mount
5. Double-check that the file /etc/mdadm/mdadm.conf in your Linux system contains lines that are the same as those produced by "mdadm --detail --scan"
6. Chroot
7. Run update-grub
8. update-initramfs -u

mrfeely
May 13th, 2011, 05:23 AM
This problem I'm seeing appears unrelated to either grub or initrd. Booting the OS via grub works fine for me, as neither my boot nor root partitions are on RAID. And by the time the mountall command is run the real root partition is already mounted, so it's not using the initial ramdisk any longer.

For kicks, I tried replacing the ARRAY line of my mdadm.conf with what I get from "mdadm --detail --scan", updating the initrd with "update-initramfs -u", and rebooting. No change in symptoms.

I just noticed that "mountall --debug" can produce additional info. I'll try that and see if I get anything useful.

deconstrained
May 14th, 2011, 08:10 AM
If you're not booting from RAID then you have much less work ahead of you toward a solution. What happens when you try to manually assemble it? Nothing out of the ordinary?

Also, I sincerely commend you for searching around and reading the man page; yes, the --debug flag is useful.

mrfeely
May 17th, 2011, 04:59 AM
My array is already assembled and active at the time the mountall command is executed at bootup. As far as I can tell there is nothing wrong with the RAID. (And in fact, it mounts without complaint when running mount -a from the maintenance shell spawned by mountall.)

The relevant dmesg lines are:

[ 5.382100] md: bind<sdc3>
[ 5.423238] md: bind<sdb3>
[ 5.425569] md: raid1 personality registered for level 1
[ 5.425659] bio: create slab <bio-1> at 1
[ 5.425711] md/raid1:md_d0: active with 2 out of 2 mirrors
[ 5.425728] md_d0: detected capacity change from 0 to 722228805632
and /proc/mdstat gives:

Personalities : [raid1] [linear] [multipath] [raid0] [raid6] [raid5] [raid4] [raid10]
md_d0 : active raid1 sdb3[0] sdc3[1]
705301568 blocks [2/2] [UU]

unused devices: <none>
mountall --debug was not terribly helpful. The lines relating to my RAID partition are:

update_mount: /mnt/data: /mnt/data /dev/md_d0 ext3 defaults check
mount_policy: /mnt/data parent is /
/mnt/data is local
try_mount: /mnt/data waiting for device
try_mount: /mnt/data waiting for device
Unfortunately the --debug flag is undocumented; I had to read the source to find that.

I've just installed the requisite -dev packages and built my own copy of mountall. Next chance I get I'll run it under gdb at boot time and try to find out why it doesn't want to mount that partition.

foodmonkey
May 17th, 2011, 10:49 AM
i ahd a similar problem with 11.04 64 bit just recently - don't know if this helps but when i upgraded to 64 bit i wasn't raid enabled.

2 x 250G drives
downloaded 64 bit dvd a burned it
backed up all my essential dirs
installed raid personality using modprobe
installed 64 bit natty with the following partition configuration using the manual partition option
sda
sda1 /boot 2G ext4
sda2 swap 2G
sda3 / 246G ext4

sdb
sdb1 swap 4G
sdb2 no mount point ext4

went through install and restart - failed to start
booted from dvd and entered recovery mode and raid options were displayed in the partition manager

deleted and recreated sda3 and sdb2 as raid 0
created md0
installed ubuntu amd64 - all good.

parish
May 18th, 2011, 12:00 AM
I've got a workround that works for me since my array is just for data - probably not much use if you boot from the array.

I added the `noauto' option to the /etc/fstab entry for the array so mountall doesn't try to mount it at boot and added

mount /raid

in /etc/rc.local

I realize the rc.local entry should be more robust - testing for failure etc. - but since it's only temporary (hopefully) I can live with it :P

highlanderb
May 18th, 2011, 02:08 AM
I upgraded from 10.10 to 11.4 and had the same issue.
my raid is a data drive so I could boot.

My issue was in the mdadm config file (/etc/mdadm/mdadm.cfg)
The upgrade had added line for me to define my raid and it was above the configuration line I had added in 10.10. I commented the new one out and all was good.

This is the offending line I commented out.

# definitions of existing MD arrays
#ARRAY /dev/md0 level=raid5 num-devices=3 UUID=3384da1c:b969f957:0dce2b65:91a7efd7

BrooklynOutdoor
July 19th, 2011, 10:19 PM
One thing I had to do was make sure the array line was at the start of mdadm.conf. Doing that seemed to solve the problem:



#
# Please refer to mdadm.conf(5) for information about this file.
#

# definitions of existing MD arrays
ARRAY /dev/md0 metadata=1.2 name=thoth:0 UUID=42930826:a8d3264b:af76e6f5:14e3613f

# by default, scan all partitions (/proc/partitions) for MD superblocks.
# alternatively, specify devices to scan, using wildcards if desired.
DEVICE partitions

I think the problem is that the default config file is scanning partitions BEFORE assembling the arrays unless the order is changed. A clue besides the failed mount at boot was that my raid kept changing from md0 to md127 on restart.

I also find that while shutdown with a later power up never gives me a problem restart still sometimes does.