[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#497110: improved dmraid support in D-I



On Sunday 07 September 2008, Frans Pop wrote:
> I've done some testing using Giuseppe's businesscard image in
> VirtualBox ...

I was very surprised that you don't actually need BIOS support for dmraid. 
Apparently it really only scans the harddisks for some specific headers 
and bases the rest on that. Makes me wonder if we could not have a tool 
to generate such images from scratch...

Anyway, as I prefer VirtualBox over qemu, I have converted the empty 
dmraid disk images Giuseppe linked to for VirtualBox. I've uploaded these 
images to alioth and documented that testing in an emulator is possible 
on the wiki:
- http://wiki.debian.org/DebianInstaller/SataRaid
- http://d-i.alioth.debian.org/pub/dmraid-empty-disks/

> ... and based on the results I've made some additional changes. 

To start with, this is how the main partman dialog now looks:
http://alioth.debian.org/~fjp/tmp/d-i_dmraid/dmraid-1.png
The description of the "disk" is a bit long, but good enough for Lenny.

I've done a few minor cleanups, but also prepared some additional changes 
in my git repository. Here's an overview.

* partman-dmraid udeb no longer needed
This means it no longer needs to be loaded during disk-detect.
Patch for that in hw-detect is trivial.

* descriptions when confirming changes in partman
With Giuseppe's image I got the following:
http://alioth.debian.org/~fjp/tmp/d-i_dmraid/dmraid-2.png
As you can see the "partition numbers" are missing.

We used to have (with Lenny Beta1/Beta2 images):
http://alioth.debian.org/~fjp/tmp/d-i_dmraid/dmraid-2old.png

A minor patch in partman-base/lib/commit.sh which gives dmraid the same 
exception as multipath already had for d-m devices results in:
http://alioth.debian.org/~fjp/tmp/d-i_dmraid/dmraid-2fixed.png

* warning that dmraid support is experimental
IMO the warning that was displayed during partman by partman-dmraid can be 
dropped. grub-installer already had its own warning which will still be 
displayed:
http://alioth.debian.org/~fjp/tmp/d-i_dmraid/dmraid-grub.png

The only thing we "lose" is the link to the wiki page that was included in 
the warning displayed by partman.

* grub's menu.lst contained wrong grub root
With Giuseppe's image I got the following line for the grub root in
/boot/grub/menu.lst:
## default grub root device
## e.g. groot=(hd0,0)
# groot=(sil_aiahbgbgaaaj1)

This should be just 'groot=(hd0,0)'.
I have checked both Beta1 and Beta2 and those gave the same result. I am 
sure that this worked correctly when I implemented dmraid support during 
Debconf last year, so I guess there's been a regression in grub at some 
point. This matches several reports of problems we've seen, but it is 
possible that it does not always go wrong.

Rather than trying to get grub fixed I've decided to just patch 
grub-installer to correct the wrong groot value (see attached patch).

* OOM crash during partitioning due to divider issue
Because we now _do_ display the "Use as:" option for dmraid devices, the 
situation that lead to the OOM crash no longer happens. I still think 
that its worthwhile to fix the issue though, both in partman and 
preferably also eventually in cdebconf.

For partman I've included the second of my proposed patches from
http://bugs.debian.org/497110#64 in my git repository.

* not sure about os-prober change
Giuseppe image includes a patch from Ubuntu for os-prober so that it will 
also scan active dmraid devices. I've not tested what the result of that 
is. The scan itself will probably be correct, but I somewhat doubt that 
it will result in correct entries for other OS'es in the grub menu.

However, I do not think it can do very much harm either so I have no 
strong feelings about excluding or including that patch for Lenny.

Cheers,
FJP

diff --git a/packages/arch/i386/grub-installer/grub-installer b/packages/arch/i386/grub-installer/grub-installer
index 2b16484..501789a 100755
--- a/packages/arch/i386/grub-installer/grub-installer
+++ b/packages/arch/i386/grub-installer/grub-installer
@@ -619,11 +619,15 @@ db_progress INFO grub-installer/progress/step_config_loader
 rm -f $ROOT/boot/grub/$menu_file
 update_grub
 
-# For SATA RAID/multipath we may need to update the grub root
-# TODO: This should really be supported in update-grub
-if [ "$frdev" ] && [ $frgrubroot -gt 0 ]; then
-	sed -i "/^root/s/(hd0,0)/(hd0,$frgrubroot)/
-		/^# groot/s/(hd0,0)/(hd0,$frgrubroot)/" $ROOT/boot/grub/$menu_file
+# For SATA RAID/multipath the grub root may need fixing up
+# For dmraid we can end up with e.g. '(sil_aiahbgbgaaaj1)', or we can end up
+# with '(hd0,0)' when it should be a higher partition
+# TODO: This should really be better supported in update-grub
+if [ "$frdev" ] && \
+   ! grep -q "^# groot=(hd0,$frgrubroot)" $ROOT/boot/grub/$menu_file; then
+	info "Fixing up the grub root to '(hd0,$frgrubroot)'"
+	sed -i "/^# groot/s/(.*)/(hd0,$frgrubroot)/" $ROOT/boot/grub/$menu_file
+	update_grub
 fi
 
 # Set a password if asked

Attachment: signature.asc
Description: This is a digitally signed message part.


Reply to: