Wheezy dualboot windows EFI/GRUB

Bonjour, ayant installé une debian sur un windows dont j’ai gardé la partition, je voudrais conserver le boot sur la partition dans le grub installé.
Mais update-grub ne détecte pas le système windows bien que présent:

[code]root@pb:/home/kmc# grub-install
BootCurrent: 0002
Timeout: 1 seconds
BootOrder: 0000,0001
Boot0000* P1: ST3500413AS
Boot0001* P2: HL-DT-ST DVDRAM GH70N
BootCurrent: 0002
Timeout: 1 seconds
BootOrder: 0002,0000,0001root@pb:/home/kmc# grub-install
BootCurrent: 0002
Timeout: 1 seconds
BootOrder: 0000,0001
Boot0000* P1: ST3500413AS
Boot0001* P2: HL-DT-ST DVDRAM GH70N
BootCurrent: 0002
Timeout: 1 seconds
BootOrder: 0002,0000,0001
Boot0000* P1: ST3500413AS
Boot0001* P2: HL-DT-ST DVDRAM GH70N
Boot0002* debian
Installation finished. No error reported.
root@pb:/home/kmc# update-grub
Generating grub.cfg …
Found background image: /usr/share/images/desktop-base/desktop-grub.png
Found linux image: /boot/vmlinuz-3.16.0-0.bpo.4-amd64
Found initrd image: /boot/initrd.img-3.16.0-0.bpo.4-amd64
Found linux image: /boot/vmlinuz-3.2.0-4-amd64
Found initrd image: /boot/initrd.img-3.2.0-4-amd64
done
root@pb:/home/kmc# ll /mnt/windows/
total 7209372
drwxrwxrwx 1 root root 4096 janv. 16 17:42 AdwCleaner
-rwxrwxrwx 2 root root 2189 avril 29 2014 AdwCleaner[R1].txt
drwxrwxrwx 1 root root 0 mars 25 2014 book
-rwxrwxrwx 1 root root 8192 mars 29 2012 BOOTSECT.BAK
drwxrwxrwx 1 root root 1048576 juin 25 21:18 Config.Msi
lrwxrwxrwx 2 root root 60 juil. 14 2009 Documents and Settings -> /mnt/windows/Users
-rwxrwxrwx 1 root root 3163365376 juil. 12 14:40 hiberfil.sys
drwxrwxrwx 1 root root 0 mars 24 17:00 inetpub
drwxrwxrwx 1 root root 0 mars 25 2014 Intel
drwxrwxrwx 1 root root 0 janv. 16 17:25 MSOCache
drwxrwxrwx 1 root root 8192 mars 25 2014 OEM
drwxrwxrwx 1 root root 0 mai 6 17:24 OneDriveTemp
-rwxrwxrwx 1 root root 4217823232 juil. 12 14:40 pagefile.sys
drwxrwxrwx 1 root root 0 juil. 14 2009 PerfLogs
drwxrwxrwx 1 root root 20480 mai 28 23:36 ProgramData
drwxrwxrwx 1 root root 8192 mai 28 23:42 Program Files
drwxrwxrwx 1 root root 24576 juil. 8 21:03 Program Files (x86)
drwxrwxrwx 1 root root 0 mars 25 2014 Recovery
drwxrwxrwx 1 root root 4096 mai 6 17:17 $Recycle.Bin
drwxrwxrwx 1 root root 32768 juil. 9 22:25 System Volume Information
drwxrwxrwx 1 root root 4096 mai 7 08:42 Users
drwxrwxrwx 1 root root 40960 juil. 9 13:32 Windows
root@pb:/home/kmc# ll /boot/efi/EFI/debian/
total 126
-rwxr-xr-x 1 root root 129024 juil. 17 13:10 grubx64.efi

Boot0000* P1: ST3500413AS
Boot0001* P2: HL-DT-ST DVDRAM GH70N
Boot0002* debian
Installation finished. No error reported.
root@pb:/home/kmc# update-grub
Generating grub.cfg …
Found background image: /usr/share/images/desktop-base/desktop-grub.png
Found linux image: /boot/vmlinuz-3.16.0-0.bpo.4-amd64
Found initrd image: /boot/initrd.img-3.16.0-0.bpo.4-amd64
Found linux image: /boot/vmlinuz-3.2.0-4-amd64
Found initrd image: /boot/initrd.img-3.2.0-4-amd64
done
root@pb:/home/kmc# ll /mnt/windows/
total 7209372
drwxrwxrwx 1 root root 4096 janv. 16 17:42 AdwCleaner
-rwxrwxrwx 2 root root 2189 avril 29 2014 AdwCleaner[R1].txt
drwxrwxrwx 1 root root 0 mars 25 2014 book
-rwxrwxrwx 1 root root 8192 mars 29 2012 BOOTSECT.BAK
drwxrwxrwx 1 root root 1048576 juin 25 21:18 Config.Msi
lrwxrwxrwx 2 root root 60 juil. 14 2009 Documents and Settings -> /mnt/windows/Users
-rwxrwxrwx 1 root root 3163365376 juil. 12 14:40 hiberfil.sys
drwxrwxrwx 1 root root 0 mars 24 17:00 inetpub
drwxrwxrwx 1 root root 0 mars 25 2014 Intel
drwxrwxrwx 1 root root root@pb:/home/kmc# grub-install
BootCurrent: 0002
Timeout: 1 seconds
BootOrder: 0000,0001
Boot0000* P1: ST3500413AS
Boot0001* P2: HL-DT-ST DVDRAM GH70N
BootCurrent: 0002
Timeout: 1 seconds
BootOrder: 0002,0000,0001
Boot0000* P1: ST3500413AS
Boot0001* P2: HL-DT-ST DVDRAM GH70N
Boot0002* debian
Installation finished. No error reported.
root@pb:/home/kmc# update-grub
Generating grub.cfg …
Found background image: /usr/share/images/desktop-base/desktop-grub.png
Found linux image: /boot/vmlinuz-3.16.0-0.bpo.4-amd64
Found initrd image: /boot/initrd.img-3.16.0-0.bpo.4-amd64
Found linux image: /boot/vmlinuz-3.2.0-4-amd64
Found initrd image: /boot/initrd.img-3.2.0-4-amd64
done
root@pb:/home/kmc# ll /mnt/windows/
total 7209372
drwxrwxrwx 1 root root 4096 janv. 16 17:42 AdwCleaner
-rwxrwxrwx 2 root root 2189 avril 29 2014 AdwCleaner[R1].txt
drwxrwxrwx 1 root root 0 mars 25 2014 book
-rwxrwxrwx 1 root root 8192 mars 29 2012 BOOTSECT.BAK
drwxrwxrwx 1 root root 1048576 juin 25 21:18 Config.Msi
lrwxrwxrwx 2 root root 60 juil. 14 2009 Documents and Settings -> /mnt/windows/Users
-rwxrwxrwx 1 root root 3163365376 juil. 12 14:40 hiberfil.sys
drwxrwxrwx 1 root root 0 mars 24 17:00 inetpub
drwxrwxrwx 1 root root 0 mars 25 2014 Intel
drwxrwxrwx 1 root root 0 janv. 16 17:25 MSOCache
drwxrwxrwx 1 root root 8192 mars 25 2014 OEM
drwxrwxrwx 1 root root 0 mai 6 17:24 OneDriveTemp
-rwxrwxrwx 1 root root 4217823232 juil. 12 14:40 pagefile.sys
drwxrwxrwx 1 root root 0 juil. 14 2009 PerfLogs
drwxrwxrwx 1 root root 20480 mai 28 23:36 ProgramData
drwxrwxrwx 1 root root 8192 mai 28 23:42 Program Files
drwxrwxrwx 1 root root 24576 juil. 8 21:03 Program Files (x86)
drwxrwxrwx 1 root root 0 mars 25 2014 Recovery
drwxrwxrwx 1 root root 4096 mai 6 17:17 $Recycle.Bin
drwxrwxrwx 1 root root 32768 juil. 9 22:25 System Volume Information
drwxrwxrwx 1 root root 4096 mai 7 08:42 Users
drwxrwxrwx 1 root root 40960 juil. 9 13:32 Windows
root@pb:/home/kmc# ll /boot/efi/EFI/debian/
total 126
-rwxr-xr-x 1 root root 129024 juil. 17 13:10 grubx64.efi
0 janv. 16 17:25 MSOCache
drwxrwxrwx 1 root root 8192 mars 25 2014 OEM
drwxrwxrwx 1 root root 0 mai 6 17:24 OneDriveTemp
-rwxrwxrwx 1 root root 4217823232 juil. 12 14:40 pagefile.sys
drwxrwxrwx 1 root root 0 juil. 14 2009 PerfLogs
drwxrwxrwx 1 root root 20480 mai 28 23:36 ProgramData
drwxrwxrwx 1 root root 8192 mai 28 23:42 Program Files
drwxrwxrwx 1 root root 24576 juil. 8 21:03 Program Files (x86)
drwxrwxrwx 1 root root 0 mars 25 2014 Recovery
drwxrwxrwx 1 root root 4096 mai 6 17:17 $Recycle.Bin
drwxrwxrwx 1 root root 32768 juil. 9 22:25 System Volume Information
drwxrwxrwx 1 root root 4096 mai 7 08:42 Users
drwxrwxrwx 1 root root 40960 juil. 9 13:32 Windows
root@pb:/home/kmc# ll /boot/efi/EFI/debian/
total 126
-rwxr-xr-x 1 root root 129024 juil. 17 13:10 grubx64.efi
[/code]

Merci pour votre aide

Bonsoir,

Un peu de lecture …
https://packages.debian.org/wheezy/os-prober
https://wiki.archlinux.fr/GRUB

J’ai beau relire cette phrase, pour moi elle ne veut rien dire.
“Installer une Debian sur un Windows” ?
“Conserver le boot sur la partition dans le GRUB installé” ?
Aussi tu devrais faire le ménage dans ton bloc de code. On y voit des répétitions, ainsi que des mélanges entre les sorties de différentes commandes. Pas clair du tout.

D’après ce qu’affiche [mono]efibootmgr[/mono] (invoqué lors de l’exécution de [mono]grub-install[/mono]) il n’y a pas d’entrée de boot EFI pour Windows. Windows était-il amorcé en mode UEFI ? C’est une condition nécessaire pour que le dual boot avec GRUB EFI fonctionne. C’est normalement le cas si le disque est partitionné au format GPT et si la partition système EFI contient un répertoire /Microsoft. Le contenu de toute la partition système EFI (montée sur /boot/efi) serait intéressant, ainsi que la table de partition du disque.

Comme l’a sous-entendu cedric058, c’est [mono]os-prober[/mono] qui est chargé de détecter les autres systèmes présents comme Windows. Par défaut il est normalement installé avec GRUB et invoqué par [mono]update-grub[/mono] (si pas de ligne [mono]GRUB_DISABLE_OS_PROBER=true[/mono] dans le fichier /etc/default/grub). Il peut aussi être exécuté manuellement pour voir quels OS il détecterait.

Désolé pour le manque de clarté. Il s’agit donc bien de retrouver le boot EFI de Windows qui était probablement installé avant que je ne l’écrase lors de l’installation Debian.
Voici les éléments demandés:

[code]root@pb:/home/kmc# fdisk -l

Disque /dev/sda : 500.1 Go, 500107862016 octets
255 têtes, 63 secteurs/piste, 60801 cylindres, total 976773168 secteurs
Unités = secteurs de 1 * 512 = 512 octets
Taille de secteur (logique / physique) : 512 octets / 512 octets
taille d’E/S (minimale / optimale) : 512 octets / 512 octets
Identifiant de disque : 0xdf790800

Périphérique Amorce Début Fin Blocs Id Système
/dev/sda1 2048 37750783 18874368 27 TFS WinRE masquée
/dev/sda2 * 37750784 37955583 102400 b W95 FAT32
/dev/sda3 37955584 506566655 234305536 7 HPFS/NTFS/exFAT
/dev/sda4 506566656 976771071 235102208 8e LVM Linux

Disque /dev/mapper/linux-root : 232.0 Go, 232003731456 octets
255 têtes, 63 secteurs/piste, 28206 cylindres, total 453132288 secteurs
Unités = secteurs de 1 * 512 = 512 octets
Taille de secteur (logique / physique) : 512 octets / 512 octets
taille d’E/S (minimale / optimale) : 512 octets / 512 octets
Identifiant de disque : 0x00000000

Le disque /dev/mapper/linux-root ne contient pas une table de partitions valable

Disque /dev/mapper/linux-swap : 8736 Mo, 8736735232 octets
255 têtes, 63 secteurs/piste, 1062 cylindres, total 17063936 secteurs
Unités = secteurs de 1 * 512 = 512 octets
Taille de secteur (logique / physique) : 512 octets / 512 octets
taille d’E/S (minimale / optimale) : 512 octets / 512 octets
Identifiant de disque : 0x00000000

Le disque /dev/mapper/linux-swap ne contient pas une table de partitions valable
root@pb:/home/kmc# ll /boot/efi/
total 1
drwxr-xr-x 5 root root 1024 juil. 17 18:23 EFI
root@pb:/home/kmc# ll /boot/efi/EFI/
total 3
drwxr-xr-x 2 root root 1024 juil. 12 16:01 debian
drwxr-xr-x 5 root root 1024 juil. 17 18:23 refind
drwxr-xr-x 2 root root 1024 juil. 17 18:23 tools [/code]

sda3 est la partition où se trouve windows
sda4 la partition LVM où sont installés un swap et linux

Grub, je connais un peu:

[code]root@pb:/home/kmc# cat /etc/default/grub

If you change this file, run ‘update-grub’ afterwards to update

/boot/grub/grub.cfg.

For full documentation of the options in this file, see:

info -f grub -n ‘Simple configuration’

GRUB_DEFAULT=0
GRUB_TIMEOUT=5
GRUB_DISTRIBUTOR=lsb_release -i -s 2> /dev/null || echo Debian
GRUB_CMDLINE_LINUX_DEFAULT=“quiet"
GRUB_CMDLINE_LINUX=”"

Uncomment to enable BadRAM filtering, modify to suit your needs

This works with Linux (no patch required) and with any kernel that obtains

the memory map information from GRUB (GNU Mach, kernel of FreeBSD …)

#GRUB_BADRAM=“0x01234567,0xfefefefe,0x89abcdef,0xefefefef”

Uncomment to disable graphical terminal (grub-pc only)

#GRUB_TERMINAL=console

The resolution used on graphical terminal

note that you can use only modes which your graphic card supports via VBE

you can see them in real GRUB with the command `vbeinfo’

#GRUB_GFXMODE=640x480

Uncomment if you don’t want GRUB to pass “root=UUID=xxx” parameter to Linux

#GRUB_DISABLE_LINUX_UUID=true

Uncomment to disable generation of recovery mode menu entries

#GRUB_DISABLE_RECOVERY=“true”

Uncomment to get a beep at grub start

#GRUB_INIT_TUNE=“480 440 1”

GRUB_HIDDEN_TIMEOUT_QUIET=true
root@pb:/home/kmc# cat /etc/grub.d/40_custom
#!/bin/sh
exec tail -n +3 $0

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.

menuentry “Windows” {
set root=(hd0,3)
chainloader +1
}
[/code]
Mais quand je demande à booter il me répond un truc genre illegal /boot/efi, vu qu’il n’y a pas trace de windows dans /boot/efi, même pas à l’état fossile.

Quant à os-prober connais pas:

root@pb:/home/kmc# os-prober root@pb:/home/kmc# man os-prober Aucune entrée de manuel pour os-prober voir « man 7 undocumented » pour obtenir de l'aide quand les pages de manuel ne sont pas disponibles.

La commande [mono]fdisk[/mono] du paquet util-linux de Wheezy ne sait pas lire le format GPT et la sortie ne ressemble pas à celle de la version du paquet gnu-fdisk (qui n’est pas installé par défaut). J’en déduis que le disque est partitionné au format traditionnel MSDOS/MBR et non au format GPT. [mono]parted[/mono] ou [mono]gdisk[/mono] le confirmerait.

Or Windows ne peut booter en mode EFI que depuis un disque partitionné au format GPT. GRUB et Linux n’ont pas cette restriction. Ceci, ainsi que l’absence d’entrée de boot EFI pour Windows et de répertoire EFI/Microsoft et EFI/Boot dans la partition système EFI sont des indices que Windows bootait en mode BIOS/legacy et non en mode EFI. Or il n’est pas possible de chaîner un chargeur BIOS depuis GRUB EFI et vice versa. Si tu veux lancer Windows, il faut booter en mode BIOS/legacy, soit en désactivant le mode UEFI soit en sélectionnant le disque en mode legacy dans le menu d’amorçage du firmware.

Je suppose que /dev/sda2 est la partition système EFI, montée sur /boot/efi ? Bizarrement, elle n’a pas le bon identifiant de type : elle a l’identifiant standard d’une partition FAT32 alors qu’elle devrait avoir l’identifiant “EFI” (ef). Je suis aussi surpris par sa position située avant la partition Windows, et son drapeau “amorce” actif. Comment cette partition a-t-elle été créée ? Existait-elle déjà avant l’installation de Debian Wheezy ? D’où vient refind présent sur celle-ci ? Quel est l’historique de ce disque ?

Ce ne serait pas plutôt “invalid EFI file path” ? C’est ce qui se passe quand on essaie de chaîner un secteur d’amorce BIOS à partir de GRUB EFI. En boot EFI, les secteurs d’amorce ne sont plus utilisés ; l’amorçage et le chaînage se font avec des fichiers exécutables .efi situés normalement dans la partition système EFI.

Il connaît très bien au contraire, sinon le shell aurait répondu “commande introuvable”. [mono]os-prober[/mono] s’exécute mais ne trouve aucun OS donc n’affiche rien. Il n’y a pas de page de manuel pour cette commande, probablement parce qu’elle n’a pas vocation à être exécutée manuellement.

L’historique du disque est que tout avait été créé sous windows sauf la sda4 que j’ai transformée en partitions LVM pour installer Debian. Je me souviens avoir réutilisé et reformaté la partition EFI lors de l’install Debian.

Je ne demande pas mieux que de désactiver le mode EFI du moment que je finis par avoir un dual boot windows / debian. Est-ce possible sans tout réinstaller ?

Que contenait la partition EFI ? Pourquoi l’avoir reformatée ?

Rien ne garantit que Windows est encore bootable en l’état actuel. Je ne vois pas son chargeur d’amorçage (ntldr ou bootmgr) à la racine de la partition NTFS ni de la partition FAT32 (normal si elle a été reformatée). Si ce n’est pas toi qui a activé le drapeau “boot” sur la partitition FAT32, c’est probablement sur celle-ci que se trouvait le chargeur de Windows.

Pour réparer l’amorçage de Windows, je suppose qu’il faudrait utiliser le CD/DVD d’installation de Windows. Je n’en sais guère plus.

Quant au dual boot Windows/Debian, cela dépend de ce que tu veux exactement. Avec une table de partition MSDOS, Windows sera amorçable en mode BIOS, tandis que GRUB est amorcé en mode EFI. Pas de chaînage possible de Windows depuis GRUB donc. Par contre, en fonction de ce que permet le firmware du PC tu pourras choisir de démarrer en BIOS (avec Windows) ou en EFI (avec GRUB).

Si tu veux chaîner Windows depuis GRUB, il faudra installer le chargeur du paquet grub-pc et amorcer le firmware en mode BIOS/legacy. Si tu veux conserver l’amorçage EFI, il faut convertir la table de partition au format GPT ([mono]gdisk[/mono] le permet) et, je le crains, réinstaller Windows en mode EFI.

Oui en effet la partition EFI bootable avait été créée par Windows. Ce que je voudrais faire est ajouter un boot dans GRUB vers la partition Windows

Quelque chose ne colle pas. Primo, une partition système EFI n’est pas censée être bootable. Secundo, à ma connaissance Windows n’utilise ce type de partition (et l’amorçage qui va avec) que sur un disque partitionné au format GPT, ce qui n’est a priori pas le cas du tien. Tertio, elle n’a pas le bon identificateur de type. Pourquoi l’avoir reformatée ? Te souviens-tu de ce qu’elle contenait avant ?

En tout cas, si elle contenait les fichiers du chargeur d’amorçage de Windows, ceux-ci ne s’y trouvent plus, pas plus qu’à la racine de la partition /dev/sda3. Sans eux, impossible de lancer Windows. Dernière chance, c’est qu’ils soient dans la partition /dev/sda1. Sinon, il faudra réparer le démarrage de Windows avec son CD/DVD d’installation.

Donc si j’ai bien suivi, je ré-installe windows puis je réinstalle GRUB ?

J’ai un CD de restauration de windows mais j’ai un doute car il me semble que maintenant windowze utilise une double partition comme backup ou je ne sais trop quoi et j’ai l’impression que j’ai installé Debian dedans. :confused:

Je ne m’y connais pas assez en Windows pour te dire si c’est réparable sans réinstaller. D’un autre côté, ce forum n’est pas vraiment l’endroit idéal pour discuter de ce sujet, les spécialistes de Windows ne fréquentent pas forcément les forums Debian…

Il y a un Boot-Repair chez ubuntu. Est-ce que ça pourrait pas résoudre mon pb ?

CF: forum.ubuntu-fr.org/viewtopic.php?pid=10738901

Je ne vois pas comment Ubuntu (que je ne connais pas plus que Windows) pourrait remettre en place les fichiers manquants du chargeur d’amorçage de Windows.