Contenu | Rechercher | Menus

Annonce

Si vous avez des soucis pour rester connecté, déconnectez-vous puis reconnectez-vous depuis ce lien en cochant la case
Me connecter automatiquement lors de mes prochaines visites.

À propos de l'équipe du forum.

#1 Le 05/09/2007, à 21:13

Alaman

[Résolu] Problème avec Grub, boot étrange

Bonjour à tous,

Aujourd'hui, j'ai installé Ubuntu 7.04 Feisty Fawn sur un disque dur externe connecté sur mon ordinateur portable par une prise USB.

Mon ordi dispose de Windows XP.

Mon problème, qui est un peu complexe, est le suivant :
1 - je ne peux booter sur XP lorsque le disque dur externe est déconnecté car il ne trouve pas Grub ;
2 - cependant lorsqu'il est connecté, grub s'affiche et me laisse le choix entre XP et Ubuntu, lorsque je suis sur Windows, je peux débrancher le disque dur sans qu'il n'empêche le fonctionnement de Windows ( mais si je redémarre, je reviens à la situation 1 )
3 - si je boote en premier sur le disque dur externe, il me dit que le système d'exploitation est manquant

Grub est pourtant bien installé sur le disque dur externe...

Voici le résultat de la commande sudo fdisk -l :

Disque /dev/sda: 120.0 Go, 120034123776 octets
255 têtes, 63 secteurs/piste, 14593 cylindres
Unités = cylindres de 16065 * 512 = 8225280 octets

Périphérique Amorce    Début         Fin      Blocs    Id  Système
/dev/sda1               1         510     4096543+  12  Compaq diagnostics
/dev/sda2   *         511        2296    14346045    c  W95 FAT32 (LBA)
/dev/sda3           12743       14593    14868157+   c  W95 FAT32 (LBA)
/dev/sda4            2297       12742    83907495    f  W95 Etendu (LBA)
/dev/sda5            2297        3602    10490413+   b  W95 FAT32
/dev/sda6            3603        6213    20972826    b  W95 FAT32
/dev/sda7            6214        7519    10490413+   b  W95 FAT32
/dev/sda8            7520        9478    15735636    b  W95 FAT32
/dev/sda9            9479       12742    26218048+   b  W95 FAT32

Les entrées de la table de partitions ne sont pas dans l'ordre du disque

Disque /dev/sdb: 13.0 Go, 13020069888 octets
255 têtes, 63 secteurs/piste, 1582 cylindres
Unités = cylindres de 16065 * 512 = 8225280 octets

Périphérique Amorce    Début         Fin      Blocs    Id  Système
/dev/sdb1   *           1        1510    12129043+  83  Linux
/dev/sdb2            1511        1582      578340    5  Extended
/dev/sdb5            1511        1582      578308+  82  Linux swap / Solaris

Et voici le contenu du fichier menu.lis

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

## hiddenmenu
# Hides the menu by default (press ESC to see the menu)
#hiddenmenu

# 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=UUID=d994b5a9-e4cb-4cfc-8896-80c482b81701 ro

## Setup crashdump menu entries
## e.g. crashdump=1
# crashdump=0

## default grub root device
## e.g. groot=(hd0,0)
# groot=(hd1,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=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=(recovery) single
# altoptions=(recovery 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

## ## End Default Options ##

title		Ubuntu, kernel 2.6.20-16-generic
root		(hd1,0)
kernel		/boot/vmlinuz-2.6.20-16-generic root=UUID=d994b5a9-e4cb-4cfc-8896-80c482b81701 ro quiet splash
initrd		/boot/initrd.img-2.6.20-16-generic
quiet
savedefault

title		Ubuntu, kernel 2.6.20-16-generic (recovery mode)
root		(hd1,0)
kernel		/boot/vmlinuz-2.6.20-16-generic root=UUID=d994b5a9-e4cb-4cfc-8896-80c482b81701 ro single
initrd		/boot/initrd.img-2.6.20-16-generic

title		Ubuntu, kernel 2.6.20-15-generic
root		(hd1,0)
kernel		/boot/vmlinuz-2.6.20-15-generic root=UUID=d994b5a9-e4cb-4cfc-8896-80c482b81701 ro quiet splash
initrd		/boot/initrd.img-2.6.20-15-generic
quiet
savedefault

title		Ubuntu, kernel 2.6.20-15-generic (recovery mode)
root		(hd1,0)
kernel		/boot/vmlinuz-2.6.20-15-generic root=UUID=d994b5a9-e4cb-4cfc-8896-80c482b81701 ro single
initrd		/boot/initrd.img-2.6.20-15-generic

title		Ubuntu, memtest86+
root		(hd1,0)
kernel		/boot/memtest86+.bin
quiet

### 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 a non-linux OS
# on /dev/sda1
title		Windows NT/2000/XP
root		(hd0,0)
savedefault
makeactive
chainloader	+1


# This entry automatically added by the Debian installer for a non-linux OS
# on /dev/sda2
title		Microsoft Windows XP dition familiale
root		(hd0,1)
savedefault
makeactive
chainloader	+1

Ainsi Ubuntu et Windows fonctionne de facon correcte, mais j'aimerais ne pas avoir à brancher le disque dur externe pour pouvoir aller sur XP...

Merci !

Dernière modification par Alaman (Le 06/09/2007, à 10:42)

Hors ligne

#2 Le 05/09/2007, à 21:30

Compte anonymisé

Re : [Résolu] Problème avec Grub, boot étrange

Salut

La solution, si ton bios est capable de booter sur usb (ce doit être le cas), de booter sur usb pour linux et sur ton disque fixe pour xp.

Pour ce faire, il est necessaire de modifier ton fichier menu.lst
après une save bien sûr :
sudo cp /boot/grub/menu.lst  /boot/grub/menu.sov
puis tu modifies la valeur :
# groot=(hd1,0) par
# groot=(hd0,0) , tu quittes et tu tapes la cmd :
sudo update-grub

Tu peux vérifier maintenant que les root (hd1,0) sont devenus des root (hd0,0)

Ensuite il faut installer le boot loader de grub sur /dev/sdb (qui deviendra /dev/sda)
Donc tu lances la commande grub :
sudo grub --> GRUB>
Là tu tapes :
root (hd1,0) puis
setup (hd1) puis
quit là tu tentes de booter sur l'usb
Normalement ça devrait être bon.

Si c'est ok  tu modifies Xp :
Pour Xp il faudra à l'aide d'un cd Xp (console de récupération) restaurer le MBR Xp par la commande :
fixmbr

Je pense que ça devrait être bon

@+

#3 Le 06/09/2007, à 09:36

Alaman

Re : [Résolu] Problème avec Grub, boot étrange

Salut et merci !

Ta solution a parfaitement marché.

Quand le DD externe n'est branché pas, il boote bien sur Windows, et quand il l'est Grub s'affiche big_smile .

J'ai trouvé un truc utile, il existe une méthode pour créer un CD avec la console de récupération de Windows XP, on la trouve ici : http://www.cybersolus.net/windows/windo … ation.html

Merci encore !

Hors ligne

#4 Le 06/09/2007, à 09:53

Compte anonymisé

Re : [Résolu] Problème avec Grub, boot étrange

Salut

Très bien. Juste une petite chose supplémentaire :
Si tu veux démarrer ton Xp depuis le menu de boot Grub (on ne sait jamais) il faut modifier ainsi le paragraphe windows dans menu.lst :

Ancien :

### 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 a non-linux OS
# on /dev/sda1
title        Windows NT/2000/XP
root        (hd0,0)
savedefault
makeactive
chainloader    +1


# This entry automatically added by the Debian installer for a non-linux OS
# on /dev/sda2
title        Microsoft Windows XP dition familiale
root        (hd0,1)
savedefault
makeactive
chainloader    +1

Nouveau :

### 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 a non-linux OS
# on /dev/sda2
title        Microsoft Windows XP edition familiale
root        (hd1,1)
savedefault
makeactive
map       (hd0) (hd1)
map       (hd1) (hd0)
chainloader    +1

Je ne pense pas que le boot sur /dev/sda1 du disque fixe ait un intéret car il s'agit de la partition de recovery je pense.

Un dernier conseil, si tu ne l'as pas encore fait, pense à créer sur ton Xp les cd ou dvd de recovery.

Sur ce
@+

#5 Le 06/09/2007, à 10:42

Alaman

Re : [Résolu] Problème avec Grub, boot étrange

Salut !

J'ai remplacé les morceaux indiqués, et maintenant, tout marche correctement.

Quand à XP, les masters CD sont faits ..

A plus !

Hors ligne

#6 Le 19/09/2007, à 17:50

sirius10

Re : [Résolu] Problème avec Grub, boot étrange

idem pour moi merci cool


"Pour ce qui est de l'Avenir, il ne s’agit pas de le prévoir, mais de le rendre possible."     
Antoine de Saint-Exupéry

Hors ligne