Score:1

Grub cannot boot Windows: "error: not a valid root device"

sh flag

Problem. I'm trying to setup a dual-boot Ubuntu/Windows installation. This has so far only succeeded partially: grub seems to detect my Windows installation, but cannot boot into it. When I select it, it provides a message saying 'error: not a valid root device."

Disks. I've constructed the dual-boot installation on two disks:

  • /dev/sda contains Windows 10, UEFI. This OS was installed first, on one of the two drives. To prevent contamination, I had the other drive removed during installation. The drive contains four partitions:
    1. /dev/sda1, EFI system partition, FAT32, 100MB
    2. /dev/sda2, Microsoft reserved partition, unknown, 16MB
    3. /dev/sda3, Basic data partition, NTFS, 237+GB
    4. /dev/sda4, >>unnamed partition<<, NTFS, 530MB
  • /dev/nvme0n1, the second drive, contains Ubuntu 22.04.1, UEFI. This OS was installed second. During installation, I opted for the "install along-side Windows" option. The drive contains two partitions:
    1. /dev/nvme0n1p1, EFI System partition, FAT32, 512 MB
    2. /dev/nvme0n1p2, >>unnamed partition<<, EXT4, 890+ GB

After installation. Following the installation, grub immediately recognized the Windows install, however, it returns "error: not a valid root device" each time I attempt to select it. I have executed sudo os-prober and sudo update-grub, both to no avail. The grub boot sequence is as follows:

insmod fat
set root='hd0,gpt1'
if [ x$feature_platform_search_hint = xy ]; then
  search --no-floppy --fs-uuid --set=root --hint-bios=hd0,gpt1 --hint-efi=hd0,gpt1 --hint-baremetal=ahci0,gpt1  64DE-E837
else
  search --no-floppy --fs-uuid --set=root 64DE-E837
fi
chainloader /efi/Microsoft/Boot/bootmgfw.efi

Peculiarity. There is one thing that happens that I think is rather odd. Let's discuss three situations:

  • When I turn my pc on, wait for grub to appear and select Windows, the error occurs.
  • When I turn my pc on, enter the boot menu and select 'UEFI - Windows Boot Manager', I do boot into Windows.
  • When I turn my pc on, enter the boot menu, select 'UEFI - Ubuntu' and then select Windows in grub, it also boots to Windows.

I'm baffled by the whole situation. Any input is much appreciated!

David avatar
cn flag
Please clarify the version of Ubuntu you are using. There is no 22.04.5
oldfred avatar
cn flag
Try with bitlocker off. Or with UEFI Secure Boot off. And make sure Windows fast start up is off.
Erik avatar
sh flag
@David my apologies! It's a typo. It should be 22.04.1. I've updated this in the question.
Erik avatar
sh flag
@oldfred turning fast boot off did the trick!... do you have a clue why fast boot makes this happen?
oldfred avatar
cn flag
Windows fast startup sets hibernation flag. Then Linux NTFS driver will not default mount read/write. It can be manually force mounted read only. And then grub cannot fully see NTFS partitions. https://askubuntu.com/questions/843153/unable-to-mount-windows-10-partition-it-is-in-an-unsafe-state & https://askubuntu.com/questions/145902/unable-to-mount-windows-ntfs-filesystem-due-to-hibernation
Erik avatar
sh flag
Thanks for the explanation! Can I somehow mark your comment as the solution? @oldfred
Score:1
cn flag

Most common issue is Windows fast start up.

You may also need Windows bit locker or UEFI Secure boot off. Although Ubuntu works with Secure Boot on, grub may not boot Windows. Newest version I have actually had booted Windows with Secure boot on.

More info on Windows fast start up and hibernation flags.

Unable to mount Windows 10 partition; it "is in an unsafe state"

Unable to mount Windows (NTFS) filesystem due to hibernation

I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.