grub2 editer le menu?

bjr a tous je reviens un peu sur le menu de grub2

avec grub il etait facile d’editer le menu (touche e) au demarrage quand on se trompait ensuite on pouvait facilement utiliser la touche [TAB] pour trouver le bon disque dur & la bonne partition quand d’une installation a l’autre on avait un peu oublié sa configuration

sur grub2 j’ai une erreur a l’etape 1.5 (stage 1.5) quand je fais escape je ne reviens sur aucun menu (quelqu’un d’entre vous a deja eu ce gag???

merci d’avance

Il me semble que oui, moi aussi.
Mais je ne me souviens plus comment j’en suis sorti :blush:
L’édition est en effet différente, elle est directe, une fois tapé le 1er ‘e’, il n’y en a pas de second comme avant.
Ensuite, quand on a modifié ce que l’on voulait, il ne faut plus taper ‘b’ mais Ctrl/x pour bouter.

bjr merci a toi bon j’ai reussi a reinstaller grub2 mais les partitions win ne bootent pas , tant pis j’attendrai une version plus finie de grub2

pour info 2 sites ou on parle de grub2

doc.ubuntu-fr.org/grub2

linuxpedia.fr/doku.php/expert/grub2

[quote=“ricardo”]Ensuite, quand on a modifié ce que l’on voulait, il ne faut plus taper ‘b’ mais Ctrl/x pour bouter.[/quote]Ou “esc” pour revenir au menu (peut-être utile…).

Tu les vois dans Grub au chargement ?
Si “oui”, donne-nous ici tes fichiers :
/boot/grub/grub.cfg
/etc/grub.d/40_custom

Bonjour :slightly_smiling:

Je squatte le sujet, j’ai le même problème : je vois ma partition Windows mais il ne veut pas booter dessus : no such partition quand je sélectionne Windows XP.

J’ai manuellement édité /boot/grub/grub.cfg ce qui est peut-être la cause de ce souci ; mais j’y ai été contraint dans la mesure où Windows n’apparaissait pas du tout dans le menu de GRUB2…

Je précise que la partition (hd0,0) était bien celle de mon Windows sur l’ancien GRUB, d’où mon interrogation quant à ce problème.

Voilà mon grub.cfg (j’ai un backup au cas où :wink:) [code]# DO NOT EDIT THIS FILE

It is automatically generated by /usr/sbin/grub-mkconfig using templates

from /etc/grub.d and settings from /etc/default/grub

BEGIN /etc/grub.d/00_header

set default=0
set timeout=5
set root=(hd1,7)
search --no-floppy --fs-uuid --set d6b136db-25e6-4205-b23e-2a8e69158c85
if loadfont /usr/share/grub/ascii.pf2 ; then
set gfxmode=640x480
insmod gfxterm
insmod vbe
if terminal_output.gfxterm ; then true ; else
# For backward compatibility with versions of terminal.mod that don’t
# understand terminal_output
terminal gfxterm
fi
fi

END /etc/grub.d/00_header

BEGIN /etc/grub.d/05_debian_theme

set root=(hd1,7)
search --no-floppy --fs-uuid --set d6b136db-25e6-4205-b23e-2a8e69158c85
insmod png
if background_image /boot/grub/moreblue-orbit-grub.png ; then
set color_normal=black/black
set color_highlight=magenta/black
else
set menu_color_normal=cyan/blue
set menu_color_highlight=white/blue
fi

END /etc/grub.d/05_debian_theme

BEGIN /etc/grub.d/10_linux

menuentry “Debian GNU/Linux, Linux 2.6.26-2-686” {
set root=(hd1,7)
search --no-floppy --fs-uuid --set d6b136db-25e6-4205-b23e-2a8e69158c85
linux /boot/vmlinuz-2.6.26-2-686 root=UUID=d6b136db-25e6-4205-b23e-2a8e69158c85 ro quiet
initrd /boot/initrd.img-2.6.26-2-686
}
menuentry “Debian GNU/Linux, Linux 2.6.26-2-686 (recovery mode)” {
set root=(hd1,7)
search --no-floppy --fs-uuid --set d6b136db-25e6-4205-b23e-2a8e69158c85
linux /boot/vmlinuz-2.6.26-2-686 root=UUID=d6b136db-25e6-4205-b23e-2a8e69158c85 ro single
initrd /boot/initrd.img-2.6.26-2-686
}

END /etc/grub.d/10_linux

BEGIN /etc/grub.d/30_os-prober

menuentry “Windows XP” {
set root=(hd0,0)
chainloader +1
}

END /etc/grub.d/30_os-prober

BEGIN /etc/grub.d/40_custom

This file is an example on how to add custom entries

END /etc/grub.d/40_custom ###[/code]

C’est dans 40_custom que tu dois placer tes autres os.
Maintenant, il faudra ptet que tu mettes l’UUID à la place du (hd0,0)
EDIT :
au fait, il ne faut pas modifier ça dans /boot/grub/grub.cfg mais dans
/etc/grub.d/ —
ensuite, tu lances un

update-grub

[quote=“Mornagest”]

BEGIN /etc/grub.d/30_os-prober

menuentry “Windows XP” {
set root=(hd0,0)
chainloader +1
}

END /etc/grub.d/30_os-prober ###[/code][/quote]

Bonjour, le chainloader de Grub2 est un peu différent :mrgreen: de celui de Grub legacy… Le mien fonctionne (j’ai eu du mal à trouver…) tu peux t’en inspirer ! Et comme [quote=“ricardo”]C’est dans 40_custom que tu dois placer tes autres os.[/quote]
(précisément dans /etc/grub.d/40_custom)

menuentry "Windows Vista (loader) (on /dev/sdb1)" { set root=(hd1,1) search --no-floppy --fs-uuid --set 345408ad54087440 drivemap -s (hd0) ${root} chainloader +1 }

OK, je tente ça ce soir :slightly_smiling: merci bien à tous les deux ! :smt023

[quote]# update-grub
Generating grub.cfg …
Found Debian background: moreblue-orbit-grub.png
Found linux image: /boot/vmlinuz-2.6.26-2-686
Found initrd image: /boot/initrd.img-2.6.26-2-686
done[/quote]Ça n’a pas l’air bon :confused:

J’ai ajouté ceci dans /etc/grub.d/40_custom [quote]menuentry “Windows XP” {
set root=(hd0,0)
drivemap -s (hd0) ${root}
chainloader +1
}[/quote]mais ça ne marche apparemment pas…

Le passage avec [quote] search --no-floppy --fs-uuid --set 345408ad54087440[/quote], je ne sais pas quoi mettre dans mon cas, en fait… :blush:

C’est apparemment l’UUID de Win mais là, je ne connais pas.
Tu peux ptet essayer à partir d’une ditrib Debian avec :

tune2fd -l /dev/sxxx

où ‘sxxx’ est la partoche de win
mais je ne suis pas sûr du résultat.

[quote=“Mornagest”]menuentry "Windows XP" { set root=(hd0,0) drivemap -s (hd0) ${root} chainloader +1
}[/quote]
Attention, grub2, contrairement à grub-legacy, numérote les partitions à partir de 1 et non 0. Pour utiliser la première partition du premier disque dur (hda1), il faut mettre (hd0,1), et non (hd0,0) !

Si tu utilises la première partition du premier disque, tu n’as pas besoin de « drivemap ».
Perso, j’ai simplement :

menuentry "Windows XP" { set root=(hd0,1) chainloader +1 }

[quote=“ricardo”]Tu peux ptet essayer à partir d’une ditrib Debian avec :

tune2fs -l /dev/sxxx

où ‘sxxx’ est la partoche de win[/quote]
tune2fs c’est pour les partitions ext* seulement. Pour connaitre l’UUID de ses partitions, on peut faire :

Oui, c’est l’uuid, c’est une “plaque d’immatriculation”, unique pour chaque disque, qu’il faut adapter en fonction de ta configuration :

[quote=“kna”]tune2fs c’est pour les partitions ext* seulement. Pour connaitre l’UUID de ses partitions, on peut faire :

ls -l /dev/disk/by-uuid

[quote=“Mornagest”][quote]# update-grub
Generating grub.cfg …
Found Debian background: moreblue-orbit-grub.png
Found linux image: /boot/vmlinuz-2.6.26-2-686
Found initrd image: /boot/initrd.img-2.6.26-2-686
done[/quote][/quote]Effectivement il manque Windows… As-tu installé “os-prober” ? Au pire (tu ne devrais pas le faire…) ajoute l’entrée à la main dans grub.cfg… Mais c’est mieux si c’est update-grub qui le fait, ça t’évitera des problèmes à chaque mise à jour de grub2 :mrgreen:

Salut,

Je tenterai ce soir en mettant hd(0,1). J’ai deux disques, effectivement, l’un pour XP, l’autre pour Debian. J’ignorais que la numérotation avait changé avec GRUB2 (c’est pas vraiment pour faciliter le boulot, tout ça :stuck_out_tongue: )

Merci encore :slightly_smiling:

Même chose :confused:

[quote]# update-grub
Generating grub.cfg …
Found Debian background: moreblue-orbit-grub.png
Found linux image: /boot/vmlinuz-2.6.26-2-686
Found initrd image: /boot/initrd.img-2.6.26-2-686
done[/quote]Mon /etc/grub.d/40_custom complet [quote]#!/bin/sh
exec tail -n +3 $0

This file is an example on how to add custom entries

menuentry “Windows XP” {
search --no-floppy --fs-uuid --set ACA84520A844EB02
set root=(hd0,1)
chainloader +1
}[/quote]

Tu peux toujours faire ça en attendant… J’avoue que je sèche un peu ! Mais au moins tu démarrera ton OS… [size=85](futur simple, pas de “s” à démarrera ?)[/size]

rai
ras
ra
rons
rez
ront

(dans l’ordre, pour le futur simple de l’indicatif :stuck_out_tongue:).

Dans /boot/grub/grub.cfg, j’ai les mêmes lignes qui ont été copiées quand j’ai updaté GRUB, je pense… parce que je n’y ai pas retouché depuis que j’ai remis l’original à la place. Donc le problème ne vient pas de là :confused:

[quote]#

DO NOT EDIT THIS FILE

It is automatically generated by /usr/sbin/grub-mkconfig using templates

from /etc/grub.d and settings from /etc/default/grub

BEGIN /etc/grub.d/00_header

set default=0
set timeout=5
set root=(hd1,7)
search --no-floppy --fs-uuid --set d6b136db-25e6-4205-b23e-2a8e69158c85
if loadfont /usr/share/grub/ascii.pf2 ; then
set gfxmode=640x480
insmod gfxterm
insmod vbe
if terminal_output.gfxterm ; then true ; else
# For backward compatibility with versions of terminal.mod that don’t
# understand terminal_output
terminal gfxterm
fi
fi

END /etc/grub.d/00_header

BEGIN /etc/grub.d/05_debian_theme

set root=(hd1,7)
search --no-floppy --fs-uuid --set d6b136db-25e6-4205-b23e-2a8e69158c85
insmod png
if background_image /boot/grub/moreblue-orbit-grub.png ; then
set color_normal=black/black
set color_highlight=magenta/black
else
set menu_color_normal=cyan/blue
set menu_color_highlight=white/blue
fi

END /etc/grub.d/05_debian_theme

BEGIN /etc/grub.d/10_linux

menuentry “Debian GNU/Linux, Linux 2.6.26-2-686” {
set root=(hd1,7)
search --no-floppy --fs-uuid --set d6b136db-25e6-4205-b23e-2a8e69158c85
linux /boot/vmlinuz-2.6.26-2-686 root=UUID=d6b136db-25e6-4205-b23e-2a8e69158c85 ro quiet
initrd /boot/initrd.img-2.6.26-2-686
}
menuentry “Debian GNU/Linux, Linux 2.6.26-2-686 (recovery mode)” {
set root=(hd1,7)
search --no-floppy --fs-uuid --set d6b136db-25e6-4205-b23e-2a8e69158c85
linux /boot/vmlinuz-2.6.26-2-686 root=UUID=d6b136db-25e6-4205-b23e-2a8e69158c85 ro single
initrd /boot/initrd.img-2.6.26-2-686
}

END /etc/grub.d/10_linux

BEGIN /etc/grub.d/30_os-prober

END /etc/grub.d/30_os-prober

BEGIN /etc/grub.d/40_custom

This file is an example on how to add custom entries

menuentry “Windows XP” {
set root=(hd0,1)
search --no-floppy --fs-uuid --set ACA84520A844EB02
chainloader +1
}

END /etc/grub.d/40_custom ###[/quote]

Et ça t’affiche quoi quand tu bootes dessus ?

Eh bien :blush: cette fois ça fonctionne bel et bien. Je pensais qu’en ne l’affichant pas après update-grub, il ne voudrait pas le lancer, et en fait si… au temps pour moi.

Problème résolu, donc :slightly_smiling: encore merci pour votre patience ! :smt023

Juste au moment ou je postais… Cool ! Bonne soirée :smt006