Bug#292274: [patch] update-grub: Add support for software raid1

Frans Pop Frans Pop <aragorn@tiscali.nl>, 292274@bugs.debian.org
Thu, 3 Feb 2005 13:13:49 +0100


On Thursday 03 February 2005 07:31, you wrote:
> If I include this patch should I depend/suggest mdadm?

No, just use it if it's there (that's one reason why I included the '-x' 
test). If mdadm is not there, it's most probably not a software raid 
system anyway.
As you can see, if anything goes wrong in the new function, update-grub 
reverts to old behavior.

> What about just parsing /proc/mdstat?
>
> [root@vinnie root]# cat /proc/mdstat
> Personalities : [raid0]
> read_ahead 1024 sectors
> md0 : active raid0 sdb1[1] sda1[0]
>       71681792 blocks 4k chunks
>
> unused devices: <none>

This is the output of /proc/mdstat on an installed system:
Personalities : [raid1]
read_ahead 1024 sectors
md1 : active raid1 ide/host0/bus0/target0/lun0/part9[0] 
scsi/host0/bus0/target0/lun0/part1[1]
      12956288 blocks [2/2] [UU]

md0 : active raid1 ide/host0/bus0/target0/lun0/part5[0]
      35840896 blocks [2/1] [U_]

unused devices: <none>

This is the output of mdadm -D -b /dev/md0 on the same system:
ARRAY /dev/md0 level=raid1 num-devices=2 
UUID=7b48753a:12078a9c:6460070e:951f510f
   devices=/dev/hda5

As you can see, using /proc/mdstat would require a conversion from kernel 
notation of the device that's found.
AFAICT mdadm always provides the correct notation.

Cheers,
Frans