How can I get Windows 10 back after Fedora 28 installation?
I had a new windows 10 laptop (Lenovo Ideapad 330S). I installed Elementary OS successfully, then had a change of heart and immediately installed Fedora 28 Workstation from a live usb. As part of the Fedora installation, I removed the Elementary partitions (and, I believe, only those).
Fedora works fine - but I can't boot into Windows! Windows doesn't appear in the GRUB menu.
Disclaimer: I have 'enough knowledge to be dangerous' - I code a little and I'm happy with command line stuff but don't actually understand how Unix/Linux or booting works.
At this stage I'd be content simply to get Windows back (with or without Linux - I can always try again)!
It's a new computer so there's no data to lose. I don't have a Windows Product Key (Windows 10 was preinstalled, no keys on the packaging or paperwork) or an external recovery media, but the Windows partitions are still there.
fdisk -l gives the following:
Disk /dev/sda: 119.2 GiB, 128035676160 bytes, 250069680 sectors Units: sectors of 1 * 512 = 512 bytes Sector size (logical/physical): 512 bytes / 4096 bytes I/O size (minimum/optimal): 4096 bytes / 4096 bytes Disklabel type: gpt Disk identifier: 19A623C5-DDE9-44A2-B8A0-0DB6008BE025 Device Start End Sectors Size Type /dev/sda1 2048 411647 409600 200M EFI System /dev/sda2 534528 567295 32768 16M Microsoft reserved /dev/sda3 567296 179527044 178959749 85.3G Microsoft basic data /dev/sda4 248020992 250068991 2048000 1000M Windows recovery environment /dev/sda5 179527680 181624831 2097152 1G Linux filesystem /dev/sda6 181624832 248020991 66396160 31.7G Linux LVM Partition table entries are not in disk order. Disk /dev/mapper/fedora-root: 28.4 GiB, 30475812864 bytes, 59523072 sectors Units: sectors of 1 * 512 = 512 bytes Sector size (logical/physical): 512 bytes / 4096 bytes I/O size (minimum/optimal): 4096 bytes / 4096 bytes Disk /dev/mapper/fedora-swap: 3.3 GiB, 3514826752 bytes, 6864896 sectors Units: sectors of 1 * 512 = 512 bytes Sector size (logical/physical): 512 bytes / 4096 bytes I/O size (minimum/optimal): 4096 bytes / 4096 bytes
So it looks like the Windows data are still there at least.
Both Fedora and Windows use UEFI, not BIOS.
Holding down F11 and F12 on reboot gets me to a different screen (green/blue colourscheme, reminiscent of BIOS/UEFI setup screens) that only gives me one option: select from bootable OSs. However, from the GRUB command line up I can use fwsetup
to reboot into what I assume is the UEFI setup screen.
I understand that GRUB can't boot Windows directly, but can identify and chainload them.
Running sudo grub2-mkconfig -o /boot/efi/EFI/fedora/grub.cfg
gives:
Generating grub configuration file ... Found linux image: /boot/vmlinuz-4.16.3-301.fc28.x86_64 Found initrd image: /boot/initramfs-4.16.3-301.fc28.x86_64.img Found linux image: /boot/vmlinuz-0-rescue-ef31cdf6325b480087f14666722d8231 Found initrd image: /boot/initramfs-0-rescue-ef31cdf6325b480087f14666722d8231.img
Enabling and disabling Secure Mode has no effect. Legacy boot is off.
sudo efibootmgr -v
gives the following:
BootOrder: 0001,0002,0000,2001,2002,2003 ...
What does
find /boot/efi
show?Yes, we need to see if /boot/efi/EFI contains a Microsoft dir and if it's populated with a Windows bootloader.
grub2-mkconfig
normally finds this bootloader automatically, the fact it isn't, makes me suspicious that possibly the Fedora installation was custom and the EFI System partition was marked to be reformatted, in which case the Windows bootloader is missing.