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 . 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.
Donc, merci aux âmes charitables qui voudront bien m’apporter leurs lumières
Bonne années à tous.