Hoary Array 6: Installing Ubuntu direct on Software Raid1

Herbert Straub herbert at linuxhacker.at
Tue Mar 8 20:58:29 UTC 2005


without a problem.  Some minor problems exists with simulated disk 
failures (disconnect SATA cable) with the MBR and with the Grub setting. 
I have tested the following setting:

  sd[ab]1   Primary     Linux raid autodetect       8 GB -> /
  sd[ab]5   Logical     Linux raid autodetect       4 GB -> swap
  sd[ab]6   Logical     Linux raid autodetect      10 GB -> /home
  sd[ab]7   Logical     Linux raid autodetect       4 GB -> /var

After the first reboot */etc/mdadm/mdadm.conf containing*

DEVICE partitions
  ARRAY /dev/md3 level=raid1 num-devices=2 UUID=eff1781e:cc8dcc6c:236bc337:fcb68200
     devices=/dev/sdb7,/dev/sda7
  ARRAY /dev/md2 level=raid1 num-devices=2 UUID=73b6e29d:44ac55b7:d55ffd55:67b965d6
     devices=/dev/sdb6,/dev/sda6
  ARRAY /dev/md1 level=raid1 num-devices=2 UUID=9413bf12:7e0e1908:dbbd7031:9d1ab851
     devices=/dev/sdb5,/dev/sda5
  ARRAY /dev/md0 level=raid1 num-devices=2 UUID=2df9a837:bd9ebede:a9195064:4e649858
     devices=/dev/sdb1,/dev/sda1


--> different UUID's (bug in Hoary Array 5). *cat /proc/mdstat shows:

*Personalities : [raid1] 
  md3 : active raid1 dm-5[1] dm-4[0]
        3903680 blocks [2/2] [UU]

  md2 : active raid1 dm-3[1] dm-2[0]
        9767424 blocks [2/2] [UU]

  md1 : active raid1 dm-1[1] dm-0[0]
        3903680 blocks [2/2] [UU]

  md0 : active raid1 sdb1[0] sda1[1]
        7815488 blocks [2/2] [UU]

  unused devices: <none>

*
cat /boot/grub/device.map:
*(hd0) /dev/sda
(hd1) /dev/sdb


*cat /boot/grub/menu.lst shows (shortened):

*  title         Ubuntu, kernel 2.6.10-4-amd64-generic Default 
  root          (hd1,0)
  kernel                /boot/vmlinuz root=/dev/md0 ro console=tty0 quiet splash
  initrd                /boot/initrd.img
  savedefault
  boot

--> Interessting is root (hd1,0), why not (hd0,0)?


Simulating /dev/sdb disk failure (disconnecting SATA cable): Grub display the error:

Booting 'Ubuntu, kernel 2.6.10-4-amd64-generic Default '
  root (hd1,0)
  Error 21: Selected disk does not exist
  Press any key to continue...

--> OK now edit the root line an change to root (hd0,0)
-----> Boot OK


Simulating /dev/sda disk failure (after reconstructing to normal state). The problem is
the missing MBR on disk /dev/sdb. Another problem is, that the disk /dev/sdb will be
/dev/sda. I found with Google the following tip:

grub> find /boot/grub/stage1
  grub> device (hd0) /dev/sda
  grub> root (hd0,0)
  grub> setup (hd0)
  -- first disk set up
  grub> device (hd0) /dev/sdb
  grub> root (hd0,0)
  grub> setup (hd0)
  -- second disk set up

Now:
    Booting 'Ubuntu, kernel 2.6.10-4-amd64-generic Default'
    root (hd1,0)
    Error 21: Selected disk does not exist

Changing the root line to (hd0,0)

Boot OK mdadm --query --detail /dev/md0 shows:
[...]
      Number   Major   Minor   RaidDevice State
         0       8        1        0      active sync   /dev/sda1
         1       0        0        -      removed

--> I disconnect the /dev/sda and the /dev/sda is not changed, but the system listing
this disk as /dev/sda?



Some other interessting points:

- /dev/md2 (the swap partition) will be automaticaly reconstructed, all other raids have
reconstructed with mdadm /dev/md1 --add /dev/sda1. Autostart?

- mdadm --query --detail /dev/md0 lists the member /dev/sda1
  mdadm --query --detail /dev/md2 lists the member /dev/evms/.nodes/sda6
  Why only the first Raid is build from /dev/sda*?

- Could be the the usage of UUID in fstab a solution for the changing
  devicenames (sda, sdb, ...), if yes, then the devices=... option should be 
  removed in /etc/mdadm/mdadm.conf ?

Thanks and best regards
Herbert Straub





More information about the ubuntu-users mailing list