Ask Your Question

How can I get Windows 10 back after Fedora 28 installation?

asked 2018-10-31 17:54:20 -0600

benh gravatar image

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 ...
edit retag flag offensive close merge delete


What does find /boot/efi show?

villykruse gravatar imagevillykruse ( 2018-11-01 00:22:01 -0600 )edit

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.

cmurf gravatar imagecmurf ( 2018-11-01 19:08:53 -0600 )edit

2 Answers

Sort by ยป oldest newest most voted

answered 2018-11-01 01:10:35 -0600

G0bble gravatar image

updated 2018-11-01 01:14:47 -0600

I dont have time right now to look into the details, but as a quick tip in case it helps, here is a copy of my windows boot entry in my grub2-efi.cfg >>>

 ### BEGIN /etc/grub.d/30_os-prober ###
menuentry 'Windows Boot Manager (on /dev/sda2)' --class windows --class os $menuentry_id_option 'osprober-efi-84D8-6803' {
    insmod part_gpt
    insmod fat
    set root='hd0,gpt2'
    if [ x$feature_platform_search_hint = xy ]; then
      search --no-floppy --fs-uuid --set=root --hint-bios=hd0,gpt2 --hint-efi=hd0,gpt2 --hint-baremetal=ahci0,gpt2  84D8-6803
      search --no-floppy --fs-uuid --set=root 84D8-6803
    chainloader /EFI/Microsoft/Boot/bootmgfw.efi
You can try editing to match your disk scheme and add it to your system grub by hand editing rather than run the grub tool. Fedora did it right for me when I installed, correctly added Win 10 to my boot menu. I guess something broke in the back-to-back installs for you. Did you boot windows succesfully after elementary?

Now is the time to learn about UEFI ...

I did some practice runs adding and deleting UEFI boot entries via bcdedit when I faced a similar challenge a few months back. You should do the same.


edit flag offensive delete link more

answered 2018-11-01 23:52:47 -0600

cmurf gravatar image

You could take advantage of this opportunity to reinstall Windows by NOT using the OEM installer, and instead download a clean, bloatware free, copy from Microsoft directly: It will automatically find your product key baked into the firmware.

To create install media from Fedora: Disks (Gnome Disk Utility): Choose USB stick; then Upper right corner "Format Disk" set to MBR/DOS and format; under Volumes click + button, enter volume name "WIN" (or anything) and keep all the other defaults (don't erase, FAT format) and click next and it'll be formatted; now click the "play" icon (triangle pointing to the right) and this volume will be mounted at /run/media/username/WIN or whatever you named it.

losetup -r /dev/loop0 ~/Downloads/Win10_1803_English_x64.iso
mount -o ro /dev/loop0 /mnt/iso
cp -r /mnt/iso/* /run/media/username/WIN/

When you reboot you need to use the Fkey for your computer to bring up the firmware's boot manager (the thing that lets you pick a drive to boot from) and choose the USB stick. When you get to the disk selection part of the Windows installer, just click the disk and continue, don't do any partitioning. This will cause the installer to do its default partitioning. You can either shrink the Windows volume in Windows, or in the Fedora installer when you choose autopartitioning.

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools


Asked: 2018-10-31 17:54:20 -0600

Seen: 220 times

Last updated: Nov 01 '18