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 16/12/2011, à 13:10

malbo

Howto_identifier une install cassée de Ubuntu 11.10 en UEFI

Le problème arrive dans un PC UEFI lorsqu'on a supprimé le partitionnement d'origine type GPT du PC préinstallé  pour le remplacer par un partitionnement type MSDOS (avec MBR) et qu'on a fait un partitionnement manuel du disque dur sans créer une partition EFI (choix "Autre chose" à l'étape 3 de l'installation). Le propriétaire du PC ne sait pas ce que c'est que UEFI, encore moins qu'il faut créer une partition EFI et on aboutit à un Ubuntu qui ne peut pas démarrer, ni Windows 7 non plus d'ailleurs. Rien de veut démarrer.
A noter : j'ai laissé traîner des partitions FAT (sda7 et sda3) pour voir si l'installateur en utiliserait une comme partition EFI mais ça ne marche pas.

                  Boot Info Script 0.60    from 17 May 2011


============================= Boot Info Summary: ===============================

 => Grub2 (v1.99) is installed in the MBR of /dev/sda and looks at sector 1 of 
    the same hard drive for core.img. core.img is at this location and looks 
    for (,msdos5)/boot/grub on this drive.

sda1: __________________________________________________________________________

    File system:       ntfs
    Boot sector type:  Windows Vista/7
    Boot sector info:   No errors found in the Boot Parameter Block.
    Operating System:  Windows 7
    Boot files:        /bootmgr /Boot/BCD /Windows/System32/winload.exe 
                       

sda2: __________________________________________________________________________

    File system:       Extended Partition
    Boot sector type:  -
    Boot sector info:  

sda5: __________________________________________________________________________

    File system:       ext4
    Boot sector type:  -
    Boot sector info:  
    Operating System:  Ubuntu 11.10
    Boot files:        /boot/grub/grub.cfg /etc/fstab

sda6: __________________________________________________________________________

    File system:       swap
    Boot sector type:  -
    Boot sector info:  

sda7: __________________________________________________________________________

    File system:       vfat
    Boot sector type:  -
    Boot sector info:   No errors found in the Boot Parameter Block.
    Operating System:  
    Boot files:        

sda8: __________________________________________________________________________

    File system:       ntfs
    Boot sector type:  Windows Vista/7
    Boot sector info:   No errors found in the Boot Parameter Block.
    Operating System:  
    Boot files:        

sda3: __________________________________________________________________________

    File system:       vfat
    Boot sector type:  FAT16
    Boot sector info:   According to the info in the boot sector, sda3 starts 
                       at sector 0. But according to the info from fdisk, 
                       sda3 starts at sector 170375168. According to the info 
                       in the boot sector, sda3 has 0 sectors.
    Operating System:  
    Boot files:        

============================ Drive/Partition Info: =============================

Drive: sda _____________________________________________________________________

Disk /dev/sda: 87.3 GB, 87253057536 bytes
255 heads, 63 sectors/track, 10607 cylinders, total 170416128 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes

Partition  Boot  Start Sector    End Sector  # of Sectors  Id System

/dev/sda1    *          2,048    50,438,143    50,436,096   7 NTFS / exFAT / HPFS
/dev/sda2          50,440,190   168,321,023   117,880,834   5 Extended
/dev/sda5          50,440,192    69,969,919    19,529,728  83 Linux
/dev/sda6          69,971,968    71,923,711     1,951,744  82 Linux swap / Solaris
/dev/sda7          71,925,760   118,519,383    46,593,624   b W95 FAT32
/dev/sda8         118,519,808   168,321,023    49,801,216  83 Linux
/dev/sda3         170,375,168   170,416,127        40,960   6 FAT16


"blkid" output: ________________________________________________________________

Device           UUID                                   TYPE       LABEL

/dev/loop0                                              squashfs   
/dev/sda1        FE743D36743CF34F                       ntfs       OS
/dev/sda3        D914-FC35                              vfat       
/dev/sda5        53afb60e-01ea-4427-aed5-128c2412e04d   ext4       
/dev/sda6        d577ef3d-9191-4c1b-8e51-7de9469c16e0   swap       
/dev/sda7        721A-7C95                              vfat       
/dev/sda8        791CB45A56DB4A87                       ntfs       

================================ Mount points: =================================

Device           Mount_Point              Type       Options

/dev/loop0       /rofs                    squashfs   (ro,noatime)
/dev/sr0         /cdrom                   iso9660    (ro,noatime)



=========================== sda5/boot/grub/grub.cfg: ===========================

--------------------------------------------------------------------------------
#
# DO NOT EDIT THIS FILE
#
# It is automatically generated by grub-mkconfig using templates
# from /etc/grub.d and settings from /etc/default/grub
#

### BEGIN /etc/grub.d/00_header ###
if [ -s $prefix/grubenv ]; then
  set have_grubenv=true
  load_env
fi
set default="0"
if [ "${prev_saved_entry}" ]; then
  set saved_entry="${prev_saved_entry}"
  save_env saved_entry
  set prev_saved_entry=
  save_env prev_saved_entry
  set boot_once=true
fi

function savedefault {
  if [ -z "${boot_once}" ]; then
    saved_entry="${chosen}"
    save_env saved_entry
  fi
}

function recordfail {
  set recordfail=1
  if [ -n "${have_grubenv}" ]; then if [ -z "${boot_once}" ]; then save_env recordfail; fi; fi
}

function load_video {
  insmod efi_gop
  insmod efi_uga
  insmod video_bochs
  insmod video_cirrus
}

insmod part_msdos
insmod ext2
set root='(hd0,msdos5)'
search --no-floppy --fs-uuid --set=root 53afb60e-01ea-4427-aed5-128c2412e04d
if loadfont /usr/share/grub/unicode.pf2 ; then
  set gfxmode=auto
  load_video
  insmod gfxterm
  insmod part_msdos
  insmod ext2
  set root='(hd0,msdos5)'
  search --no-floppy --fs-uuid --set=root 53afb60e-01ea-4427-aed5-128c2412e04d
  set locale_dir=($root)/boot/grub/locale
  set lang=fr_FR
  insmod gettext
fi
terminal_output gfxterm
if [ "${recordfail}" = 1 ]; then
  set timeout=-1
else
  set timeout=10
fi
### END /etc/grub.d/00_header ###

### BEGIN /etc/grub.d/05_debian_theme ###
set menu_color_normal=white/black
set menu_color_highlight=black/light-gray
if background_color 44,0,30; then
  clear
fi
### END /etc/grub.d/05_debian_theme ###

### BEGIN /etc/grub.d/10_linux ###
if [ ${recordfail} != 1 ]; then
  if [ -e ${prefix}/gfxblacklist.txt ]; then
    if hwmatch ${prefix}/gfxblacklist.txt 3; then
      if [ ${match} = 0 ]; then
        set linux_gfx_mode=keep
      else
        set linux_gfx_mode=text
      fi
    else
      set linux_gfx_mode=text
    fi
  else
    set linux_gfx_mode=keep
  fi
else
  set linux_gfx_mode=text
fi
export linux_gfx_mode
if [ "$linux_gfx_mode" != "text" ]; then load_video; fi
menuentry 'Ubuntu, avec Linux 3.0.0-12-generic' --class ubuntu --class gnu-linux --class gnu --class os {
    recordfail
    set gfxpayload=$linux_gfx_mode
    insmod gzio
    insmod part_msdos
    insmod ext2
    set root='(hd0,msdos5)'
    search --no-floppy --fs-uuid --set=root 53afb60e-01ea-4427-aed5-128c2412e04d
    linux    /boot/vmlinuz-3.0.0-12-generic root=UUID=53afb60e-01ea-4427-aed5-128c2412e04d ro   quiet splash vt.handoff=7
    initrd    /boot/initrd.img-3.0.0-12-generic
}
menuentry 'Ubuntu, avec Linux 3.0.0-12-generic (mode de dépannage)' --class ubuntu --class gnu-linux --class gnu --class os {
    recordfail
    insmod gzio
    insmod part_msdos
    insmod ext2
    set root='(hd0,msdos5)'
    search --no-floppy --fs-uuid --set=root 53afb60e-01ea-4427-aed5-128c2412e04d
    echo    'Chargement de Linux 3.0.0-12-generic ...'
    linux    /boot/vmlinuz-3.0.0-12-generic root=UUID=53afb60e-01ea-4427-aed5-128c2412e04d ro recovery nomodeset 
    echo    'Chargement du disque mémoire initial ...'
    initrd    /boot/initrd.img-3.0.0-12-generic
}
### END /etc/grub.d/10_linux ###

### BEGIN /etc/grub.d/20_linux_xen ###
### END /etc/grub.d/20_linux_xen ###

### BEGIN /etc/grub.d/20_memtest86+ ###
menuentry "Memory test (memtest86+)" {
    insmod part_msdos
    insmod ext2
    set root='(hd0,msdos5)'
    search --no-floppy --fs-uuid --set=root 53afb60e-01ea-4427-aed5-128c2412e04d
    linux16    /boot/memtest86+.bin
}
menuentry "Memory test (memtest86+, serial console 115200)" {
    insmod part_msdos
    insmod ext2
    set root='(hd0,msdos5)'
    search --no-floppy --fs-uuid --set=root 53afb60e-01ea-4427-aed5-128c2412e04d
    linux16    /boot/memtest86+.bin console=ttyS0,115200n8
}
### END /etc/grub.d/20_memtest86+ ###

### BEGIN /etc/grub.d/30_os-prober ###
menuentry "Windows 7 (loader) (on /dev/sda1)" --class windows --class os {
    insmod part_msdos
    insmod ntfs
    set root='(hd0,msdos1)'
    search --no-floppy --fs-uuid --set=root FE743D36743CF34F
    chainloader +1
}
### END /etc/grub.d/30_os-prober ###

### BEGIN /etc/grub.d/40_custom ###
# This file provides an easy way to add custom menu entries.  Simply type the
# menu entries you want to add after this comment.  Be careful not to change
# the 'exec tail' line above.
### END /etc/grub.d/40_custom ###

### BEGIN /etc/grub.d/41_custom ###
if [ -f  $prefix/custom.cfg ]; then
  source $prefix/custom.cfg;
fi
### END /etc/grub.d/41_custom ###
--------------------------------------------------------------------------------

=============================== sda5/etc/fstab: ================================

--------------------------------------------------------------------------------
# /etc/fstab: static file system information.
#
# Use 'blkid' to print the universally unique identifier for a
# device; this may be used with UUID= as a more robust way to name devices
# that works even if disks are added and removed. See fstab(5).
#
# <file system> <mount point>   <type>  <options>       <dump>  <pass>
proc            /proc           proc    nodev,noexec,nosuid 0       0
# / was on /dev/sda5 during installation
UUID=53afb60e-01ea-4427-aed5-128c2412e04d /               ext4    errors=remount-ro 0       1
# swap was on /dev/sda6 during installation
UUID=d577ef3d-9191-4c1b-8e51-7de9469c16e0 none            swap    sw              0       0
--------------------------------------------------------------------------------

=================== sda5: Location of files loaded by Grub: ====================

           GiB - GB             File                                 Fragment(s)

               =                boot/grub/grub.cfg                             1
               =                boot/initrd.img-3.0.0-12-generic               1
               =                boot/vmlinuz-3.0.0-12-generic                  1
               =                initrd.img                                     1
               =                vmlinuz                                        1

Les signes qui trahissent l'installation faite en mode UEFI :

1) l'absence de fichier core.img dans la partition Ubuntu :

sda5: __________________________________________________________________________

    File system:       ext4
    Boot sector type:  -
    Boot sector info:  
    Operating System:  Ubuntu 11.10
    Boot files:        /boot/grub/grub.cfg /etc/fstab

2) la présence dans le fichier grub.cfg de deux lignes qui contiennent les termes efi_gop et efi_uga :

function load_video {
  insmod efi_gop
  insmod efi_uga
  

Pourquoi les signes sont si minces ? Parce que le Boot Info Script dans sa version 0.60 disponible actuellement n'a pas été conçu pour détecter finement d'autres indices d'une installation de Ubuntu faite en UEFI.
Ce qu'on ne voit pas dans ce rapport Boot Info Script mais qui est la réalité de cette installation : c'est la version grub-efi qui est installée (et pas la version grub-pc) et de plus cette installation ne possède pas d'amorceur. On pourrait croire que ceci est fonctionnel :

 => Grub2 (v1.99) is installed in the MBR of /dev/sda and looks at sector 1 of 
    the same hard drive for core.img. core.img is at this location and looks 
    for (,msdos5)/boot/grub on this drive.

Il n'en est rien. cet amorceur est une relique d'une installation précédente de Ubuntu qui occupait la même partition. Il ne fonctionne pas pour démarrer l'installation actuelle de Ubuntu. Si je change le mode de fonctionnement du "Bios" pour que le disque dur soit démarré en mode Bios plutôt qu'en mode UEFI, Grub ne démarre pas et j'ai ce message d'erreur :

error: invalid arch independent ELF magic.
grub rescue> _

Dernière modification par malbo (Le 16/12/2011, à 14:11)

Hors ligne

#2 Le 16/12/2011, à 16:15

malbo

Re : Howto_identifier une install cassée de Ubuntu 11.10 en UEFI

Réparation depuis une session live de Ubuntu 11.10 : elle va consister à créer les éléments manquants pour que le démarrage en UEFI permette d'accéder à Ubuntu.
Dans ce qui suit, j'ai adapté cette procédure : http://forum.ubuntu-fr.org/viewtopic.ph … 1#p7281381
dans laquelle la partition EFI existait mais avait été écrasée, ce qui est un poil différent du cas présent.

1) lancement de Gparted et je passe la partition sda3 en "boot" (Manage Flags) afin qu'elle soit vue par Grub comme la partition EFI. Je ressors de Gparted.

2) CHROOT dans la partition Ubuntu (sda5)  :

ubuntu@ubuntu:~$ sudo mkdir /mnt/temp
ubuntu@ubuntu:~$ sudo mount /dev/sda5 /mnt/temp
ubuntu@ubuntu:~$ for i in /dev /dev/pts /proc /sys; do sudo mount -B $i /mnt/temp$i;  done
ubuntu@ubuntu:~$ sudo chroot /mnt/temp

3) dans le CHROOT, commande blkid pour récupérer l'UUID de la partition sda3 :

root@ubuntu:/# blkid -g
root@ubuntu:/# blkid
/dev/loop0: TYPE="squashfs" 
/dev/sda1: LABEL="OS" UUID="FE743D36743CF34F" TYPE="ntfs" 
/dev/sda3: SEC_TYPE="msdos" UUID="D914-FC35" TYPE="vfat" 
/dev/sda5: UUID="53afb60e-01ea-4427-aed5-128c2412e04d" TYPE="ext4" 
/dev/sda6: UUID="d577ef3d-9191-4c1b-8e51-7de9469c16e0" TYPE="swap" 
/dev/sda7: UUID="721A-7C95" TYPE="vfat" 
/dev/sda8: UUID="791CB45A56DB4A87" TYPE="ntfs" 

4) ajout dans le fstab de la ligne de montage de la partition EFI (sda3) dans /boot/efi (en utilisant l'éditeur de texte en ligne de commande nano ) :

root@ubuntu:/# nano /etc/fstab

ici, avec nano, insertion de la ligne pour montage /boot/efi en utilisant UUID de /dev/sda3 (je peux pas tout détailler...)
Quand c'est modifié, je vérifie que c'est bien passé (c'est OK, j'ai bien une nouvelle ligne "UUID=D914-FC35  /boot/efi       vfat    defaults        0       1") :

root@ubuntu:/# cat /etc/fstab
# /etc/fstab: static file system information.
#
# Use 'blkid' to print the universally unique identifier for a
# device; this may be used with UUID= as a more robust way to name devices
# that works even if disks are added and removed. See fstab(5).
#
# <file system> <mount point>   <type>  <options>       <dump>  <pass>
proc            /proc           proc    nodev,noexec,nosuid 0       0
# / was on /dev/sda5 during installation
UUID=53afb60e-01ea-4427-aed5-128c2412e04d /               ext4    errors=remount-ro 0       1
# swap was on /dev/sda6 during installation
UUID=d577ef3d-9191-4c1b-8e51-7de9469c16e0 none            swap    sw              0       0
UUID=D914-FC35  /boot/efi       vfat    defaults        0       1

5) montage de la partition EFI et installation automatique par le commande grub-install de l'amorceur de grub ( grubx64.efi) dans cette partition :

root@ubuntu:/# mkdir /boot/efi
root@ubuntu:/# mount /boot/efi
root@ubuntu:/# grub-install
BootCurrent: 0000
BootOrder: 000E,0000,0001,0004,001E,0025,0026,0027,0028,0029,002A,002B,0005,0006,0007,0008,0009,000A,001F,0020,0021,0022,0023,0024,0002,0003,000B,000C,000D
Boot0000* 0
Boot0001* 1
Boot0002* 1
Boot0003* 3
Boot0004* 0
Boot0005* 1
Boot0006* 2
Boot0007* 3
Boot0008* 4
Boot0009* 5
Boot000A* 6
Boot000B* 4
Boot000C* 5
Boot000D* 6
Boot001E* EFI Internal Shell
Boot001F* 1
Boot0020* 2
Boot0021* 3
Boot0022* 4
Boot0023* 5
Boot0024* 6
Boot0025* sda2_boot
Boot0026* sda3_boot
Boot0027* sda5_boot
Boot0028* sda6_boot
Boot0029* sda13_boot
Boot002A* sda14_boot
Boot002B* sda16_boot
Boot000E* ubuntu
Installation finished. No error reported.

Les entrées sda2_boot ...sda16_boot sont des entrées enregistrées "à la main" dans le système UEFI pour un multi-boot sur un autre disque dur qui est enlevé. Je le signale pour info mais ça n'a rien à voir avec le sujet du jour.
Vérification que l'amorceur grubx64.efi a bien été créé :

root@ubuntu:/# ls -l /boot/efi/EFI/ubuntu/grubx64.efi
-rwxr-xr-x 1 root root 131072 2011-12-16 15:08 /boot/efi/EFI/ubuntu/grubx64.efi

6)Sortie du CHROOT et démontage de sda5 :

root@ubuntu:/# exit
exit
ubuntu@ubuntu:~$ for i in /dev/pts /dev /proc /sys; do sudo umount /mnt/temp$i ; done

A redémarrage du PC (en mode UEFI bien sûr), je peux accéder à Ubuntu par le système UEFI. Par contre, je ne sais pas démarrer Win7 qui a été installé en "mode Bios" (c'est ballot).

----------------------------------------------------------------------------------------------------------

BootInfoScript apres reparation .

                  Boot Info Script 0.60    from 17 May 2011


============================= Boot Info Summary: ===============================

 => Grub2 (v1.99) is installed in the MBR of /dev/sda and looks at sector 1 of 
    the same hard drive for core.img. core.img is at this location and looks 
    for (,msdos5)/boot/grub on this drive.

sda1: __________________________________________________________________________

    File system:       ntfs
    Boot sector type:  Windows Vista/7
    Boot sector info:   No errors found in the Boot Parameter Block.
    Operating System:  Windows 7
    Boot files:        /bootmgr /Boot/BCD /Windows/System32/winload.exe 
                       
sda2: __________________________________________________________________________

    File system:       Extended Partition
    Boot sector type:  -
    Boot sector info:  

sda5: __________________________________________________________________________

    File system:       ext4
    Boot sector type:  -
    Boot sector info:  
    Operating System:  Ubuntu 11.10
    Boot files:        /boot/grub/grub.cfg /etc/fstab

sda6: __________________________________________________________________________

    File system:       swap
    Boot sector type:  -
    Boot sector info:  

sda7: __________________________________________________________________________

    File system:       vfat
    Boot sector type:  -
    Boot sector info:   No errors found in the Boot Parameter Block.
    Operating System:  
    Boot files:        

sda8: __________________________________________________________________________

    File system:       ntfs
    Boot sector type:  Windows Vista/7
    Boot sector info:   No errors found in the Boot Parameter Block.
    Operating System:  
    Boot files:        

sda3: __________________________________________________________________________

    File system:       vfat
    Boot sector type:  FAT16
    Boot sector info:   According to the info in the boot sector, sda3 starts 
                       at sector 0. But according to the info from fdisk, 
                       sda3 starts at sector 170375168. According to the info 
                       in the boot sector, sda3 has 0 sectors.
    Operating System:  
    Boot files:        

============================ Drive/Partition Info: =============================

Drive: sda _____________________________________________________________________

Disk /dev/sda: 87.3 GB, 87253057536 bytes
255 heads, 63 sectors/track, 10607 cylinders, total 170416128 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes

Partition  Boot  Start Sector    End Sector  # of Sectors  Id System

/dev/sda1               2,048    50,438,143    50,436,096   7 NTFS / exFAT / HPFS
/dev/sda2          50,440,190   168,321,023   117,880,834   5 Extended
/dev/sda5          50,440,192    69,969,919    19,529,728  83 Linux
/dev/sda6          69,971,968    71,923,711     1,951,744  82 Linux swap / Solaris
/dev/sda7          71,925,760   118,519,383    46,593,624   b W95 FAT32
/dev/sda8         118,519,808   168,321,023    49,801,216  83 Linux
/dev/sda3    *    170,375,168   170,416,127        40,960   6 FAT16


"blkid" output: ________________________________________________________________

Device           UUID                                   TYPE       LABEL

/dev/loop0                                              squashfs   
/dev/sda1        FE743D36743CF34F                       ntfs       OS
/dev/sda3        D914-FC35                              vfat       
/dev/sda5        53afb60e-01ea-4427-aed5-128c2412e04d   ext4       
/dev/sda6        d577ef3d-9191-4c1b-8e51-7de9469c16e0   swap       
/dev/sda7        721A-7C95                              vfat       
/dev/sda8        791CB45A56DB4A87                       ntfs       

================================ Mount points: =================================

Device           Mount_Point              Type       Options

/dev/loop0       /rofs                    squashfs   (ro,noatime)
/dev/sr0         /cdrom                   iso9660    (ro,noatime)


=========================== sda5/boot/grub/grub.cfg: ===========================

--------------------------------------------------------------------------------
#
# DO NOT EDIT THIS FILE
#
# It is automatically generated by grub-mkconfig using templates
# from /etc/grub.d and settings from /etc/default/grub
#

### BEGIN /etc/grub.d/00_header ###
if [ -s $prefix/grubenv ]; then
  set have_grubenv=true
  load_env
fi
set default="0"
if [ "${prev_saved_entry}" ]; then
  set saved_entry="${prev_saved_entry}"
  save_env saved_entry
  set prev_saved_entry=
  save_env prev_saved_entry
  set boot_once=true
fi

function savedefault {
  if [ -z "${boot_once}" ]; then
    saved_entry="${chosen}"
    save_env saved_entry
  fi
}

function recordfail {
  set recordfail=1
  if [ -n "${have_grubenv}" ]; then if [ -z "${boot_once}" ]; then save_env recordfail; fi; fi
}

function load_video {
  insmod efi_gop
  insmod efi_uga
  insmod video_bochs
  insmod video_cirrus
}

insmod part_msdos
insmod ext2
set root='(hd0,msdos5)'
search --no-floppy --fs-uuid --set=root 53afb60e-01ea-4427-aed5-128c2412e04d
if loadfont /usr/share/grub/unicode.pf2 ; then
  set gfxmode=auto
  load_video
  insmod gfxterm
  insmod part_msdos
  insmod ext2
  set root='(hd0,msdos5)'
  search --no-floppy --fs-uuid --set=root 53afb60e-01ea-4427-aed5-128c2412e04d
  set locale_dir=($root)/boot/grub/locale
  set lang=fr_FR
  insmod gettext
fi
terminal_output gfxterm
if [ "${recordfail}" = 1 ]; then
  set timeout=-1
else
  set timeout=10
fi
### END /etc/grub.d/00_header ###

### BEGIN /etc/grub.d/05_debian_theme ###
set menu_color_normal=white/black
set menu_color_highlight=black/light-gray
if background_color 44,0,30; then
  clear
fi
### END /etc/grub.d/05_debian_theme ###

### BEGIN /etc/grub.d/10_linux ###
if [ ${recordfail} != 1 ]; then
  if [ -e ${prefix}/gfxblacklist.txt ]; then
    if hwmatch ${prefix}/gfxblacklist.txt 3; then
      if [ ${match} = 0 ]; then
        set linux_gfx_mode=keep
      else
        set linux_gfx_mode=text
      fi
    else
      set linux_gfx_mode=text
    fi
  else
    set linux_gfx_mode=keep
  fi
else
  set linux_gfx_mode=text
fi
export linux_gfx_mode
if [ "$linux_gfx_mode" != "text" ]; then load_video; fi
menuentry 'Ubuntu, avec Linux 3.0.0-12-generic' --class ubuntu --class gnu-linux --class gnu --class os {
    recordfail
    set gfxpayload=$linux_gfx_mode
    insmod gzio
    insmod part_msdos
    insmod ext2
    set root='(hd0,msdos5)'
    search --no-floppy --fs-uuid --set=root 53afb60e-01ea-4427-aed5-128c2412e04d
    linux    /boot/vmlinuz-3.0.0-12-generic root=UUID=53afb60e-01ea-4427-aed5-128c2412e04d ro   quiet splash vt.handoff=7
    initrd    /boot/initrd.img-3.0.0-12-generic
}
menuentry 'Ubuntu, avec Linux 3.0.0-12-generic (mode de dépannage)' --class ubuntu --class gnu-linux --class gnu --class os {
    recordfail
    insmod gzio
    insmod part_msdos
    insmod ext2
    set root='(hd0,msdos5)'
    search --no-floppy --fs-uuid --set=root 53afb60e-01ea-4427-aed5-128c2412e04d
    echo    'Chargement de Linux 3.0.0-12-generic ...'
    linux    /boot/vmlinuz-3.0.0-12-generic root=UUID=53afb60e-01ea-4427-aed5-128c2412e04d ro recovery nomodeset 
    echo    'Chargement du disque mémoire initial ...'
    initrd    /boot/initrd.img-3.0.0-12-generic
}
### END /etc/grub.d/10_linux ###

### BEGIN /etc/grub.d/20_linux_xen ###
### END /etc/grub.d/20_linux_xen ###

### BEGIN /etc/grub.d/20_memtest86+ ###
menuentry "Memory test (memtest86+)" {
    insmod part_msdos
    insmod ext2
    set root='(hd0,msdos5)'
    search --no-floppy --fs-uuid --set=root 53afb60e-01ea-4427-aed5-128c2412e04d
    linux16    /boot/memtest86+.bin
}
menuentry "Memory test (memtest86+, serial console 115200)" {
    insmod part_msdos
    insmod ext2
    set root='(hd0,msdos5)'
    search --no-floppy --fs-uuid --set=root 53afb60e-01ea-4427-aed5-128c2412e04d
    linux16    /boot/memtest86+.bin console=ttyS0,115200n8
}
### END /etc/grub.d/20_memtest86+ ###

### BEGIN /etc/grub.d/30_os-prober ###
menuentry "Windows 7 (loader) (on /dev/sda1)" --class windows --class os {
    insmod part_msdos
    insmod ntfs
    set root='(hd0,msdos1)'
    search --no-floppy --fs-uuid --set=root FE743D36743CF34F
    chainloader +1
}
### END /etc/grub.d/30_os-prober ###

### BEGIN /etc/grub.d/40_custom ###
# This file provides an easy way to add custom menu entries.  Simply type the
# menu entries you want to add after this comment.  Be careful not to change
# the 'exec tail' line above.
### END /etc/grub.d/40_custom ###

### BEGIN /etc/grub.d/41_custom ###
if [ -f  $prefix/custom.cfg ]; then
  source $prefix/custom.cfg;
fi
### END /etc/grub.d/41_custom ###
--------------------------------------------------------------------------------

=============================== sda5/etc/fstab: ================================

--------------------------------------------------------------------------------
# /etc/fstab: static file system information.
#
# Use 'blkid' to print the universally unique identifier for a
# device; this may be used with UUID= as a more robust way to name devices
# that works even if disks are added and removed. See fstab(5).
#
# <file system> <mount point>   <type>  <options>       <dump>  <pass>
proc            /proc           proc    nodev,noexec,nosuid 0       0
# / was on /dev/sda5 during installation
UUID=53afb60e-01ea-4427-aed5-128c2412e04d /               ext4    errors=remount-ro 0       1
# swap was on /dev/sda6 during installation
UUID=d577ef3d-9191-4c1b-8e51-7de9469c16e0 none            swap    sw              0       0
UUID=D914-FC35  /boot/efi       vfat    defaults        0       1
--------------------------------------------------------------------------------

=================== sda5: Location of files loaded by Grub: ====================

           GiB - GB             File                                 Fragment(s)

               =                boot/grub/grub.cfg                             1
               =                boot/initrd.img-3.0.0-12-generic               1
               =                boot/vmlinuz-3.0.0-12-generic                  1
               =                initrd.img                                     1
               =                vmlinuz                                        1

On peut noter les changements par comparaison au BootInfoScript du post #1 :
- Dans la partie "Drive/Partition Info:", sda3 apparaît bien comme bootable (elle a le symbole *) alors qu'avant c'était la partition Windows (sda1) qui avait le "boot" :

/dev/sda3    *    170,375,168   170,416,127        40,960   6 FAT16

- Dans la partie "sda5/etc/fstab:", on voit bien que la partition EFI (sda3) est montée au démarrage :

UUID=D914-FC35  /boot/efi       vfat    defaults        0       1

Dernière modification par malbo (Le 16/12/2011, à 18:52)

Hors ligne

#3 Le 16/12/2011, à 18:20

malbo

Re : Howto_identifier une install cassée de Ubuntu 11.10 en UEFI

Epilogue :
Après des contorsions, je me retrouve avec une belle configuration bâtarde :
1) pour démarrer Windows 7, le passage par le menu Grub de Ubuntu ne fonctionne pas (le chainload entre le monde EFI et le monde Bios, ça ne doit pas le faire). Précisément, c'est cette partie du fichier grub.cfg qui n'est pas fonctionnelle :

menuentry "Windows 7 (loader) (on /dev/sda1)" --class windows --class os {
    insmod part_msdos
    insmod ntfs
    set root='(hd0,msdos1)'
    search --no-floppy --fs-uuid --set=root FE743D36743CF34F
    chainloader +1
}

Du coup, j'ai remis le boot sur la partition Win7 (sda1) et j'ai réparé le démarrage de Win7 avec le DVD Win7 ( amorceur Win7 dans le MBR et tout et tout) et ça marche...à condition que je démarre le PC en mode Bios (et pas en mode UEFI)
2) pour démarrer Ubuntu : je dois passer le PC en mode UEFI et ça marche aussi.
Après tout ça, voici l'état des lieux :

                  Boot Info Script 0.60    from 17 May 2011


============================= Boot Info Summary: ===============================

 => Windows is installed in the MBR of /dev/sda.

sda1: __________________________________________________________________________

    File system:       ntfs
    Boot sector type:  Windows Vista/7
    Boot sector info:   No errors found in the Boot Parameter Block.
    Operating System:  Windows 7
    Boot files:        /bootmgr /Boot/BCD /Windows/System32/winload.exe

sda2: __________________________________________________________________________

    File system:       Extended Partition
    Boot sector type:  -
    Boot sector info:  

sda5: __________________________________________________________________________

    File system:       ext4
    Boot sector type:  -
    Boot sector info:  
    Operating System:  Ubuntu 11.10
    Boot files:        /boot/grub/grub.cfg /etc/fstab

sda6: __________________________________________________________________________

    File system:       swap
    Boot sector type:  -
    Boot sector info:  

sda7: __________________________________________________________________________

    File system:       vfat
    Boot sector type:  -
    Boot sector info:   No errors found in the Boot Parameter Block.
    Operating System:  
    Boot files:        

sda8: __________________________________________________________________________

    File system:       ntfs
    Boot sector type:  Windows Vista/7
    Boot sector info:   No errors found in the Boot Parameter Block.
    Operating System:  
    Boot files:        

sda3: __________________________________________________________________________

    File system:       vfat
    Boot sector type:  FAT16
    Boot sector info:   According to the info in the boot sector, sda3 starts 
                       at sector 0. But according to the info from fdisk, 
                       sda3 starts at sector 170375168. According to the info 
                       in the boot sector, sda3 has 0 sectors.
    Operating System:  
    Boot files:        

============================ Drive/Partition Info: =============================

Drive: sda _____________________________________________________________________

Disk /dev/sda: 87.3 GB, 87253057536 bytes
255 heads, 63 sectors/track, 10607 cylinders, total 170416128 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes

Partition  Boot  Start Sector    End Sector  # of Sectors  Id System

/dev/sda1    *          2,048    50,438,143    50,436,096   7 NTFS / exFAT / HPFS
/dev/sda2          50,440,190   168,321,023   117,880,834   5 Extended
/dev/sda5          50,440,192    69,969,919    19,529,728  83 Linux
/dev/sda6          69,971,968    71,923,711     1,951,744  82 Linux swap / Solaris
/dev/sda7          71,925,760   118,519,383    46,593,624   b W95 FAT32
/dev/sda8         118,519,808   168,321,023    49,801,216  83 Linux
/dev/sda3         170,375,168   170,416,127        40,960   6 FAT16


"blkid" output: ________________________________________________________________

Device           UUID                                   TYPE       LABEL

/dev/loop0                                              squashfs   
/dev/sda1        FE743D36743CF34F                       ntfs       OS
/dev/sda3        D914-FC35                              vfat       
/dev/sda5        53afb60e-01ea-4427-aed5-128c2412e04d   ext4       
/dev/sda6        d577ef3d-9191-4c1b-8e51-7de9469c16e0   swap       
/dev/sda7        721A-7C95                              vfat       
/dev/sda8        791CB45A56DB4A87                       ntfs       

================================ Mount points: =================================

Device           Mount_Point              Type       Options

/dev/loop0       /rofs                    squashfs   (ro,noatime)
/dev/sr0         /cdrom                   iso9660    (ro,noatime)


=========================== sda5/boot/grub/grub.cfg: ===========================

--------------------------------------------------------------------------------
#
# DO NOT EDIT THIS FILE
#
# It is automatically generated by grub-mkconfig using templates
# from /etc/grub.d and settings from /etc/default/grub
#

### BEGIN /etc/grub.d/00_header ###
if [ -s $prefix/grubenv ]; then
  set have_grubenv=true
  load_env
fi
set default="0"
if [ "${prev_saved_entry}" ]; then
  set saved_entry="${prev_saved_entry}"
  save_env saved_entry
  set prev_saved_entry=
  save_env prev_saved_entry
  set boot_once=true
fi

function savedefault {
  if [ -z "${boot_once}" ]; then
    saved_entry="${chosen}"
    save_env saved_entry
  fi
}

function recordfail {
  set recordfail=1
  if [ -n "${have_grubenv}" ]; then if [ -z "${boot_once}" ]; then save_env recordfail; fi; fi
}

function load_video {
  insmod efi_gop
  insmod efi_uga
  insmod video_bochs
  insmod video_cirrus
}

insmod part_msdos
insmod ext2
set root='(hd0,msdos5)'
search --no-floppy --fs-uuid --set=root 53afb60e-01ea-4427-aed5-128c2412e04d
if loadfont /usr/share/grub/unicode.pf2 ; then
  set gfxmode=auto
  load_video
  insmod gfxterm
  insmod part_msdos
  insmod ext2
  set root='(hd0,msdos5)'
  search --no-floppy --fs-uuid --set=root 53afb60e-01ea-4427-aed5-128c2412e04d
  set locale_dir=($root)/boot/grub/locale
  set lang=fr_FR
  insmod gettext
fi
terminal_output gfxterm
if [ "${recordfail}" = 1 ]; then
  set timeout=-1
else
  set timeout=10
fi
### END /etc/grub.d/00_header ###

### BEGIN /etc/grub.d/05_debian_theme ###
set menu_color_normal=white/black
set menu_color_highlight=black/light-gray
if background_color 44,0,30; then
  clear
fi
### END /etc/grub.d/05_debian_theme ###

### BEGIN /etc/grub.d/10_linux ###
if [ ${recordfail} != 1 ]; then
  if [ -e ${prefix}/gfxblacklist.txt ]; then
    if hwmatch ${prefix}/gfxblacklist.txt 3; then
      if [ ${match} = 0 ]; then
        set linux_gfx_mode=keep
      else
        set linux_gfx_mode=text
      fi
    else
      set linux_gfx_mode=text
    fi
  else
    set linux_gfx_mode=keep
  fi
else
  set linux_gfx_mode=text
fi
export linux_gfx_mode
if [ "$linux_gfx_mode" != "text" ]; then load_video; fi
menuentry 'Ubuntu, avec Linux 3.0.0-12-generic' --class ubuntu --class gnu-linux --class gnu --class os {
    recordfail
    set gfxpayload=$linux_gfx_mode
    insmod gzio
    insmod part_msdos
    insmod ext2
    set root='(hd0,msdos5)'
    search --no-floppy --fs-uuid --set=root 53afb60e-01ea-4427-aed5-128c2412e04d
    linux    /boot/vmlinuz-3.0.0-12-generic root=UUID=53afb60e-01ea-4427-aed5-128c2412e04d ro   quiet splash vt.handoff=7
    initrd    /boot/initrd.img-3.0.0-12-generic
}
menuentry 'Ubuntu, avec Linux 3.0.0-12-generic (mode de dépannage)' --class ubuntu --class gnu-linux --class gnu --class os {
    recordfail
    insmod gzio
    insmod part_msdos
    insmod ext2
    set root='(hd0,msdos5)'
    search --no-floppy --fs-uuid --set=root 53afb60e-01ea-4427-aed5-128c2412e04d
    echo    'Chargement de Linux 3.0.0-12-generic ...'
    linux    /boot/vmlinuz-3.0.0-12-generic root=UUID=53afb60e-01ea-4427-aed5-128c2412e04d ro recovery nomodeset 
    echo    'Chargement du disque mémoire initial ...'
    initrd    /boot/initrd.img-3.0.0-12-generic
}
### END /etc/grub.d/10_linux ###

### BEGIN /etc/grub.d/20_linux_xen ###
### END /etc/grub.d/20_linux_xen ###

### BEGIN /etc/grub.d/20_memtest86+ ###
menuentry "Memory test (memtest86+)" {
    insmod part_msdos
    insmod ext2
    set root='(hd0,msdos5)'
    search --no-floppy --fs-uuid --set=root 53afb60e-01ea-4427-aed5-128c2412e04d
    linux16    /boot/memtest86+.bin
}
menuentry "Memory test (memtest86+, serial console 115200)" {
    insmod part_msdos
    insmod ext2
    set root='(hd0,msdos5)'
    search --no-floppy --fs-uuid --set=root 53afb60e-01ea-4427-aed5-128c2412e04d
    linux16    /boot/memtest86+.bin console=ttyS0,115200n8
}
### END /etc/grub.d/20_memtest86+ ###

### BEGIN /etc/grub.d/30_os-prober ###
menuentry "Windows 7 (loader) (on /dev/sda1)" --class windows --class os {
    insmod part_msdos
    insmod ntfs
    set root='(hd0,msdos1)'
    search --no-floppy --fs-uuid --set=root FE743D36743CF34F
    chainloader +1
}
### END /etc/grub.d/30_os-prober ###

### BEGIN /etc/grub.d/40_custom ###
# This file provides an easy way to add custom menu entries.  Simply type the
# menu entries you want to add after this comment.  Be careful not to change
# the 'exec tail' line above.
### END /etc/grub.d/40_custom ###

### BEGIN /etc/grub.d/41_custom ###
if [ -f  $prefix/custom.cfg ]; then
  source $prefix/custom.cfg;
fi
### END /etc/grub.d/41_custom ###
--------------------------------------------------------------------------------

=============================== sda5/etc/fstab: ================================

--------------------------------------------------------------------------------
# /etc/fstab: static file system information.
#
# Use 'blkid' to print the universally unique identifier for a
# device; this may be used with UUID= as a more robust way to name devices
# that works even if disks are added and removed. See fstab(5).
#
# <file system> <mount point>   <type>  <options>       <dump>  <pass>
proc            /proc           proc    nodev,noexec,nosuid 0       0
# / was on /dev/sda5 during installation
UUID=53afb60e-01ea-4427-aed5-128c2412e04d /               ext4    errors=remount-ro 0       1
# swap was on /dev/sda6 during installation
UUID=d577ef3d-9191-4c1b-8e51-7de9469c16e0 none            swap    sw              0       0
UUID=D914-FC35  /boot/efi       vfat    defaults        0       1
--------------------------------------------------------------------------------

=================== sda5: Location of files loaded by Grub: ====================

           GiB - GB             File                                 Fragment(s)

               =                boot/grub/grub.cfg                             1
               =                boot/initrd.img-3.0.0-12-generic               1
               =                boot/vmlinuz-3.0.0-12-generic                  1
               =                initrd.img                                     1
               =                vmlinuz                                        1

En résumé :
Pour aller dans Win7 > démarrage du PC en mode Bios
Pour aller dans Ubuntu > démarrage du PC en mode UEFI
C'est bien pourri. Donc, il vaut mieux réinstaller complètement Ubuntu en forçant bien le système UEFI du PC en mode Bios (et non pas en mode UEFI) afin que tout le monde, Win7 et Ubuntu et les autres OS éventuels soient en mode Bios.
Ou alors, il faut tout péter - c'est la bonne solution à mon avis - pour passer le disque dur en partitionnement GPT, réinstaller Win7 en UEFI et réinstaller Ubuntu en UEFI, de sorte que le mode Bios soit banni à jamais du PC. Je détaille une solution "prudente" pour réaliser ce type d'installation "tutti UEFI" dans ce "Howto_Installation prudente de Ubuntu 11.10 dans un PC UEFI" : http://forum.ubuntu-fr.org/viewtopic.php?id=757311

Dernière modification par malbo (Le 17/12/2011, à 16:24)

Hors ligne