Page 1 of 2 12 LastLast
Results 1 to 10 of 16

Thread: Grub not picking up Windows install

  1. #1
    Join Date
    Sep 2013
    Beans
    29

    Grub not picking up Windows install

    Hi All,

    I have an old Windows 7 PC which I upgraded to Windows 10 had issues and used the Windows 10 feature to restore it back to my Windows 7 build. This seems to have resulted in a small Windows 10 partition followed by my Windows 7 partition on the disk. I then installed Ubuntu 20.04 on final partition and the build picked up the dodgy Windows 10 partition rather than the Windows 7 one.

    I tried running boot-repair as suggested in the documentation and it added a second entry for the dodgy Windows 10 install and still nothing for Windows 7. The url for the boot-repair is

    https://paste.ubuntu.com/p/23Chkszzjm/

    Thanks in advance for your help

    Lee.

  2. #2
    Join Date
    Jun 2014
    Beans
    7,375

    Re: Grub not picking up Windows install

    I have an old Windows 7 PC which I upgraded to Windows 10 had issues and used the Windows 10 feature to restore it back to my Windows 7 build.
    After doing this and rebooting, were you able to successfully boot into windows 7? A newer version of windows will generally overwrite the boot files of an older windows.

    What does the menuentry in the /boot/grub/grub.cfg file for windows 7 (/dev/sda2) look like? Post it here. It should look like the entry below. You can test this on boot without making changes to the grub.cfg file. When you see the grub menu, hit the c key on the keyboard and enter the lines consecutively, hit the Enter key after each line and you should then see the grub prompt (grub>) where you enter the next line. Don't use the first line below beginning with menuentry.

    menuentry "Windows 7" {
    insmod part_msdos
    insmod ntfs
    set root='(hd0,msdos2)'
    chainloader +1
    }

  3. #3
    Join Date
    Sep 2013
    Beans
    29

    Re: Grub not picking up Windows install

    Hi Yancek,

    Yes once I went back to Windows 7 it booted fine straight into Win 7 as before. TBH I didn't know anything about the Win 10 partition until Ubuntu showed it in gparted

    Unfortunately there isn't a menuentry for Windows 7 but there are 2 for Windows 10 (both boot up to the Win 10 partition). The entries are

    Code:
    ### BEGIN /etc/grub.d/30_os-prober ###
    menuentry 'Windows 10 (on /dev/sda1)' --class windows --class os $menuentry_id_option 'osprober-chain-421A892D1A891ED3' {
        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  421A892D1A891ED3
        else
          search --no-floppy --fs-uuid --set=root 421A892D1A891ED3
        fi
        parttool ${root} hidden-
        drivemap -s (hd0) ${root}
        chainloader +1
    }
    menuentry 'Windows 10 (on /dev/sda2)' --class windows --class os $menuentry_id_option 'osprober-chain-AC1E8BDB1E8B9CC8' {
        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  AC1E8BDB1E8B9CC8
        else
          search --no-floppy --fs-uuid --set=root AC1E8BDB1E8B9CC8
        fi
        parttool ${root} hidden-
        drivemap -s (hd0) ${root}
        chainloader +1
    }
    Looking in disks, I believe the Win 10 partition is /dev/sda1 and the Win 7 is /dev/sda2. Between the 2 partitions in disks, there appears to be an area of free space if that matters too?

    EDIT - sorry.... I tried entering the grub commands you suggested (without the first line and {'s and it just left me at the command line. No errors reported from any of the lines. Is that what you expected?

    Thanks

    Lee.
    Last edited by Lee_Nowell; February 13th, 2021 at 03:17 PM.

  4. #4
    Join Date
    Jun 2009
    Location
    SW Forida
    Beans
    Hidden!
    Distro
    Kubuntu

    Re: Grub not picking up Windows install

    Windows typically has a small boot partition and then main install. It boots from a primary NTFS partition with the boot flag that must have its boot files.
    When you installed Windows 10, it overwrote the Windows 7 boot loader with the Windows 10 boot loader and added Windows 7 into the BCD in the boot partition.

    If you ran Boot-Repair it copied the essential boot files into the main install partition also.
    So many users did not know Windows has a boot partition and in housecleaning delete it. Then they cannot boot at all and only if you did a backup would have have the boot files.
    Windows does not have to have separate boot partition as upgrades from Vista (which was only in one partition) would work. But you still have primary NTFS partition with boot files.

    Vista/7/8/10 BIOS (with 7, 8 or 10 the first two files are usually in a separate 100MB boot partition)
    /bootmgr /Boot/BCD /Windows/System32/winload.exe
    UEFI boot install & repair info - Regularly Updated :
    https://ubuntuforums.org/showthread.php?t=2147295
    Please use Thread Tools above first post to change to [Solved] when/if answered completely.

  5. #5
    Join Date
    Sep 2013
    Beans
    29

    Re: Grub not picking up Windows install

    Thanks oldfred. yes I have /bootmgr and /Boot/BCD files in the 105mb partition (/dev/sda1). /Windows/System32/winload.exe is in the other partition /dev/sda2. Does this imply the partitions are ok it is just that grub is not detecting the Win 7 partition?

  6. #6
    Join Date
    Jun 2009
    Location
    SW Forida
    Beans
    Hidden!
    Distro
    Kubuntu

    Re: Grub not picking up Windows install

    Because Windows 10 installed, grub is seeing something that makes it Windows 10 still.
    You may be able to run Windows 7 repairs, but since Windows 7 not supported by Microsoft, not sure if those would work.
    Best not to use Windows 7 and do not use it to connect to Internet.
    UEFI boot install & repair info - Regularly Updated :
    https://ubuntuforums.org/showthread.php?t=2147295
    Please use Thread Tools above first post to change to [Solved] when/if answered completely.

  7. #7
    Join Date
    Sep 2013
    Beans
    29

    Re: Grub not picking up Windows install

    Thanks oldfred. It booted fine into Windows 7 before I installed Ubuntu. Won't this imply the Windows bit is fine and we "just" need grub to understand it and boot from the win7 partition?

  8. #8
    Join Date
    Jun 2009
    Location
    SW Forida
    Beans
    Hidden!
    Distro
    Kubuntu

    Re: Grub not picking up Windows install

    Even though grub may say Windows 10, is it not booting Windows 7?
    UEFI boot install & repair info - Regularly Updated :
    https://ubuntuforums.org/showthread.php?t=2147295
    Please use Thread Tools above first post to change to [Solved] when/if answered completely.

  9. #9
    Join Date
    Sep 2013
    Beans
    29

    Re: Grub not picking up Windows install

    No it doesn't boot into Windows 7. It comes up with a back screen saying Windows failed to start and a recent hardware or software change may have caused it. It is saying I should use my installation disk to "repair your computer" The status is 0xc0000225. This happens for both the Windows 10 entries in grub. I have just noticed that the Windows 10 entries are different one says /dev/sda1 and the other /dev/sda2. So seems like booting from the 105mb one or the "normal" one results in the same.
    Last edited by Lee_Nowell; February 13th, 2021 at 08:45 PM.

  10. #10
    Join Date
    Jun 2009
    Location
    SW Forida
    Beans
    Hidden!
    Distro
    Kubuntu

    Re: Grub not picking up Windows install

    Grub only boots working Windows.
    So you may need to run Windows repairs.
    I thought the Windows boot files between Windows 10 & 7 were essentially the same as 10 will boot 7. The differnce is the BCD entry.

    Google says that error is related to corrupted BCD, and that can only be repaired using Windows.
    UEFI boot install & repair info - Regularly Updated :
    https://ubuntuforums.org/showthread.php?t=2147295
    Please use Thread Tools above first post to change to [Solved] when/if answered completely.

Page 1 of 2 12 LastLast

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •