[Risolto] rimuovere voce grub

Ciao a tutti ,

Ho migrato su un ssd un dualboot F22 con windows 10 ( ex w7 con upgrade) e ho installato F23 invece di fare upgrade da F22.
Ora le voci di grub sono ,le 4 di Fedora e 2 di Windows (?)
dando grub2-mkconfig -o /boot/efi/EFI/fedora/grub.cfg
trova
Found Windows 10 (loader) on /dev/sda1
Found Windows 7 (loader) on /dev/sda2
ma mentre in sda1 c’è il boot di windows 10 , parte regolarmente ,
con sda2 arriva una pagina di diagnostica di windows che non porta a niente.
vorrei eliminare questa voce di sda2 .
Ho provato a cercare , non ho trovato nulla .
grazie
ciao

# efibootmgr -v
efibootmgr: EFI variables are not supported on this system.

aggiungo questo

[code]tree -L 2 /boot/efi/EFI
/boot/efi/EFI
├── BOOT
│ ├── BOOTX64.EFI
│ └── fallback.efi
└── fedora
├── BOOT.CSV
├── fonts
├── fw
├── fwupx64.efi
├── gcdx64.efi
├── grub.cfg
├── grubenv
├── grubx64.efi
├── MokManager.efi
├── shim.efi
└── shim-fedora.efi

4 directories, 11 files
[/code]

Strano, perché

e non

grub2-mkconfig -o /boot/grub2/grub.cfg
$ mount | grep "/dev/sd"

scusa ,mentre modificavo il post , mi ha risposto.
ho dato il primo comando che hai postato ,ma non è cambiato.
poi

$ mount | grep "/dev/sd" /dev/sda5 on / type ext4 (rw,relatime,seclabel,data=ordered) /dev/sda6 on /home type ext4 (rw,relatime,seclabel,data=ordered) /dev/sda3 on /boot type ext4 (rw,relatime,seclabel,data=ordered)
grazie

Non sembri avere un sistema UEFI, quindi penso che per te il comando corretto è

# grub2-mkconfig -o /boot/grub2/grub.cfg

(ma la cosa si fa più rognosa)
Sarebbe interessante vedere l’output del comando…

(in ogni caso, certo non fa danni, ma quella cartella /boot/efi/EFI non so cosa ci faccia in un sistema non UEFI)

ho dato il comando del post 1,sbagliando ,ho pensato quello fosse giusto.
non so assolutamente niente riguardo la cartella EFI.
ho postato il comando tree -L 2 /boot/efi/EFI avendolo visto in un altro thread del forum,pensando fosse utile

grub2-mkconfig -o /boot/grub2/grub.cfg Generating grub configuration file ... Found linux image: /boot/vmlinuz-4.2.8-300.fc23.x86_64 Found initrd image: /boot/initramfs-4.2.8-300.fc23.x86_64.img Found linux image: /boot/vmlinuz-4.2.7-300.fc23.x86_64 Found initrd image: /boot/initramfs-4.2.7-300.fc23.x86_64.img Found linux image: /boot/vmlinuz-4.2.6-301.fc23.x86_64 Found initrd image: /boot/initramfs-4.2.6-301.fc23.x86_64.img Found linux image: /boot/vmlinuz-0-rescue-8937365515dd4947a2b8e1704b913f5e Found initrd image: /boot/initramfs-0-rescue-8937365515dd4947a2b8e1704b913f5e.img Found Windows 10 (loader) on /dev/sda1 Found Windows 7 (loader) on /dev/sda2 done
grazie

Sarebbe interessante montare sda2, e capire cosa c’è dentro…
Non so se contiene files necessari per il caricamento di Windows 10, e se serve a qualcosa…

sda1 è il boot di w10 ,sda2 è la partizione di w10.
se scelgo “Windows 7 (loader) on /dev/sda2” c’è una pagina di errore di win dove dice sono stati fatti dei cambiamenti al sistema e necessita il disco di ripristino ,
ma non mi serve passare da questa via anzi sicuramente mi creerebbe dei problemi ; Windows 10 parte regolarmente da sda1.

[code]# fdisk -l
Disk /dev/sda: 238,5 GiB, 256060514304 bytes, 500118192 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0x946aa65d

Dispositivo Avvio Start Fine Settori Size Id Tipo
/dev/sda1 * 2048 206847 204800 100M 7 HPFS/NTFS/exFAT
/dev/sda2 206848 315150335 314943488 150,2G 7 HPFS/NTFS/exFAT
/dev/sda3 315150336 317198335 2048000 1000M 83 Linux
/dev/sda4 317198336 500117503 182919168 87,2G 5 Esteso
/dev/sda5 317200384 392976383 75776000 36,1G 83 Linux
/dev/sda6 392978432 500117503 107139072 51,1G 83 Linux

[/code]

Ciao yum_yoshi.
È possibile disabilitare il prober di grub2 e creare manualmente un’entry che punti al solo Windows su sda1.

Per prima cosa, vediamo l file grub.cfg.

# cat /boot/grub2/grub.cfg

Ciao arkanoid,
grazie della risposta

[code]# cat /boot/grub2/grub.cfg

DO NOT EDIT THIS FILE

It is automatically generated by grub2-mkconfig using templates

from /etc/grub.d and settings from /etc/default/grub

BEGIN /etc/grub.d/00_header

set pager=1

if -s $prefix/grubenv ]; then
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="${saved_entry}"
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 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
}

terminal_output console
if x$feature_timeout_style = xy ] ; then
set timeout_style=menu
set timeout=5

Fallback normal timeout code in case the timeout_style feature is

unavailable.

else
set timeout=5
fi

END /etc/grub.d/00_header

BEGIN /etc/grub.d/01_users

if -f ${prefix}/user.cfg ]; then
source ${prefix}/user.cfg
if -n “${GRUB2_PASSWORD}” ]; then
set superusers=“root”
export superusers
password_pbkdf2 root ${GRUB2_PASSWORD}
fi
fi

END /etc/grub.d/01_users

BEGIN /etc/grub.d/10_linux

menuentry ‘Fedora (4.3.3-300.fc23.x86_64) 23 (Workstation Edition)’ --class fedora --class gnu-linux --class gnu --class os --unrestricted $menuentry_id_option ‘gnulinux-4.2.8-300.fc23.x86_64-advanced-c4539992-5b93-4f37-8067-e6c7269ab053’ {
load_video
set gfxpayload=keep
insmod gzio
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 e9e43060-d8dd-4513-b805-9801ddfa3463
else
search --no-floppy --fs-uuid --set=root e9e43060-d8dd-4513-b805-9801ddfa3463
fi
linux16 /vmlinuz-4.3.3-300.fc23.x86_64 root=UUID=c4539992-5b93-4f37-8067-e6c7269ab053 ro rhgb quiet LANG=it_IT.UTF-8
initrd16 /initramfs-4.3.3-300.fc23.x86_64.img
}
menuentry ‘Fedora (4.2.8-300.fc23.x86_64) 23 (Workstation Edition)’ --class fedora --class gnu-linux --class gnu --class os --unrestricted $menuentry_id_option ‘gnulinux-4.2.8-300.fc23.x86_64-advanced-c4539992-5b93-4f37-8067-e6c7269ab053’ {
load_video
set gfxpayload=keep
insmod gzio
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 e9e43060-d8dd-4513-b805-9801ddfa3463
else
search --no-floppy --fs-uuid --set=root e9e43060-d8dd-4513-b805-9801ddfa3463
fi
linux16 /vmlinuz-4.2.8-300.fc23.x86_64 root=UUID=c4539992-5b93-4f37-8067-e6c7269ab053 ro rhgb quiet
initrd16 /initramfs-4.2.8-300.fc23.x86_64.img
}
menuentry ‘Fedora (4.2.7-300.fc23.x86_64) 23 (Workstation Edition)’ --class fedora --class gnu-linux --class gnu --class os --unrestricted $menuentry_id_option ‘gnulinux-4.2.7-300.fc23.x86_64-advanced-c4539992-5b93-4f37-8067-e6c7269ab053’ {
load_video
set gfxpayload=keep
insmod gzio
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 e9e43060-d8dd-4513-b805-9801ddfa3463
else
search --no-floppy --fs-uuid --set=root e9e43060-d8dd-4513-b805-9801ddfa3463
fi
linux16 /vmlinuz-4.2.7-300.fc23.x86_64 root=UUID=c4539992-5b93-4f37-8067-e6c7269ab053 ro rhgb quiet
initrd16 /initramfs-4.2.7-300.fc23.x86_64.img
}
menuentry ‘Fedora (0-rescue-8937365515dd4947a2b8e1704b913f5e) 23 (Workstation Edition)’ --class fedora --class gnu-linux --class gnu --class os --unrestricted $menuentry_id_option ‘gnulinux-0-rescue-8937365515dd4947a2b8e1704b913f5e-advanced-c4539992-5b93-4f37-8067-e6c7269ab053’ {
load_video
insmod gzio
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 e9e43060-d8dd-4513-b805-9801ddfa3463
else
search --no-floppy --fs-uuid --set=root e9e43060-d8dd-4513-b805-9801ddfa3463
fi
linux16 /vmlinuz-0-rescue-8937365515dd4947a2b8e1704b913f5e root=UUID=c4539992-5b93-4f37-8067-e6c7269ab053 ro rhgb quiet
initrd16 /initramfs-0-rescue-8937365515dd4947a2b8e1704b913f5e.img
}
if “x$default” = ‘Fedora (4.2.8-300.fc23.x86_64) 23 (Workstation Edition)’ ]; then default=‘Advanced options for Fedora>Fedora (4.2.8-300.fc23.x86_64) 23 (Workstation Edition)’; fi;

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_ppc_terminfo

END /etc/grub.d/20_ppc_terminfo

BEGIN /etc/grub.d/30_os-prober

menuentry ‘Windows 10 (loader) (on /dev/sda1)’ --class windows --class os $menuentry_id_option ‘osprober-chain-C840F3D640F3C968’ {
insmod part_msdos
insmod ntfs
set root=‘hd0,msdos1’
if x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos1 --hint-efi=hd0,msdos1 --hint-baremetal=ahci0,msdos1 C840F3D640F3C968
else
search --no-floppy --fs-uuid --set=root C840F3D640F3C968
fi
parttool ${root} hidden-
drivemap -s (hd0) ${root}
chainloader +1
}
menuentry ‘Windows 7 (loader) (on /dev/sda2)’ --class windows --class os $menuentry_id_option ‘osprober-chain-64D64469D6443E14’ {
insmod part_msdos
insmod ntfs
set root=‘hd0,msdos2’
if x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos2 --hint-efi=hd0,msdos2 --hint-baremetal=ahci0,msdos2 64D64469D6443E14
else
search --no-floppy --fs-uuid --set=root 64D64469D6443E14
fi
parttool ${root} hidden-
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 ${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

[/code]

  1. Modifica il file 40_custom, aggiungendo manualmente (dopo le tre righe commentate) l’entry relativa a Windows.
# nano /etc/grub.d/40_custom

Alla fine della modifica, il suddetto file dovrebbe presentarsi così:

#!/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 10 (loader) (on /dev/sda1)' --class windows --class os $menuentry_id_option 'osprober-chain-C840F3D640F3C968' {
	insmod part_msdos
	insmod ntfs
	set root='hd0,msdos1'
	if  x$feature_platform_search_hint = xy ]; then
	  search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos1 --hint-efi=hd0,msdos1 --hint-baremetal=ahci0,msdos1  C840F3D640F3C968
	else
	  search --no-floppy --fs-uuid --set=root C840F3D640F3C968
	fi
	parttool ${root} hidden-
	drivemap -s (hd0) ${root}
	chainloader +1
}
  1. Togli i permessi d’esecuzione al file “/etc/grub.d/30_os-prober”
# chmod -x /etc/grub.d/30_os-prober
  1. Ricostruisci il file di configurazione di grub
# grub2-mkconfig -o /boot/grub2/grub.cfg
  1. Riavvia e vedi se abbiamo raggiunto il risultato sperato e se entrambi i sistemi operativi partono con successo.

mille grazie arkanoid !
perfetto.
ancora grazie
ciao