Déplacer Grub sur une autre partition

Bonjour à tous,

Je voudrait savoir si il est possible de déplacer grub sur une autre partition. Car en fait j’ai un souci

Avant de passer a debian j’etait sous ubuntu sur mon disque 40g et maintenant j’ai installer la debian sur un disque dur 70giga (ubuntu n’est plus sur le disque dur de 40g aucune partition sur ce disque).

Et je voulais débrancher le 40giga et la je me suis rendu compte que si je débranche le 40giga, grub ne s’affichait plus (je reste avec un curseur et c’est tout).

Donc j’en déduit que le boot est installer sur le disque dur de 40g.

Et donc c’est pour ça que je veut savoir si il est possible de déplacer le boot (grub) sur une autre partition.

Merci

Guigui69

Bonne Année

.

Merci pour ta réponse.

Concernant le vieux disque dur (40g) actuellement il y n’ a plus rien dessus, mais il doit avoir le mbr dessus.

Le nouveau disque est brancher avec debian dessus il fonctionne. La par exemple je suis dessus car j’ai rebrancher le vieux disque dur. Le déplacement de la 1er partie de grub sur un autre disque peut-elle être fait depuis debian directement ou bien je suis obliger de passer par un live cd.

merci

guigui69

.

Oui, :slightly_smiling:

Je voulait savoir si je pouvait faire les manipulation (celle indique sur le site web que tu ma donné) depuis ma debian ou bien faut-il passer par un live cd.

find /boot/grub/stage1
(hd2,0)

Comment je peut connaitre le hd pour le disque dur ou je veut installer le mbr?

Merci

guigui69

.

D’accord,

oui j’ai 3 disque dur.

1/ 40giga la ou il n’y a plus que le mbr
2/ 74gi ou il y a debian.
3/ 150g sert pour les données.

Donc si j’ai bien compris, j’enlève mon disque dur en trop (40g), je boot avec un live CD (ubuntu ca marche comme live CD?)
(j’en aurait un lundi)
Et la je fait les commandes indiqué? c’est bien ça?

Comment je fait pour connaitre le hd ou je veut installer la 1 partie de grub? Pour qu’il me le mette bien sur le 74g et pas sur le 150g

Merci

guigui69

.

.

Salut,

Tu peux faire les modifications depuis ubuntu.

Les commandes sont:

sudo grub setup (hd2) (hd2,0) quit
:slightly_smiling:
Il te faudra adapter le menu.lst si les uuids ne
sont pas utilisés pour pointer les partitions.

Remarque: Il y a super grub disk (quelque mo) qui
permet de faire les manipulations et ainsi d’éviter
de passer par un live cd (700mo) d’une distribution comme ubuntu, mandriva etc…

Bonsoir à tous,

je suis sous ubuntu

(les code dessous on été fait avec juste le disque 74 et 150 Gi, le 40gi était enlevé)

sudo grub

find /boot/grub/stage1
(hd0,0)

la j’ai bien ma liste qui apparait mais quand je clic dessus il me sort qu’il ne trouve pas le disque dur.

root(hd2,0)
error 21 selected disk does not exist

Comment corriger mon erreur ?

Merci

guigui69

.

Ok,

au niveau du menu.lst:

# menu.lst - See: grub(8), info grub, update-grub(8)
#            grub-install(8), grub-floppy(8),
#            grub-md5-crypt, /usr/share/doc/grub
#            and /usr/share/doc/grub-doc/.

## default num
# Set the default entry to the entry number NUM. Numbering starts from 0, and
# the entry number 0 is the default if the command is not used.
#
# You can specify 'saved' instead of a number. In this case, the default entry
# is the entry saved with the command 'savedefault'.
# WARNING: If you are using dmraid do not change this entry to 'saved' or your
# array will desync and will not let you boot your system.
default         0

## timeout sec
# Set a timeout, in SEC seconds, before automatically booting the default entry
# (normally the first entry defined).
timeout         5

# Pretty colours
color cyan/blue white/blue

## password ['--md5'] passwd
# If used in the first section of a menu file, disable all interactive editing
# control (menu entry editor and command-line)  and entries protected by the
# command 'lock'
# e.g. password topsecret
## password --md5 $1$gLhU0/$aW78kHK1QfV3P2b2znUoe/
# password topsecret

#
# examples
#
# title         Windows 95/98/NT/2000
# root          (hd0,0)
# makeactive
# chainloader   +1
#
# title         Linux
# root          (hd0,1)
# kernel        /vmlinuz root=/dev/hda2 ro
#

#
# Put static boot stanzas before and/or after AUTOMAGIC KERNEL LIST

### 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/sda1 ro

## default grub root device
## e.g. groot=(hd0,0)
# groot=(hd2,0)

## 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=792 quiet splash

## 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 ##

splashimage=(hd2,0)/boot/grub/splashimages/gentleblue.xpm.gz

title           Debian GNU/Linux, kernel 2.6.26-1-686
root            (hd2,0)
kernel          /boot/vmlinuz-2.6.26-1-686 root=/dev/sda1 ro vga=792 quiet splash
initrd          /boot/initrd.img-2.6.26-1-686

title           Debian GNU/Linux, kernel 2.6.26-1-686 (single-user mode)
root            (hd2,0)
kernel          /boot/vmlinuz-2.6.26-1-686 root=/dev/sda1 ro single
initrd          /boot/initrd.img-2.6.26-1-686

title           Debian GNU/Linux, kernel 2.6.24-etchnhalf.1-686
root            (hd2,0)
kernel          /boot/vmlinuz-2.6.24-etchnhalf.1-686 root=/dev/sda1 ro vga=792 quiet splash
initrd          /boot/initrd.img-2.6.24-etchnhalf.1-686

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

title           Debian GNU/Linux, kernel 2.6.18-6-686
root            (hd2,0)
kernel          /boot/vmlinuz-2.6.18-6-686 root=/dev/sda1 ro vga=792 quiet splash
initrd          /boot/initrd.img-2.6.18-6-686

title           Debian GNU/Linux, kernel 2.6.18-6-686 (single-user mode)
root            (hd2,0)
kernel          /boot/vmlinuz-2.6.18-6-686 root=/dev/sda1 ro single
initrd          /boot/initrd.img-2.6.18-6-686

title           Debian GNU/Linux, kernel 2.6.18-6-486
root            (hd2,0)
kernel          /boot/vmlinuz-2.6.18-6-486 root=/dev/sda1 ro vga=792 quiet splash
initrd          /boot/initrd.img-2.6.18-6-486

title           Debian GNU/Linux, kernel 2.6.18-6-486 (single-user mode)
root            (hd2,0)
kernel          /boot/vmlinuz-2.6.18-6-486 root=/dev/sda1 ro single
initrd          /boot/initrd.img-2.6.18-6-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

Disque /dev/sda: 163.9 Go, 163928604672 octets
255 heads, 63 sectors/track, 19929 cylinders
Units = cylindres of 16065 * 512 = 8225280 bytes
Disk identifier: 0x0000f657

Périphérique Amorce    Début         Fin      Blocs    Id  Système
/dev/sda1               1       19929   160079661    5  Extended
/dev/sda5               1       19929   160079629+  83  Linux

Disque /dev/sdb: 74.3 Go, 74355769344 octets
255 heads, 63 sectors/track, 9039 cylinders
Units = cylindres of 16065 * 512 = 8225280 bytes
Disk identifier: 0x000675fa

Périphérique Amorce    Début         Fin      Blocs    Id  Système
/dev/sdb1               1        2480    19920568+  83  Linux
/dev/sdb2            2481        2735     2048287+  82  Linux swap / Solaris
/dev/sdb3            2736        9039    50636880    5  Extended
/dev/sdb5            2736        9039    50636848+  83  Linux
ubuntu@ubuntu:~$ 

163g IDE 74g SATA

merci

guigui69

.

.

voila ce que me donne la commande

Disque /dev/sdb : 9039,231,23
Taille des secteurs (logique/physique) : 512o/512o
Géométrie BIOS (cylindre, tête, secteur) : 9039,255,63. Chaque cylindre est 8225kB.
Table de partitions : msdos

Numéro  Début     Fin          Type      Système de fichiers  Fanions
 1      0,1,0     2479,254,62  primaire  ext3                        
 2      2480,0,0  2734,254,62  primaire  linux-swap                  
 3      2735,0,0  9038,254,62  étendue                               
 5      2735,1,0  9038,254,62  logique   ext3                        

Information: Ne pas oublier de mettre à jour /etc/fstab si nécessaire.   

.

j’ai modifié les ligne avec vim

ubuntu@ubuntu:~$ sudo update-grub
Searching for GRUB installation directory ... 
No GRUB directory found. To create a template run 'mkdir /boot/grub' first. To install grub, install it manually or try the 'grub-install' command. ### Warning, grub-install is used to change your MBR. ###

comment résoudre ce probleme d’update-grub?

Merci

guigui69

.

ubuntu@ubuntu:~$ ls -R /mnt/truc/boot
/mnt/truc/boot:
config-2.6.18-6-486            initrd.img-2.6.18-6-486.bak            initrd.img-2.6.26-1-686.bak        vmlinuz-2.6.18-6-686
config-2.6.18-6-686            initrd.img-2.6.18-6-686                System.map-2.6.18-6-486            vmlinuz-2.6.24-etchnhalf.1-686
config-2.6.24-etchnhalf.1-686  initrd.img-2.6.18-6-686.bak            System.map-2.6.18-6-686            vmlinuz-2.6.26-1-686
config-2.6.26-1-686            initrd.img-2.6.24-etchnhalf.1-686      System.map-2.6.24-etchnhalf.1-686
grub                           initrd.img-2.6.24-etchnhalf.1-686.bak  System.map-2.6.26-1-686
initrd.img-2.6.18-6-486        initrd.img-2.6.26-1-686                vmlinuz-2.6.18-6-486

/mnt/truc/boot/grub:
default     e2fs_stage1_5  jfs_stage1_5  menu.lst~        menu.lstold     reiserfs_stage1_5  splash.xpm.gz      stage1  xfs_stage1_5
device.map  fat_stage1_5   menu.lst      menu.lst.backup  minix_stage1_5  splashimages       splash.xpm.gz.old  stage2

/mnt/truc/boot/grub/splashimages:
bike_gua.xpm.gz     debblue.xpm.gz                debsplash.xpm.gz  gentleblue.xpm.gz     guitar.xpm.gz
biosplash.xpm.gz    debian_grey1-14col.xpm.gz     fiesta.xpm.gz     gnome-debblue.xpm.gz  gunhole.xpm.gz
CRW_7206_14.xpm.gz  debian-moreblue-swirl.xpm.gz  firework.xpm.gz   gnucheese.xpm.gz      menu-sta.xpm.gz