Friday, January 21, 2011

Raid 1 not starting and mounting on boot - Ubuntu 10.10 Maverick

Still a work in progress.

Here are my link resources to figure this out -
Ubuntu forums #1

Ubuntu forums #2

and a new lead here.


and here's a draft:
hard disk1: /dev/sda
hard disk2: /dev/sdb, raid device: /dev/sdb1
hard disk3: /dev/sdc, raid device: /dev/sdc1
raid1 device name: /dev/md0

ARRAY /dev/md0 devices=/dev/sdb1,/dev/sdc1


mount raid1
sudo rm /etc/mdadm/mdadm.conf
sudo dpkg-reconfigure mdadm

click Yes (redundancy checks), Yes (monitor daemon), enter email address, No (boot system if RAID gets degraded)

gksu gedit /etc/mdadm/mdadm.conf
replace the ARRAY /dev/md0, and remove the UUID references, replace with devices=/dev/sdb1,/dev/sdc1

then rerun:
sudo dpkg-reconfigure mdadm

get UUID of the raid device:
sudo blkid

and modify fstab
gksu gedit /etc/fstab, inserting this line:

UUID=ae5f4540-59af-4e7a-84b0-ea97cc12e425  /Raid500    ext3          nodev,nosuid       0       2

The puzzle revealed
Inspecting my Ubuntu-10.04-with-RAID1 at home - which works starting up the raid and automounting it - I observed the following:
sudo blkid
reveals the following information:
dan@athena:~$ sudo blkid
/dev/sda1: UUID="7272061b-81d4-7395-e009-c51128a3b5c6" TYPE="linux_raid_member" 
/dev/sda2: UUID="c9ce349c-636a-667d-51a5-cb52c66e37ae" TYPE="linux_raid_member" 
/dev/sdb1: UUID="7272061b-81d4-7395-e009-c51128a3b5c6" TYPE="linux_raid_member" 
/dev/sdb2: UUID="c9ce349c-636a-667d-51a5-cb52c66e37ae" TYPE="linux_raid_member" 
/dev/md0: UUID="97019d30-06b0-42ef-8bfd-1699316f3012" TYPE="swap" 
/dev/md1: LABEL="raid1now" UUID="f1d9e97a-b766-4af1-bafd-ce0192aa04e1" TYPE="ext4"

I am guessing here that the /dev/sda1 and /dev/sdb1 are the swap partitions of the 2 actual physical drives. And the /dev/sda2 and /dev/sdb2 are, in turn, the ext4 partitions also of the 2 actual physical drives. And notice how both sda1 and sdb1 are the same, as well as sda2 and sdb2.

The raid device then takes new UUID values for swap (/dev/md0) and ext4 (/dev/md1).

BUT, the mdadm.conf tells a different story.
# definitions of existing MD arrays
ARRAY /dev/md0 level=raid1 num-devices=2 UUID=7272061b:81d47395:e009c511:28a3b5$
ARRAY /dev/md1 level=raid1 num-devices=2 UUID=c9ce349c:636a667d:51a5cb52:c66e37$

The mdadm.conf's md0 = blkid's sda1 (and sdb1), while its md1 = blkid's sda2 (and sdb2) - with slight variations:
Comparing blkid's sda1 (and sdb1) with mdadm's md0:
7272061b-81d4-7395-e009-c51128a3b5c6
7272061b:81d47395:e009c511:28a3b5$

and blkid's sda2/sdb2 with mdadm's md1:
c9ce349c-636a-667d-51a5-cb52c66e37ae
c9ce349c:636a667d:51a5cb52:c66e37$

So mdadm.conf references the blkid's sda/sdb UUIDs, and NOT the blkid's md0/md1 UUIDs.

Finally, fstab reveals the following:
# / was on /dev/md1 during installation
UUID=f1d9e97a-b766-4af1-bafd-ce0192aa04e1 /               ext4    errors=remoun$
# swap was on /dev/md0 during installation
UUID=97019d30-06b0-42ef-8bfd-1699316f3012 none            swap    sw           $

Fstab references blkid's md1 with it's own md1 for the ext4 partition:
blkid: f1d9e97a-b766-4af1-bafd-ce0192aa04e1
fstab: f1d9e97a-b766-4af1-bafd-ce0192aa04e1

and same with the swap partition.

No comments:

Post a Comment