You are not logged in.

#1 2023-04-25 06:41:46

Topi
Member
Registered: 2023-04-20
Posts: 7

Grub can't detect my windows partition

As the title says, I have tried a lot of things but gruv can't detect the windows partition. I am aware my partition system is a mess and I should fix it but one thing I can't do is reinstall windows because there is a certificate installed there in chrome that I don't have a copy of.

So anyway, I 'll post  a few of the things I have tried plus the output of some commands that might be relevant cause I am out of ideas sad

What I have tried:

- Mount windows and run os-prober
- The arch linux guide to install gruv on non-uefi systems

Some outputs:

lsblk:

NAME   MAJ:MIN RM   SIZE RO TYPE MOUNTPOINTS
sda      8:0    0 931.5G  0 disk
├─sda1   8:1    0     1M  0 part
├─sda2   8:2    0 199.1G  0 part
├─sda3   8:3    0   244M  0 part
├─sda4   8:4    0  58.6G  0 part
└─sda5   8:5    0 527.1G  0 part /mnt/backup
sdb      8:16   0 232.9G  0 disk
├─sdb1   8:17   0 232.9G  0 part /mnt/windows
└─sdb2   8:18   0    32M  0 part
sdc      8:32   0 931.5G  0 disk
└─sdc1   8:33   0 931.5G  0 part /

ls /sys/firmware: (to confirm I am not using a UEFI system)

acpi dmi memmap

fdisk -l:

Disk /dev/sda: 931.51 GiB, 1000204886016 bytes, 1953525168 sectors
Disk model: WDC WD10EZEX-08M
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: D9C69AF7-87D0-4954-8E38-8D0E93308E17

Device         Start        End    Sectors   Size Type
/dev/sda1       2048       4095       2048     1M Microsoft basic data
/dev/sda2  307202048  724723711  417521664 199.1G Linux filesystem
/dev/sda3  724723712  725223423     499712   244M EFI System
/dev/sda4  725223424  848054271  122830848  58.6G Linux filesystem
/dev/sda5  848054272 1953523711 1105469440 527.1G Linux filesystem


Disk /dev/sdb: 232.89 GiB, 250059350016 bytes, 488397168 sectors
Disk model: Samsung SSD 860
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: gpt
Disk identifier: B9451855-8ABC-47A7-B8FD-3509C6794C8E

Device         Start       End   Sectors   Size Type
/dev/sdb1       2048 488331263 488329216 232.9G Microsoft basic data
/dev/sdb2  488331264 488396799     65536    32M BIOS boot


Disk /dev/sdc: 931.51 GiB, 1000204886016 bytes, 1953525168 sectors
Disk model: Samsung SSD 870
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: 0xf0007ef7

Device     Boot Start        End    Sectors   Size Id Type
/dev/sdc1        2048 1953525167 1953523120 931.5G 83 Linux

I don't know what else to post, any help is appreciated!

Offline

#2 2023-04-25 07:06:08

uhoso
Member
From: Soest, NRW, Germany
Registered: 2014-04-24
Posts: 30

Re: Grub can't detect my windows partition

Did you install os-prober package? Have a look at the grub article in the wiki.

Offline

#3 2023-04-25 07:10:41

Head_on_a_Stick
Member
From: London
Registered: 2014-02-20
Posts: 7,637
Website

Re: Grub can't detect my windows partition

Topi wrote:

What I have tried:

- Mount windows and run os-prober
- The arch linux guide to install gruv on non-uefi systems

Which partition did you mount? Please provide the full command.

/dev/sdb has a GUID partition table, which would cause Windows to install in UEFI mode. Why is there a BIOS boot partition on that disk? Did you change the partition table from MS-DOS ("MBR" type) to GUID?

Are you sure Windows was installed in non-UEFI mode? GRUB can only chainload Windows if both systems were installed in the same boot mode (ie, a UEFI GRUB cannot start a non-UEFI Windows).

Offline

#4 2023-04-25 07:44:48

Topi
Member
Registered: 2023-04-20
Posts: 7

Re: Grub can't detect my windows partition

Head_on_a_Stick wrote:

Which partition did you mount? Please provide the full command.

I had to go with this because of windows being in a hibernated stated or something like that:

sudo mount -t ntfs-3g -o remove_hiberfile /dev/sdb1 /mnt/windows

Head_on_a_Stick wrote:

/dev/sdb has a GUID partition table, which would cause Windows to install in UEFI mode. Why is there a BIOS boot partition on that disk? Did you change the partition table from MS-DOS ("MBR" type) to GUID?

Yes so this was actually my last attempt at getting this to work. I read on the wiki I should create a bios boot partition of 1Mib in the disk I want to install grub to. (or at least I understood that, I am sorry i am really new to this sad ) About changing the partition from MS-DOS  to GUID, I don't think I did that and I am not even sure how to do that.

Head_on_a_Stick wrote:

Are you sure Windows was installed in non-UEFI mode? GRUB can only chainload Windows if both systems were installed in the same boot mode (ie, a UEFI GRUB cannot start a non-UEFI Windows).

Yes I've read something like that and I am not sure how to check my windows installation mode without booting into windows, When I was running ubuntu, windows was being detected with no problem but then again I am not sure if ubuntu was using UEFI mode.

Offline

#5 2023-04-25 07:45:39

Topi
Member
Registered: 2023-04-20
Posts: 7

Re: Grub can't detect my windows partition

uhoso wrote:

Did you install os-prober package? Have a look at the grub article in the wiki.

Yes I did, and I run the command with sudo os-prober but with no luck sad

Offline

#6 2023-04-26 05:57:12

Head_on_a_Stick
Member
From: London
Registered: 2014-02-20
Posts: 7,637
Website

Re: Grub can't detect my windows partition

Topi wrote:

I had to go with this because of windows being in a hibernated stated or something like that

That might corrupt the Windows filesystem, not sure though. It would have been better to boot into Windows and disable hibernation and "fast start" [sic] from there, as per https://wiki.archlinux.org/title/Dual_b … s_settings.

Topi wrote:

I read on the wiki I should create a bios boot partition of 1Mib in the disk I want to install grub to.

A BIOS boot partition is only needed to boot a GPT disk in non-UEFI mode.

Which mode is Arch booting into? Check for /sys/firmware/efi, that will only exist in UEFI mode.

Mount the ESP:

# mount /dev/sda3 /mnt

Then please post the output of

find /mnt

If Windows is installed in UEFI mode /EFI/Microsoft/Boot/bootmgfw.efi should be on the ESP.

Offline

#7 2023-04-26 09:57:53

Topi
Member
Registered: 2023-04-20
Posts: 7

Re: Grub can't detect my windows partition

Head_on_a_Stick wrote:

Which mode is Arch booting into? Check for /sys/firmware/efi, that will only exist in UEFI mode.

ls -a /sys/firmware

.  ..  acpi  dmi  memmap

Head_on_a_Stick wrote:

Mount the ESP:

mount /dev/sda3 /mnt

Then please post the output of

find /mnt

Here is the output of t he command, I don't know if there is a better way to post it, if there is, pls tell me, I am new to this
output: http://0x0.st/HK9D.txt

As you said, there is an existing /EFI/Microsoft/Boot/bootmgfw.efi file so I am guessing windows is installed in UEFI mode and arch is not, which makes it incompatible for gruv (?)

Thanks a lot for the help so far btw!

Offline

#8 2023-04-26 15:24:34

Head_on_a_Stick
Member
From: London
Registered: 2014-02-20
Posts: 7,637
Website

Re: Grub can't detect my windows partition

Topi wrote:

windows is installed in UEFI mode and arch is not, which makes it incompatible

Looks like it, yes.

Does Windows boot if you disable CSM ("Legacy" mode) in the UEFI firmware ("BIOS") options?

It's simple to convert Arch to UEFI booting, for example with GRUB:

# mkdir -p /efi
# mount /dev/sda3 /efi
# grub-install --target=x86_64-efi --efi-directory=/efi --removable

^ That installs the bootloader to the removable loader location, which should be bootable without an NVRAM boot entry. Just select the drive directly from the firmware ("BIOS") boot menu. If the firmware doesn't offer that option you can add a boot entry from Windows instead:

bcdedit /set "{bootmgr}" path "\EFI\Boot\bootx64.efi"

Add a line to /etc/fstab if you want to have the ESP mounted or remember to mount it manually if you ever have to reinstall GRUB's core.img there again (eg, after an update).

The only caveat here is SecureBoot — some UEFI implementations will only allow it to be disabled in CSM ("Legacy" mode), which might explain why you installed Arch in non-UEFI mode. If that is the case you will have to add SecureBoot support to the installed system; the ArchWiki has a page about that.

Also note that Ubuntu might have left a stale NVRAM boot entry, use efibootmgr(8) (or bcdedit in Windows) to delete it.

Offline

#9 2023-05-02 17:21:35

Topi
Member
Registered: 2023-04-20
Posts: 7

Re: Grub can't detect my windows partition

Hi! sorry for the late response, I am really busy this days with work and uni and everything sad

Head_on_a_Stick wrote:

Does Windows boot if you disable CSM ("Legacy" mode) in the UEFI firmware ("BIOS") options?

I have yet to try this, but as soon as I find some time I ll post if I can.

Head_on_a_Stick wrote:

It's simple to convert Arch to UEFI booting, for example with GRUB:

# mkdir -p /efi
# mount /dev/sda3 /efi
# grub-install --target=x86_64-efi --efi-directory=/efi --removable

So I tried this and then selected the sda as the #1 boot option and what happened was that it just ignore it (I guess it didn't find a way to boot from that disk) and boot again into arch which was the second option. I would also like to try to avoid booting from sda since its an hdd and I guess it would be slower

Head_on_a_Stick wrote:

The only caveat here is SecureBoot — some UEFI implementations will only allow it to be disabled in CSM ("Legacy" mode), which might explain why you installed Arch in non-UEFI mode. If that is the case you will have to add SecureBoot support to the installed system; the ArchWiki has a page about that.

I am definitly going to give this a try because it sounds just like the problem I faced when installing arch. I had to do some weird tweaks to the sdc disk to install it and maybe it was due to this.

Head_on_a_Stick wrote:

Also note that Ubuntu might have left a stale NVRAM boot entry, use efibootmgr(8) (or bcdedit in Windows) to delete it.

I am not sure if I can do that since my arch system is installed in NON-UEFI and every command I run seems to return the output

EFI variables are not supported on this system.

Thank you very much for the help,  I ll post the results of the 2 things you mentioned ASAP

Offline

Board footer

Powered by FluxBB