Skip to contentSkip to conversation

Raid 5 on raw disk install is broken.

DISCUSSION Centurion Computer Technology (2005) Ltd 3 participants 4 messages Mar 30, 2009 – Apr 3, 2009

lore
Share & tools
lore
#0 lore raw

Hi,

I have a raid array named /dev/md/d0

The comand

grub-setup -r "(md0,1)" "(md0)" fails with:
grub-setup: error: Can't open /dev/md0: No such file or directory.

I have traced this down to lines 68 - 70 in util/raid.c a copy of the offending lines is:

  devname = xmalloc (strlen (name) + 6);
  strcpy (devname, "/dev/");
  strcpy (devname+5, name);

The problem is that it appears to sake the grub device id "md0" and simply append it to the string "/dev/" to get /dev/md0. This will break any installation of grub on mdraid whole disk sets.

Can I suggest a fix might be a similar method used by util/hostdisk function opendisk:
(Line 311): strcpy (dev, map[disk->id].device);

Also, can someone point me to the resources I need so I can build the debian package out of the svn tree?

Thanks,

Signature · 4 lines
Daniel Reurich

Centurion Computer Technology (2005) Limited.
Ph: 021 797 722
#1 lore raw
Quoted 12 lines · On Tue, 2009-03-31 at 09:04 +1300, Centurion Computer Technology (2005) Ltd…

Hi,

I have a raid array named /dev/md/d0

The comand

grub-setup -r "(md0,1)" "(md0)" fails with:
grub-setup: error: Can't open /dev/md0: No such file or directory.

I have traced this down to lines 68 - 70 in util/raid.c a copy of the offending lines is:

Quoted 7 lines
  devname = xmalloc (strlen (name) + 6);
  strcpy (devname, "/dev/");
  strcpy (devname+5, name);

The problem is that it appears to sake the grub device id "md0" and simply append it to the string "/dev/" to get /dev/md0. This will break any installation of grub on mdraid whole disk sets.

Just to clarify this, The linux standard device name for a linux whole/partionable disk mdraid device is /dev/md/dN, and the old style naming scheme is /dev/md_dN

I am still looking for a fix for this. The only way I can see to sort this is to use the device.map to get the linux device name from the grub device name. Can anybody point me to how to get this device name or an example of where this is already done?

Quoted 5 lines

Also, can someone point me to the resources I need so I can build the debian package out of the svn tree?

Thanks,

Signature · 4 lines
Daniel Reurich

Centurion Computer Technology (2005) Limited.
Ph: 021 797 722
#2 lore raw
In reply to Centurion Computer Technology (2005) Ltd
Quoted 16 lines · On Tuesday 31 March 2009 05:04:19 Centurion Computer Technology (2005) Ltd…

Hi,

I have a raid array named /dev/md/d0

The comand

grub-setup -r "(md0,1)" "(md0)" fails with:
grub-setup: error: Can't open /dev/md0: No such file or directory.

I have traced this down to lines 68 - 70 in util/raid.c a copy of the offending lines is:

  devname = xmalloc (strlen (name) + 6);
  strcpy (devname, "/dev/");
  strcpy (devname+5, name);
Quoted 7 lines

The problem is that it appears to sake the grub device id "md0" and simply append it to the string "/dev/" to get /dev/md0. This will break any installation of grub on mdraid whole disk sets.

Can I suggest a fix might be a similar method used by util/hostdisk function opendisk:
(Line 311): strcpy (dev, map[disk->id].device);

Would you like to send a patch?

Quoted 2 lines

Also, can someone point me to the resources I need so I can build the debian package out of the svn tree?

Sorry, I don't know, as I am not a Debian user.

Regards,
Okuji

#3 lore raw
In reply to Centurion Computer Technology (2005) Ltd

Am Dienstag, den 31.03.2009, 09:04 +1300 schrieb Centurion Computer Technology (2005) Ltd:

Hi,

Quoted 2 lines

Also, can someone point me to the resources I need so I can build the debian package out of the svn tree?

just checkout `svn://svn.debian.org/svn/pkg-grub/grub2/trunk' into your grub2 svn directory and then you can use dpkg-buildpackage or debuild to create the Debian packages.

Signature · 1 line
Felix Zielcke