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/06/2021, à 10:14

Herby

[Résolu]GRUB ne détecte plus Win7

Salut,
Ma machine a un disque système sur lequel sont installés Ubuntu (18.04) et Win7 (chacun sur des partitions différentes). Je pouvais sans problème démarrer les 2 os jusqu'à ce que je rajoute un disque et que j'y installe un Win10. Depuis, je peux lancer ubuntu ou Win10 mais plus moyen de démarrer Win7.
Maintenant, je souhaite virer le disque Win10 et revenir à la situation initiale (Ubuntu + Win7).
Voici qques infos complémentaires :

$ sudo os-prober
/dev/sdc2@/EFI/Microsoft/Boot/bootmgfw.efi:Windows Boot Manager:Windows:efi
$ efibootmgr
BootCurrent: 0000
Timeout: 1 seconds
BootOrder: 0000,0002,0001
Boot0000* ubuntu
Boot0001* Windows Boot Manager
Boot0002* Hard Drive 
$ lsblk
NAME   MAJ:MIN RM   SIZE RO TYPE MOUNTPOINT
loop0    7:0    0  55,4M  1 loop /snap/core18/2066
loop1    7:1    0  54,8M  1 loop /snap/barrier/384
loop2    7:2    0  32,1M  1 loop /snap/snapd/12057
loop3    7:3    0  32,1M  1 loop /snap/snapd/11841
loop4    7:4    0  55,5M  1 loop /snap/core18/1997
sda      8:0    0 232,9G  0 disk 
├─sda1   8:1    0   100M  0 part 
├─sda2   8:2    0 146,4G  0 part 
├─sda3   8:3    0  74,5G  0 part /
├─sda4   8:4    0     1K  0 part 
└─sda5   8:5    0  11,9G  0 part [SWAP]
sdb      8:16   0 139,8G  0 disk 
└─sdb1   8:17   0 139,8G  0 part 
sdc      8:32   0 186,3G  0 disk 
├─sdc1   8:33   0   450M  0 part 
├─sdc2   8:34   0   100M  0 part /boot/efi
├─sdc3   8:35   0    16M  0 part 
└─sdc4   8:36   0 185,8G  0 part 
sdd      8:48   0   1,8T  0 disk 
└─sdd1   8:49   0   1,8T  0 part /media/DATA

Le sda est le disque sur lequel sont installés Ubuntu (sda3) & Win7 (sda2). Win10 est quant à lui sur sdc.
Et pour finir voici le /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
if [ "${next_entry}" ] ; then
   set default="${next_entry}"
   set next_entry=
   save_env next_entry
   set boot_once=true
else
   set default="0"
fi

if [ x"${feature_menuentry_id}" = xy ]; then
  menuentry_id_option="--id"
else
  menuentry_id_option=""
fi

export menuentry_id_option

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 {
  if [ x$feature_all_video_module = xy ]; then
    insmod all_video
  else
    insmod efi_gop
    insmod efi_uga
    insmod ieee1275_fb
    insmod vbe
    insmod vga
    insmod video_bochs
    insmod video_cirrus
  fi
}

if [ x$feature_default_font_path = xy ] ; then
   font=unicode
else
insmod part_msdos
insmod ext2
set root='hd0,msdos3'
if [ x$feature_platform_search_hint = xy ]; then
  search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos3 --hint-efi=hd0,msdos3 --hint-baremetal=ahci0,msdos3  cb26f145-c149-4f16-b14c-89b8d8c891d7
else
  search --no-floppy --fs-uuid --set=root cb26f145-c149-4f16-b14c-89b8d8c891d7
fi
    font="/usr/share/grub/unicode.pf2"
fi

if loadfont $font ; then
  set gfxmode=1920x1080x24
  load_video
  insmod gfxterm
  set locale_dir=$prefix/locale
  set lang=fr_FR
  insmod gettext
fi
terminal_output gfxterm
if [ "${recordfail}" = 1 ] ; then
  set timeout=30
else
  if [ x$feature_timeout_style = xy ] ; then
    set timeout_style=hidden
    set timeout=8
  # Fallback hidden-timeout code in case the timeout_style feature is
  # unavailable.
  elif sleep --interruptible 8 ; then
    set timeout=0
  fi
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
#set_background_image "images/tile.png";

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

### BEGIN /etc/grub.d/10_linux ###
function gfxmode {
	set gfxpayload="${1}"
	if [ "${1}" = "keep" ]; then
		set vt_handoff=vt.handoff=1
	else
		set vt_handoff=
	fi
}
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
menuentry 'Ubuntu' --class ubuntu --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-simple-cb26f145-c149-4f16-b14c-89b8d8c891d7' {
	recordfail
	load_video
	gfxmode $linux_gfx_mode
	insmod gzio
	if [ x$grub_platform = xxen ]; then insmod xzio; insmod lzopio; fi
	insmod part_msdos
	insmod ext2
	set root='hd0,msdos3'
	if [ x$feature_platform_search_hint = xy ]; then
	  search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos3 --hint-efi=hd0,msdos3 --hint-baremetal=ahci0,msdos3  cb26f145-c149-4f16-b14c-89b8d8c891d7
	else
	  search --no-floppy --fs-uuid --set=root cb26f145-c149-4f16-b14c-89b8d8c891d7
	fi
        linux	/boot/vmlinuz-4.15.0-144-generic root=UUID=cb26f145-c149-4f16-b14c-89b8d8c891d7 ro  quiet splash $vt_handoff
	initrd	/boot/initrd.img-4.15.0-144-generic
}
submenu 'Options avancées pour Ubuntu' $menuentry_id_option 'gnulinux-advanced-cb26f145-c149-4f16-b14c-89b8d8c891d7' {
	menuentry 'Ubuntu, avec Linux 4.15.0-144-generic' --class ubuntu --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-4.15.0-144-generic-advanced-cb26f145-c149-4f16-b14c-89b8d8c891d7' {
		recordfail
		load_video
		gfxmode $linux_gfx_mode
		insmod gzio
		if [ x$grub_platform = xxen ]; then insmod xzio; insmod lzopio; fi
		insmod part_msdos
		insmod ext2
		set root='hd0,msdos3'
		if [ x$feature_platform_search_hint = xy ]; then
		  search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos3 --hint-efi=hd0,msdos3 --hint-baremetal=ahci0,msdos3  cb26f145-c149-4f16-b14c-89b8d8c891d7
		else
		  search --no-floppy --fs-uuid --set=root cb26f145-c149-4f16-b14c-89b8d8c891d7
		fi
		echo	'Chargement de Linux 4.15.0-144-generic…'
	        linux	/boot/vmlinuz-4.15.0-144-generic root=UUID=cb26f145-c149-4f16-b14c-89b8d8c891d7 ro  quiet splash $vt_handoff
		echo	'Chargement du disque mémoire initial…'
		initrd	/boot/initrd.img-4.15.0-144-generic
	}
	menuentry 'Ubuntu, avec Linux 4.15.0-144-generic (recovery mode)' --class ubuntu --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-4.15.0-144-generic-recovery-cb26f145-c149-4f16-b14c-89b8d8c891d7' {
		recordfail
		load_video
		insmod gzio
		if [ x$grub_platform = xxen ]; then insmod xzio; insmod lzopio; fi
		insmod part_msdos
		insmod ext2
		set root='hd0,msdos3'
		if [ x$feature_platform_search_hint = xy ]; then
		  search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos3 --hint-efi=hd0,msdos3 --hint-baremetal=ahci0,msdos3  cb26f145-c149-4f16-b14c-89b8d8c891d7
		else
		  search --no-floppy --fs-uuid --set=root cb26f145-c149-4f16-b14c-89b8d8c891d7
		fi
		echo	'Chargement de Linux 4.15.0-144-generic…'
	        linux	/boot/vmlinuz-4.15.0-144-generic root=UUID=cb26f145-c149-4f16-b14c-89b8d8c891d7 ro recovery nomodeset dis_ucode_ldr 
		echo	'Chargement du disque mémoire initial…'
		initrd	/boot/initrd.img-4.15.0-144-generic
	}
	menuentry 'Ubuntu, avec Linux 4.15.0-143-generic' --class ubuntu --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-4.15.0-143-generic-advanced-cb26f145-c149-4f16-b14c-89b8d8c891d7' {
		recordfail
		load_video
		gfxmode $linux_gfx_mode
		insmod gzio
		if [ x$grub_platform = xxen ]; then insmod xzio; insmod lzopio; fi
		insmod part_msdos
		insmod ext2
		set root='hd0,msdos3'
		if [ x$feature_platform_search_hint = xy ]; then
		  search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos3 --hint-efi=hd0,msdos3 --hint-baremetal=ahci0,msdos3  cb26f145-c149-4f16-b14c-89b8d8c891d7
		else
		  search --no-floppy --fs-uuid --set=root cb26f145-c149-4f16-b14c-89b8d8c891d7
		fi
		echo	'Chargement de Linux 4.15.0-143-generic…'
	        linux	/boot/vmlinuz-4.15.0-143-generic root=UUID=cb26f145-c149-4f16-b14c-89b8d8c891d7 ro  quiet splash $vt_handoff
		echo	'Chargement du disque mémoire initial…'
		initrd	/boot/initrd.img-4.15.0-143-generic
	}
	menuentry 'Ubuntu, avec Linux 4.15.0-143-generic (recovery mode)' --class ubuntu --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-4.15.0-143-generic-recovery-cb26f145-c149-4f16-b14c-89b8d8c891d7' {
		recordfail
		load_video
		insmod gzio
		if [ x$grub_platform = xxen ]; then insmod xzio; insmod lzopio; fi
		insmod part_msdos
		insmod ext2
		set root='hd0,msdos3'
		if [ x$feature_platform_search_hint = xy ]; then
		  search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos3 --hint-efi=hd0,msdos3 --hint-baremetal=ahci0,msdos3  cb26f145-c149-4f16-b14c-89b8d8c891d7
		else
		  search --no-floppy --fs-uuid --set=root cb26f145-c149-4f16-b14c-89b8d8c891d7
		fi
		echo	'Chargement de Linux 4.15.0-143-generic…'
	        linux	/boot/vmlinuz-4.15.0-143-generic root=UUID=cb26f145-c149-4f16-b14c-89b8d8c891d7 ro recovery nomodeset dis_ucode_ldr 
		echo	'Chargement du disque mémoire initial…'
		initrd	/boot/initrd.img-4.15.0-143-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/30_os-prober_proxy ###


set timeout_style=menu
if [ "${timeout}" = 0 ]; then
  set timeout=10
fi
### END /etc/grub.d/30_os-prober_proxy ###

### BEGIN /etc/grub.d/31_uefi-firmware ###
### END /etc/grub.d/31_uefi-firmware ###

### BEGIN /etc/grub.d/40_custom_proxy ###

# 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 "Win7"{
	    insmod part_gpt
	    insmod chain
	    set root='(hd0,gpt1)'
	    chainloader /EFI/Microsoft/Boot/bootmgfw.efi
}
### END /etc/grub.d/40_custom_proxy ###

### BEGIN /etc/grub.d/41_custom ###
if [ -f  ${config_directory}/custom.cfg ]; then
  source ${config_directory}/custom.cfg
elif [ -z "${config_directory}" -a -f  $prefix/custom.cfg ]; then
  source $prefix/custom.cfg;
fi
### END /etc/grub.d/41_custom ###

### BEGIN /etc/grub.d/43_custom_proxy ###
menuentry "Win10" --class windows --class os $menuentry_id_option 'osprober-efi-28D6-682F' {
	insmod part_gpt
	insmod fat
	set root='hd2,gpt2'
	if [ x$feature_platform_search_hint = xy ]; then
	  search --no-floppy --fs-uuid --set=root --hint-bios=hd2,gpt2 --hint-efi=hd2,gpt2 --hint-baremetal=ahci2,gpt2  28D6-682F
	else
	  search --no-floppy --fs-uuid --set=root 28D6-682F
	fi
	chainloader /EFI/Microsoft/Boot/bootmgfw.efi
}
### END /etc/grub.d/43_custom_proxy ###

Dernière modification par Herby (Le 06/06/2021, à 11:38)

Hors ligne

#2 Le 05/06/2021, à 11:56

geole

Re : [Résolu]GRUB ne détecte plus Win7

Bonjour
Pourrais-tu faire un boot-info et donner l'URL qui sera générée
https://doc.ubuntu-fr.org/tutoriel/boot-info.
Je ne sais pas si cela sera visible.
Je crains que windows7 soit  ne soit pas installé en mode EFI alors windows10 semble l'être

$ sudo os-prober
/dev/sdc2@/EFI/Microsoft/Boot/bootmgfw.efi:Windows Boot Manager:Windows:efi

Pour accèder à windows 7, il faudrait alors booter en mode LEGACY
Le boot-info devrait permettre de voir si les MBR sont encore corrects

Dernière modification par geole (Le 05/06/2021, à 11:57)


Les grilles de l'installateur https://doc.ubuntu-fr.org/tutoriel/inst … _subiquity
"gedit admin:///etc/fstab" est proscrit,  utilisez "pkexec env DISPLAY=$DISPLAY XAUTHORITY=$XAUTHORITY xdg-open /etc/fstab" Voir  https://doc.ubuntu-fr.org/gedit
Les partitions EXT4 des disques externes => https://forum.ubuntu-fr.org/viewtopic.p … #p22697248

En ligne

#3 Le 05/06/2021, à 12:56

Herby

Re : [Résolu]GRUB ne détecte plus Win7

geole a écrit :

Bonjour
Pourrais-tu faire un boot-info et donner l'URL qui sera générée
https://doc.ubuntu-fr.org/tutoriel/boot-info.
Je ne sais pas si cela sera visible.
Je crains que windows7 soit  ne soit pas installé en mode EFI alors windows10 semble l'être

$ sudo os-prober
/dev/sdc2@/EFI/Microsoft/Boot/bootmgfw.efi:Windows Boot Manager:Windows:efi

Pour accèder à windows 7, il faudrait alors booter en mode LEGACY
Le boot-info devrait permettre de voir si les MBR sont encore corrects

Et voili: http://paste.ubuntu.com/p/YtXvDmvqZp/

Hors ligne

#4 Le 05/06/2021, à 13:44

geole

Re : [Résolu]GRUB ne détecte plus Win7

On voit une installation LEGACY d'un windows ancien

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

Mais le MBR ne permet pas de le faire  booter

On voit que ton UBUNTU boote maintenant en EFI

===================================== UEFI =====================================
BIOS is EFI-compatible, and is setup in EFI-mode for this installed-session.

En utilisant cette structure de boot

sdc2: __________________________________________________________________________
    File system:       vfat
    Boot sector type:  Windows 8/2012: FAT32
    Boot sector info:  No errors found in the Boot Parameter Block.
    Operating System:  
    Boot files:        /efi/Boot/bkpbootx64.efi /efi/Boot/bootx64.efi 
                       /efi/Boot/fbx64.efi /efi/Boot/grubx64.efi 
                       /efi/ubuntu/grubx64.efi /efi/ubuntu/mmx64.efi 
                       /efi/ubuntu/shimx64.efi /efi/ubuntu/grub.cfg 
                       /efi/Microsoft/Boot/bootmgfw.efi 
                       /efi/Microsoft/Boot/bootmgr.efi 
                       /efi/Microsoft/Boot/memtest.efi

On voit aussi que le grub propose dans son dual boot     windows7 et windows10
====================== sda3/boot/grub/grub.cfg (filtered) ======================

Ubuntu   cb26f145-c149-4f16-b14c-89b8d8c891d7
Ubuntu, avec Linux 4.15.0-144-generic   cb26f145-c149-4f16-b14c-89b8d8c891d7
Ubuntu, avec Linux 4.15.0-143-generic   cb26f145-c149-4f16-b14c-89b8d8c891d7
### END /etc/grub.d/30_os-prober_proxy ###
Win7"{
Win10   osprober-efi-28D6-682F

Mais la codification de windows7  ne semble pas excellante..

Je pense qu'elle est de ta fabrication

======================= sda3/etc/grub.d/40_custom_proxy ========================
#!/bin/sh
#THIS IS A GRUB PROXY SCRIPT
'/etc/grub.d/proxifiedScripts/custom' | /etc/grub.d/bin/grubcfg_proxy "+*
+#text
+'Win7'~d495faf84243bb86a65699df5191ee03~
-'Win10'~cad2ad93cbf9f7d137c26b6af2c68dbb~ as 'Windows Boot Manager (sur /dev/sdc2)'
"

======================= sda3/etc/grub.d/43_custom_proxy ========================
#!/bin/sh
#THIS IS A GRUB PROXY SCRIPT
'/etc/grub.d/proxifiedScripts/custom' | /etc/grub.d/bin/grubcfg_proxy "-*
-#text
-'Win7'~d495faf84243bb86a65699df5191ee03~
+'Win10'~cad2ad93cbf9f7d137c26b6af2c68dbb~
"

Je peux simplement te suggérer de modifier le bios pour qu'il ne boote plus en MODE EFI puis de faire un boot-repair ( https://doc.ubuntu-fr.org/boot-repair ) pour rebasculer le grub  en mode LEGACY
de rebooter sur  ubuntu de lui faire redécouvrir windows

sudo update-grub

de rebooter pour choisir windows7.
Je pense que cela fonctionnera
Puis avec gparted supprimer  toutes les partitions de windows 10 et recréer une table de partition MSDOS et pas GPT puis de réinstaller windows 10


ou
Lancer gparted, supprimer toutes les partitions du disque SDC. Créer une table de partition MSDOS
réinstaller windows10  => il sera en mode LEGACY
Lancer boot-repair, Bien vérifier que le boot a lieu en mode LEGACY, réinstaller le grub LEGACY
puis booter et

sudo update

alors, ubuntu devrait proposer les windows qui bootent bien.

Dernière modification par geole (Le 05/06/2021, à 13:46)


Les grilles de l'installateur https://doc.ubuntu-fr.org/tutoriel/inst … _subiquity
"gedit admin:///etc/fstab" est proscrit,  utilisez "pkexec env DISPLAY=$DISPLAY XAUTHORITY=$XAUTHORITY xdg-open /etc/fstab" Voir  https://doc.ubuntu-fr.org/gedit
Les partitions EXT4 des disques externes => https://forum.ubuntu-fr.org/viewtopic.p … #p22697248

En ligne

#5 Le 05/06/2021, à 19:19

Herby

Re : [Résolu]GRUB ne détecte plus Win7

On voit aussi que le grub propose dans son dual boot     windows7 et windows10
====================== sda3/boot/grub/grub.cfg (filtered) ======================

Ubuntu   cb26f145-c149-4f16-b14c-89b8d8c891d7
Ubuntu, avec Linux 4.15.0-144-generic   cb26f145-c149-4f16-b14c-89b8d8c891d7
Ubuntu, avec Linux 4.15.0-143-generic   cb26f145-c149-4f16-b14c-89b8d8c891d7
### END /etc/grub.d/30_os-prober_proxy ###
Win7"{
Win10   osprober-efi-28D6-682F
Mais la codification de windows7  ne semble pas excellante..

Je pense qu'elle est de ta fabrication

Effectivement, j'avais tenté cette bidouille pour retrouver Win7.... en vain!

Je peux simplement te suggérer de modifier le bios pour qu'il ne boote plus en MODE EFI puis de faire un boot-repair ( https://doc.ubuntu-fr.org/boot-repair ) pour rebasculer le grub  en mode LEGACY
de rebooter sur  ubuntu de lui faire redécouvrir windows

sudo update-grub

de rebooter pour choisir windows7.
Je pense que cela fonctionnera
Puis avec gparted supprimer  toutes les partitions de windows 10 et recréer une table de partition MSDOS et pas GPT puis de réinstaller windows 10

ou
Lancer gparted, supprimer toutes les partitions du disque SDC. Créer une table de partition MSDOS
réinstaller windows10  => il sera en mode LEGACY
Lancer boot-repair, Bien vérifier que le boot a lieu en mode LEGACY, réinstaller le grub LEGACY
puis booter et

sudo update

alors, ubuntu devrait proposer les windows qui bootent bien.

Le but final est de virer (physiquement) le disque sdc sur lequel est installé Win10 car je n'en ai plus besoin. Je vais préparer une clé usb bootable pour pouvoir réinstaller grub et je vais suivre tes instructions. La suite au prochain reboot....

Hors ligne

#6 Le 06/06/2021, à 11:35

Herby

Re : [Résolu]GRUB ne détecte plus Win7

Un rapide retour après avoir dégagé ce bon vieux Win10 :
Sans surprise, pas de boot une fois le disque retiré mais un "grub rescue" en lieu et place. J'ai donc démarré un OS depuis une clé USB pour faire un boot-repair. Et c'est tout ! Mon windows 7 est réapparu à côté d'ubuntu et les 2 os démarrent sans provlème. Même pas besoin de passer par le bios pour passer en mode legacy.
Merci Geole pour ton aide.

Hors ligne