[RESOLU] bouger Grub de DD

salut

j’ai un systeme en multiboot sur 3 DDs en IDE avec grub en hd0 sur le MBR.je dois virer ce DD qui n’est plus monté depuis longtemps et qui ne sert qu’a Grub pour le boot.
Faut donc que je ré-install Grub sur un des 2 DD que je garde.Je trouve plein de doc pour definir le boot avec grub,mais peu pour l’install de Grub en lui même sur un systeme dejà existant.

ma config:

[code]debian:/home/albian# fdisk -l

Disk /dev/hda: 20.4 GB, 20416757760 bytes
255 heads, 63 sectors/track, 2482 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x00c500c4

Device Boot Start End Blocks Id System
/dev/hda1 * 1 2373 19061091 83 Linux
/dev/hda2 2374 2482 875542+ 5 Extended
/dev/hda5 2374 2482 875511 82 Linux swap / Solaris

Disk /dev/hdb: 163.9 GB, 163928604672 bytes
255 heads, 63 sectors/track, 19929 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x2e6069f6

Device Boot Start End Blocks Id System
/dev/hdb1 * 1 19929 160079661 83 Linux

Disk /dev/hdc: 300.0 GB, 300069052416 bytes
255 heads, 63 sectors/track, 36481 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x000c4954

Device Boot Start End Blocks Id System
/dev/hdc1 1 3824 30716248+ 83 Linux
/dev/hdc2 3947 36481 261337387+ 5 Extended
/dev/hdc3 3825 3946 979965 82 Linux swap / Solaris
/dev/hdc5 3947 10098 49415908+ 83 Linux
/dev/hdc6 10099 11314 9767488+ 83 Linux
/dev/hdc7 11315 36481 202153896 83 Linux

Partition table entries are not in disk order
debian:/home/albian#[/code]

[code]albian@debian:~$ cat /etc/fstab

/etc/fstab: static file system information.

proc /proc proc defaults 0 0
/dev/hdc6 / ext3 errors=remount-ro 0 1
/dev/hdc7 /home ext3 defaults 0 2
/dev/hda5 none swap sw 0 0
/dev/hdc3 none swap sw 0 0
/dev/hdd /media/cdrom0 udf,iso9660 user,noauto 0 0
/dev/fd0 /media/floppy0 auto rw,user,noauto 0 0
/dev/hdc5 /media/alinux ext3 defaults 0 2
/dev/hdb1 /media/Documents ext3 defaults 0
[/code]

On voit que Lenny est installé sur le 2ème disque (slave) de la 2ème nappe IDE .
Dans le principe,est-ce que je peux installer Grub sur ce DD et le fixer en boot dans le bios,ou bien faut-il absolument qu’il y ai un disque branché sur la 1ere nappe IDE?
Comment installer Grub en se passant de disquette (mon lecteur est HS )?Je pensais utiliser un disque de netinstall …?

merci

Tu dois pouvoir installer grub depuis ta debian tout simplement (man grub-install). Sinon depuis le liveCD/liveUSB de ton choix fournissant grub-install, depuis un cd netinstall ça doit être possible, si tu en as déjà un sous la main ça t’évites de gaspiller une galette (taxe support de stockage miam miam merci les “zayantsDroits”).

{parenthèse}
Apparemment la taxe sur les supports de stockage a été annulée par le conseil d’état. Petite bonne nouvelle… Mais c’est surtout en raison des plaintes des gros dont le commerce est touché par cette taxe, et par parce que la taxe en elle même dénote une certaine présomption de culpabilité…
{/parenthèse}

re

j ai utilise grub-install

Je boot sur le DD correpondant dans le Bios–>ecran habituel de grub,ca a l’air OK.Seulement,erreur 22 au choix de l’OS,il ne trouve rien a booter en hd2,5 ni en hd2,0

je galere en livecd,j’arrive meme pas a re;ettre grub en hd0

[code]grub> setup (hd0)
setup (hd0)

Error 12: Invalid device requested[/code]

toute aide est bienvenue

edit=qques infos

[code]grub> find /boot/grub/stage1
(hd0,0)
(hd2,0)
(hd2,5)

grub> [/code]

[code]### BEGIN AUTOMAGIC KERNELS LIST

lines between the AUTOMAGIC KERNELS LIST markers will be modified

by the debian update-grub script except for the default options below

DO NOT UNCOMMENT THEM, Just edit them to your needs

## Start Default Options

default kernel options

default kernel options for automagic boot options

If you want special options for specific kernels use kopt_x_y_z

where x.y.z is kernel version. Minor versions can be omitted.

e.g. kopt=root=/dev/hda1 ro

kopt_2_6_8=root=/dev/hdc1 ro

kopt_2_6_8_2_686=root=/dev/hdc2 ro

kopt=root=/dev/hdc6 ro quiet

default grub root device

e.g. groot=(hd0,0)

groot=(hd2,5)

should update-grub create alternative automagic boot options

e.g. alternative=true

alternative=false

alternative=true

should update-grub lock alternative automagic boot options

e.g. lockalternative=true

lockalternative=false

lockalternative=false

additional options to use with the default boot option, but not with the

alternatives

e.g. defoptions=vga=791 resume=/dev/hda5

defoptions=vga=775

should update-grub lock old automagic boot options

e.g. lockold=false

lockold=true

lockold=false

Xen hypervisor options to use with the default Xen boot option

xenhopt=

Xen Linux kernel options to use with the default Xen boot option

xenkopt=console=tty0

altoption boot targets option

multiple altoptions lines are allowed

e.g. altoptions=(extra menu suffix) extra boot options

altoptions=(single-user) single

altoptions=(single-user mode) single

controls how many kernels should be put into the menu.lst

only counts the first occurence of a kernel, not the

alternative kernel options

e.g. howmany=all

howmany=7

howmany=all

should update-grub create memtest86 boot option

e.g. memtest86=true

memtest86=false

memtest86=true

should update-grub adjust the value of the default booted system

can be true or false

updatedefaultentry=false

should update-grub add savedefault to the default options

can be true or false

savedefault=false

## End Default Options

title Debian GNU/Linux, kernel 2.6.24-1-686
root (hd2,5)
kernel /boot/vmlinuz-2.6.24-1-686 root=/dev/hdc6 ro quiet vga=775
initrd /boot/initrd.img-2.6.24-1-686

title Debian GNU/Linux, kernel 2.6.24-1-686 (single-user mode)
root (hd2,5)
kernel /boot/vmlinuz-2.6.24-1-686 root=/dev/hdc6 ro quiet single
initrd /boot/initrd.img-2.6.24-1-686

title Debian GNU/Linux, kernel 2.6.24-1-486
root (hd2,5)
kernel /boot/vmlinuz-2.6.24-1-486 root=/dev/hdc6 ro quiet vga=775
initrd /boot/initrd.img-2.6.24-1-486

title Debian GNU/Linux, kernel 2.6.24-1-486 (single-user mode)
root (hd2,5)
kernel /boot/vmlinuz-2.6.24-1-486 root=/dev/hdc6 ro quiet single
initrd /boot/initrd.img-2.6.24-1-486

title Debian GNU/Linux, kernel 2.6.22-3-k7
root (hd2,5)
kernel /boot/vmlinuz-2.6.22-3-k7 root=/dev/hdc6 ro quiet vga=775
initrd /boot/initrd.img-2.6.22-3-k7

title Debian GNU/Linux, kernel 2.6.22-3-k7 (single-user mode)
root (hd2,5)
kernel /boot/vmlinuz-2.6.22-3-k7 root=/dev/hdc6 ro quiet single
initrd /boot/initrd.img-2.6.22-3-k7

title Debian GNU/Linux, kernel 2.6.22-2-486
root (hd2,5)
kernel /boot/vmlinuz-2.6.22-2-486 root=/dev/hdc6 ro quiet vga=775
initrd /boot/initrd.img-2.6.22-2-486

title Debian GNU/Linux, kernel 2.6.22-2-486 (single-user mode)
root (hd2,5)
kernel /boot/vmlinuz-2.6.22-2-486 root=/dev/hdc6 ro quiet single
initrd /boot/initrd.img-2.6.22-2-486

END DEBIAN AUTOMAGIC KERNELS LIST

This is a divider, added to separate the menu items below from the Debian

ones.

title Other operating systems:
root

This entry automatically added by the Debian installer for an existing

linux installation on /dev/hda1.

#title Ubuntu, kernel 2.6.20-16-generic (on /dev/hda1)
#root (hd0,0)
#kernel /boot/vmlinuz-2.6.20-16-generic root=UUID=332c1508-2c45-4ac3-ae77-039bcaac1091 ro quiet splash
#initrd /boot/initrd.img-2.6.20-16-generic
#savedefault
#boot

This entry automatically added by the Debian installer for an existing

linux installation on /dev/hda1.

#title Ubuntu, kernel 2.6.20-16-generic (recovery mode) (on /dev/hda1)
#root (hd0,0)
#kernel /boot/vmlinuz-2.6.20-16-generic root=UUID=332c1508-2c45-4ac3-ae77-039bcaac1091 ro single
#initrd /boot/initrd.img-2.6.20-16-generic
#savedefault
#boot

This entry automatically added by the Debian installer for an existing

##linux installation on /dev/hda1.
#title Ubuntu, kernel 2.6.20-15-generic (on /dev/hda1)
#root (hd0,0)
#kernel /boot/vmlinuz-2.6.20-15-generic root=UUID=332c1508-2c45-4ac3-ae77-039bcaac1091 ro quiet splash
#initrd /boot/initrd.img-2.6.20-15-generic
#savedefault
#boot

This entry automatically added by the Debian installer for an existing

linux installation on /dev/hda1.

#title Ubuntu, kernel 2.6.20-15-generic (recovery mode) (on /dev/hda1)
#root (hd0,0)
#kernel /boot/vmlinuz-2.6.20-15-generic root=UUID=332c1508-2c45-4ac3-ae77-039bcaac1091 ro single
#initrd /boot/initrd.img-2.6.20-15-generic
#savedefault
#boot

This entry automatically added by the Debian installer for an existing

linux installation on /dev/hda1.

#title Ubuntu, memtest86+ (on /dev/hda1)
#root (hd0,0)
#kernel /boot/memtest86+.bin
#savedefault
#boot

This entry automatically added by the Debian installer for an existing

linux installation on /dev/hdc1.

title Ubuntu 7.10, kernel 2.6.22-14-generic (on /dev/hdc1)
root (hd2,0)
kernel /boot/vmlinuz-2.6.22-14-generic root=UUID=9a73c987-7f4c-4037-aac0-9f51401c8954 ro splash vga=775
initrd /boot/initrd.img-2.6.22-14-generic
savedefault
boot

This entry automatically added by the Debian installer for an existing

linux installation on /dev/hdc1.

title Ubuntu 7.10, kernel 2.6.22-14-generic (recovery mode) (on /dev/hdc1)
root (hd2,0)
kernel /boot/vmlinuz-2.6.22-14-generic root=UUID=9a73c987-7f4c-4037-aac0-9f51401c8954 ro single
initrd /boot/initrd.img-2.6.22-14-generic
savedefault
boot

This entry automatically added by the Debian installer for an existing

linux installation on /dev/hdc1.

title Ubuntu 7.10, memtest86+ (on /dev/hdc1)
root (hd2,0)
kernel /boot/memtest86+.bin
savedefault
boot
[/code]

re-

grub reste installé sur le premier disque.Je peux donc retrouver mon boot habituel en bootant à nouveau sur ce vieux DD dans le bios.

quelque chose m’echappe:pourquoi ça roule avec celui installé en hd0 , alors que le grub installé en hdc (ou hd2) ne fonctionne pas ? :

C’est une erreur du stage 2,je croyais que l’install ne modifiait que le stage 1 …?

Je vais relire le man plus en détail…

lu dans le man de grub:

[quote]Si vous installez GRUB sur une partition ou un disque autre que le premier, vous devez lancer GRUB depuis un autre chargeur. Consultez le manuel de votre chargeur pour savoir comment charger GRUB.[/quote]ça semble etre mon cas.

J’aimerai bien l’avis de quelqu’un qui a installé grub ailleurs que sur le MBR du premier disque,ou celui de quelqu’un qui pourrai confirmer si je comprends de travers ou non.

danke !

.

:smiley:

un grand merci tellmewhy !

effectivement,la sequence de boot du bios change les appellations de volume pour grub.la phrase du man:

[quote]Si vous installez GRUB sur une partition ou un disque autre que le premier, vous devez lancer GRUB depuis un autre chargeur[/quote]s’entend comme ça:un disque autre que celui déclaré en boot dans le bios.

le systeme boot maintenant nickel en editant le hd2,5 en hd0,5
lors de mon 1er essai,je n’avais pas débranché le 1er DD.Il y avait donc confusion de hd0.

Ce qui m’etonne,c’est que les affectations de volumes ne changent pas pour l’OS:le systeme a démarré sans soucis,les hda et hdb n’ont pas changés et restent fideles à leur places physiques sur les nappes.

depuis le temps que je voulais virer ce DD qui faisait autant de bruit qu’une machine à laver…

edit:
je viens d’éditer les menu.list et device.map,j’espere mettre en [resolu] au reboot!

.

en epilogue:

à la reflexion,ya-t-il un moyen de désinstaller Grub d’un MBR?J’ai rien vu dans le man à ce sujet.
une petite precision:
même sur un disque déjà utilisé,il y a donc un MBR où installer un boot-loader,l’endroit physique sur lequel pointe le bios quand il boot dessus et qui n’apparait pas dans les systemes.le MBR,c’est pas /boot/grub/stage 1…non?

.

merci pour ces dernieres precisions et pour ton aide !

:smt006