Pb avec Grub2 en chroot avec RAID1 et LVM

Bonjour à tous;
Voilà la situation:
Un serveur sous Squeeze, avec deux disques en RAID1 logiciel
md0 (sda1 et sdb1) pour la partition /boot
md1 (sda2 et sdb2) pour le reste, en full LVM
Après une installation de Xen et du kernel qui l’accompagne, et de quelques manipulations, manifestemment foireuses, le bootloader… ne boot plus.
J’ai donc attaqué la machine avec un rescue system et monté un chroot comme suit:

mkdir /mnt/chroot mount /dev/vg0/root /mnt/chroot mount /dev/md0 /mnt/chroot/boot/ mount --binf /dev/ /mnt/chroot/dev/ mount --bind /dev/ /mnt/chroot/dev/ mount --bind /proc/ /mnt/chroot/proc chroot /mnt/chroot/

Une fois dans le chroot, à coup d’aptitude remove, purge et autoclean, je supprime toutres traces de Xen (kernel, hyperviseur, …) de Grub2 et de grub-legacy, histoire d’avoir quelque chose de propre.

10:31 root@rescue /# ll /boot
total 25M
lrwxrwxrwx 1 root root    1 Dec 27 10:04 boot -> ./
-rw-r--r-- 1 root root 302K Dec 27 10:45 coffee.bmp
-rw-r--r-- 1 root root  84K Sep 16 19:01 config-2.6.26-2-amd64
-rw-r--r-- 1 root root 104K Dec 10 18:49 config-2.6.32-5-amd64
-rw-r--r-- 1 root root  22K Dec 27 10:45 debian.bmp
-rw-r--r-- 1 root root 151K Dec 27 10:45 debianlilo.bmp
drwxr-xr-x 4 root root 5.0K Jan  1 10:30 grub/
-rw-r--r-- 1 root root 7.5M Dec 27 10:04 initrd.img-2.6.26-2-amd64
-rw-r--r-- 1 root root  10M Dec 27 10:45 initrd.img-2.6.32-5-amd64
drwx------ 2 root root  12K Dec 27 10:03 lost+found/
lrwxrwxrwx 1 root root   10 Dec 27 10:45 sarge.bmp -> debian.bmp
-rw-r--r-- 1 root root  24K Dec 27 10:45 sid.bmp
-rw-r--r-- 1 root root 1.2M Sep 16 19:01 System.map-2.6.26-2-amd64
-rw-r--r-- 1 root root 1.6M Dec 10 18:49 System.map-2.6.32-5-amd64
-rw-r--r-- 1 root root 1.7M Sep 16 19:00 vmlinuz-2.6.26-2-amd64

[/code]puis [code]aptitude install grub2[/code]
[code]
┌──────────────────────────────────────────┤ Configuring grub-pc ├──────────────────────────────────────────┐
 │ The GRUB boot loader was previously installed to a disk that is no longer present, or whose unique        │ 
 │ identifier has changed for some reason. It is important to make sure that the installed GRUB core image   │ 
 │ stays in sync with GRUB modules and grub.cfg. Please check again to make sure that GRUB is written to     │ 
 │ the appropriate boot devices.                                                                             │ 
 │                                                                                                           │ 
 │ If you're unsure which drive is designated as boot drive by your BIOS, it is often a good idea to         │ 
 │ install GRUB to all of them.                                                                              │ 
 │                                                                                                           │ 
 │ Note: it is possible to install GRUB to partition boot records as well, and some appropriate partitions   │ 
 │ are offered here. However, this forces GRUB to use the blocklist mechanism, which makes it less           │ 
 │ reliable, and therefore is not recommended.                                                               │ 
 │                                                                                                           │ 
 │ GRUB install devices:                                                                                     │ 
 │                                                                                                           │ 
 │    [*] /dev/sda (??? MB, ???)                                                                             │ 
 │    [*] /dev/sdb (??? MB, ???)                                                                             │ 
 │    [*] /dev/md0 (??? MB, ???)                                                                             │ 
 │    [*] /dev/mapper/vg0-root (??? MB, vg0-root)                                                            │ 
 │                                                                                                                                                                                                                      │ 
 │                                                                                                                                                                                                                      │ 
 │                                                  <Ok>                                                                              │ 
 │                                                                                   							                         │ 
 └───────────────────────────────────────────────────────────────────────────────────────────────────────────┘ 
                                                                                                               
[/code]
Evidamment:

[code]
            │ GRUB failed to install to the following devices:                                     │ 
            │                                                                                      │ 
            │ /dev/mapper/vg0-root                                                                 │ 
            │                                                                                      │ 
            │ Do you want to continue anyway? If you do, your computer may not start up properly.  │ 
            │                                                                                      │ 
            │ Writing GRUB to boot device failed - continue?   
[/code]
Pas d'autre choix que continuer. Puis fin de l'install:
[code]
/usr/sbin/grub-setup: warn: Attempting to install GRUB to a partitionless disk.  This is a BAD idea..
/usr/sbin/grub-setup: error: embedding is not possible, but this is required when the root device is on a RAID array or LVM volume.
Generating grub.cfg ...
Found linux image: /boot/vmlinuz-2.6.32-5-amd64
Found initrd image: /boot/initrd.img-2.6.32-5-amd64
Found linux image: /boot/vmlinuz-2.6.26-2-amd64
Found initrd image: /boot/initrd.img-2.6.26-2-amd64
done
Setting up grub2 (1.98+20100804-11) ...
Setting up os-prober (1.42) ...
[/code]
Evidamment, si je reboot, j'aurais une erreur de chainloader.

os-prober donne çà:

[code]10:37 root@rescue /# os-prober
Cannot find list of partitions!  (Try mounting /sys.)

Donc, là je coince un peu. J’ai bien essyé d’enlever le second disque du raid, à l’aide de mdadm, sans résultats.
Je précise que sans etre complétement noob, je ne suis pas expert pour autant, mais j’aspires à le devenir :whistle: . D’où mon obstination depuis plusieurs jours sur ce probleme. En effet, mes VM Xen sont backupés, donc je pourrais reinstaller le tout en moins d’une demi-journée, mais je préferes comprendre où je me plante. :ugeek:
Donc, merci aux âmes charitables qui voudront bien m’apporter leurs lumières

Bonne années à tous.
:confusion-helpsos:

Bonjour,

Alors je précise que je n’y connait rien en LVM/RAID/Xen

mais

Il y a des modules spécifiques à grub2 pour chacune de ces fonctionnalités:

insmod raid
insmod mdraid
insmod lvm

par exemple.

Si l’automatisation échoue, peut-être essayer de les configurer à la main ?

Voila, voilà :whistle:

Je laisse la main aux pros

:006

Merci de ta réponses rapide.
J’ai donc édité le fichier /etc/default/grub en ajoutant:

#Grub module à charger GRUB_PRELOAD_MODULES="raid mdraid lvm"
puis update-grub:

11:35 root@rescue /# update-grub Generating grub.cfg ... Cannot find list of partitions! (Try mounting /sys.) Found linux image: /boot/vmlinuz-2.6.32-5-amd64 Found initrd image: /boot/initrd.img-2.6.32-5-amd64 Found linux image: /boot/vmlinuz-2.6.26-2-amd64 Found initrd image: /boot/initrd.img-2.6.26-2-amd64
C’est “Cannot find list of partitions! (Try mounting /sys.)” qui m’embête, je coince…

Salut,

Question idiote :

Moi qui suis sous LVM j’installe toujours grub-pc. C’est l’équivalent de grub2 ?

grub2 est un metapaquet avec grub-pc grub-common et os-prober il me semble

Avec grub2 ce serait plutot l’adaptation d’un fichiers
/etc/grub.d/n°_Test-manuel
Avec:

[code]
#!/bin/sh
exec tail -n +3 $0

This file provides an easy way to add custom menu entries. Simply type the

menu entries you want to add after this comment. Be careful not to change

the ‘exec tail’ line above.

menuentry “Test de démarrage manuel de système” {
insmod ufs2
insmod raid
insmod mdraid
insmod lvm

Suivit des options propre au montage et spécificités du système

[/code] Mais ce n’est qu’une idée :whistle:

Ok vais tester ça dés que possibl

En fait, je me suis un peu avancé. En fait, je ne sait pas du tout comment completer après "## Suivit des options propre au montage et spécificités du système"
C’est justement les options de montage qui ne sont pas clair.
Si quelqu’un avec une configuration similaire (RAID1 logiciel plus LVM) vouliat bien me monter sa config de Grub2 je serais preneur.
Sinon, je vais finir par une reinstall complete… :confused:

Salut,

Voici mon grub.cfg complet : pastebin.isalo.org/f2d8c6dc

J’ai bien :

insmod raid insmod mdraid insmod lvm insmod part_msdos insmod part_msdos insmod ext2
(ext2 c’est pour mes partitions en ext4…)

Grub est installé sur sda, et c’est tout…
Je crois que là est ton erreur, inutile d’aller essayer de l’installer partout:

[quote]│ [] /dev/sda (??? MB, ???) │
│ [
] /dev/sdb (??? MB, ???) │
│ [*] /dev/md0 (??? MB, ???) │
│ [*] /dev/mapper/vg0-root (??? MB, vg0-root)[/quote]

Éventuellement sdb pour assurer en cas de panne de sda.

Merci de ta réponse, mais en fait, installer sur sda, c’est la première chose que j’ai fait, et vu que ca ne marchait pas, l’installateur de Grub m’a proposé de le mettre partout, disant que c’etait sans risque.
Anyway, j’ai fini par craquer et refaire une install propre :013 , puis je vais remonter Xen4 et restaurer mes sauvegardes. Mais je reste frustré de ne pas y etre arrivé. :confused: :confused: :confused: :confused: