nouvo09 wrote:Parce que tu n'utilises pas correctement la commande.
grub-install est un script qui a pour objet d'installer un bout de lanceur soit dans le MBR du disque soit dans le boot record de la partition considérée. Et donc les différentes syntaxes possibles sont:
# grub-install /dev/sdg (si tu veux booter sur ta clé)
# grub-install /dev/sdg1 ou sdg2 etc (si tu as un autre lanceur de boot sur le MBR de ta clé et qus tu veux qu'il te donne la main ensuite)
Salut nouvo !
Ca ne fonctionne pas :
[root@Fifi ~]# grub-install /dev/sdg
/dev/sdg does not have any corresponding BIOS drive.
[root@Fifi ~]# grub-install /dev/sdg1
/dev/sdg1 does not have any corresponding BIOS drive
Par contre :
[root@Fifi ~]# grub
Probing devices to guess BIOS drives. This may take a long time.
GNU GRUB version 0.97 (640K lower / 3072K upper memory)
[ Minimal BASH-like line editing is supported. For the first word, TAB
lists possible command completions. Anywhere else TAB lists the possible
completions of a device/filename.]
grub> find /boot/grub/stage1
find /boot/grub/stage1
(hd2,0)
grub> root (hd2,0)
root (hd2,0)
Filesystem type is ext2fs, partition type 0x83
grub> setup (hd2)
setup (hd2)
Checking if "/boot/grub/stage1" exists... yes
Checking if "/boot/grub/stage2" exists... no
Error 15r: File not found
grub>
J'avais auparavant copié un stage1 dans le dossier /boot/grub que j'avais créé dans sdg1, ce qui m'a permis d'identifier sdg comme étant hd2 ( donc le 3ème "disque dur" )...!
J'ai donc copié aussi un stage2 et les *_stage1_5 que j'ai trouvés ( e2fs_stage1_5, fat_stage1_5 ...etc ... ) dans le /boot/grub d'un iso de Super Grub Disk ( super_grub_disk_0.9799.iso) et j'ai relançé setup :
grub> setup (hd2)
setup (hd2)
Checking if "/boot/grub/stage1" exists... yes
Checking if "/boot/grub/stage2" exists... yes
Checking if "/boot/grub/e2fs_stage1_5" exists... yes
Running "embed /boot/grub/e2fs_stage1_5 (hd2)"... 25 sectors are embedded.
succeeded
Running "install /boot/grub/stage1 (hd2) (hd2)1+25 p (hd2,0)/boot/grub/stage2 /boot/grub/grub.conf"... succeeded
Done.
grub>
Par contre, pas de grub.conf dans /boot/grub de sdg1 ...!
J'en prend donc un sur une autre partition d'un disque dur et je le copie dans /boot/grub ( c'est le grub.conf qui me sert à lancer mes différents OS quand je boote sur mon disque dur où j'ai un multit boot Windows Xp - Fedora 12 - Fedora 11 et CentOS ).
Pour tester, je laisse ce grub.conf tel quel et je redémarre sur ma clef usb.
Cela fonctionne : grub se lance et m'affiche le menu des différents OS.
Voici mon grub.conf:
# grub.conf generated by anaconda
#
# Note that you do not have to rerun grub after making changes to this file
# NOTICE: You have a /boot partition. This means that
# all kernel and initrd paths are relative to /boot/, eg.
# root (hd0,1)
# kernel /vmlinuz-version ro root=/dev/sda3
# initrd /initrd-version.img
#boot=/dev/sda
default saved
timeout=10
#splashimage=(hd0,1)/grub/splash.xpm.gz
#splashimage=(hd0,1)/grub/splash12.xpm.gz
splashimage=(hd0,1)/grub/77942-wolf.xpm.gz
#splashimage=(hd0,1)/grub/74733-linux-splash.xpm.gz
#hiddenmenu
title Fedora 11 (2.6.30.10-105.2.23.fc11.x86_64)
root (hd0,1)
kernel /vmlinuz-2.6.30.10-105.2.23.fc11.x86_64 ro root=UUID=5f38242a-4e87-405a-871d-663d533eb601 rhgb vga=0x37B quiet
initrd /initrd-2.6.30.10-105.2.23.fc11.x86_64.img
title Fedora 11 (2.6.30.10-105.2.16.fc11.x86_64)
root (hd0,1)
kernel /vmlinuz-2.6.30.10-105.2.16.fc11.x86_64 ro root=UUID=5f38242a-4e87-405a-871d-663d533eb601 rhgb vga=0x37B quiet
initrd /initrd-2.6.30.10-105.2.16.fc11.x86_64.img
title Fedora 11 (2.6.30.10-105.2.13.fc11.x86_64)
root (hd0,1)
kernel /vmlinuz-2.6.30.10-105.2.13.fc11.x86_64 ro root=UUID=5f38242a-4e87-405a-871d-663d533eb601 rhgb vga=0x37B quiet
initrd /initrd-2.6.30.10-105.2.13.fc11.x86_64.img
title Windows XP Pro SP3
rootnoverify (hd0,0)
chainloader +1
savedefault
title Fedora 12 (2.6.32.9-67.fc12.x86_64)
root (hd0,6)
kernel /vmlinuz-2.6.32.9-67.fc12.x86_64 ro root=UUID=153209cc-13f0-468a-a86f-cde5b4e112cd LANG=fr_FR.UTF-8 SYSFONT=latarcyrheb-sun16 KEYBOARDTYPE=pc KEYTABLE=be-latin1 rhgb vga=0x37B quiet
initrd /initramfs-2.6.32.9-67.fc12.x86_64.img
title Fedora 12 (2.6.32.9-70.fc12.x86_64)
root (hd0,6)
kernel /vmlinuz-2.6.32.9-70.fc12.x86_64 ro root=UUID=153209cc-13f0-468a-a86f-cde5b4e112cd LANG=fr_FR.UTF-8 SYSFONT=latarcyrheb-sun16 KEYBOARDTYPE=pc KEYTABLE=be-latin1 rhgb vga=0x37B quiet
initrd /initramfs-2.6.32.9-70.fc12.x86_64.img
title Fedora 12 (2.6.32.10-90.fc12.x86_64)
root (hd0,6)
kernel /vmlinuz-2.6.32.10-90.fc12.x86_64 ro root=UUID=153209cc-13f0-468a-a86f-cde5b4e112cd LANG=fr_FR.UTF-8 SYSFONT=latarcyrheb-sun16 KEYBOARDTYPE=pc KEYTABLE=be-latin1 rhgb vga=0x37B quiet
initrd /initramfs-2.6.32.10-90.fc12.x86_64.img
title CentOS (2.6.18-164.10.1.el5.centos.plus)
root (hd0,9)
kernel /vmlinuz-2.6.18-164.10.1.el5.centos.plus ro root=/dev/sda11 rhgb vga=791 quiet
initrd /initrd-2.6.18-164.10.1.el5.centos.plus.img
title CentOS (2.6.18-164.11.1.el5.centos.plus)
root (hd0,9)
kernel /vmlinuz-2.6.18-164.11.1.el5.centos.plus ro root=/dev/sda11 rhgb vga=791 quiet
initrd /initrd-2.6.18-164.11.1.el5.centos.plus.img
title CentOS (2.6.18-164.15.1.el5.centos.plus)
root (hd0,9)
kernel /vmlinuz-2.6.18-164.15.1.el5.centos.plus ro root=/dev/sda11 rhgb vga=791 quiet
initrd /initrd-2.6.18-164.15.1.el5.centos.plus.img
Là, j'essaie de booter sur le premier de la liste ( Fedora 11 en l'occurence ), mais, j'ai une erreur 15 : file not found !
Je reviens en arrière et j'édite la ligne root (hd0,1) en (hd1,1) et ça fonctionne ! Fedora 11 se lançe ! L'ordre des disques avait donc changé !!! J'avais lu ça quelque part, mais je ne sais plus où...!
Bon, donc ma clé est bien bootable avec un grub bien fonctionnel.
Je retourne donc à l'article
http://sahilahuja.wordpress.com/2009/11/15/creating-a-super-pendrive/ et j'installe Fedora 12 Live 32 bits dans sdg2 et Fedora 12 64 bits dans sdg3 avec Live USB Creator. Pendant l'installation, j'ai un message qui s'affiche :
Warning: The Master Boot Record on your device does not match your system's syslinux MBR. If you have trouble booting this stick, try running the liveusb-creator with the --reset-mbr option.
Puis l'installation se poursuit et se termine !
Me voilà donc à ce stade où je dois éditer le grub.conf que j'ai copié dans /boot/grub de sdg1 pour qu'il m'affiche, en plus des OS, les 2 Live de F12...!
Où dois-je aller chercher ces lignes Title.., root ..., kernel... et initrd ... ?
Je pioche dans sdg2 et sdg3 et je reviens après.
A+