You are not logged in.

#26 2021-01-06 07:11:44

seth
Member
From: Don't DM me only for attention
Registered: 2012-09-03
Posts: 74,307

Re: grub stopped showing windows

Depends. If os-prober doesn't care about the mount path and just takes everything that remotely look like a windows efi as indication to print the menu entry, it doesn't matter.

There's however a "larger" issue and to get this really fixed we need to know how the system is configured.
You might want to either shift to the boot/esp partition or bind-mount the EFI directory from the boot partition to /boot/EFI on the root partition.

Otherwise you'll be doing the dance w/ every future update…

Offline

#27 2021-01-06 14:29:33

lgtegetege
Member
From: Rosales
Registered: 2020-11-08
Posts: 38

Re: grub stopped showing windows

Ok so lets try to mount it to boot, can you help me with the commands please?


Depressed Mexican Fairy Rockstar

Offline

#28 2021-01-06 14:33:27

seth
Member
From: Don't DM me only for attention
Registered: 2012-09-03
Posts: 74,307

Re: grub stopped showing windows

It's just "mount /dev/nvmewhaever /boot" (check "lsblk -f" for the actual device name of the partition) and then run "os-prober" and see whether it finds a windows installation.
(mount will complain that the path /boot isn't empty, but that doesn't matter for the moment)
Then "umount /boot" again and report back.

Offline

#29 2021-01-07 06:44:48

lgtegetege
Member
From: Rosales
Registered: 2020-11-08
Posts: 38

Re: grub stopped showing windows

hi, looks like we are almost there, but there is a little issue here, let me show you what happen...

 [lgtegetege@lgtegetege ~]$ sudo mount /dev/nvme0n1p1 /boot
[sudo] password for lgtegetege: 
[lgtegetege@lgtegetege ~]$ sudo os-prober
/dev/nvme0n1p1@/EFI/Microsoft/Boot/bootmgfw.efi:Windows Boot Manager:Windows:efi
[lgtegetege@lgtegetege ~]$ sudo grub-mkconfig -o /boot/grub/grub.cfg
/usr/bin/grub-mkconfig: line 248: /boot/grub/grub.cfg.new: No such file or directory
[lgtegetege@lgtegetege ~]$ sudo umount /boot

now os prober can recognize windows, but i cant grub-mkconfig with the efi partition mounted in /boot, what should i do?


Depressed Mexican Fairy Rockstar

Offline

#30 2021-01-07 08:15:29

seth
Member
From: Don't DM me only for attention
Registered: 2012-09-03
Posts: 74,307

Re: grub stopped showing windows

seth wrote:

run "os-prober" and see whether it finds a windows installation […]
Then "umount /boot" again and report back.

I maybe should have been more explicit to do nothing else…

/boot/grub/grub.cfg.new fails because you've mounted the EFI partition into the /boot directory.
You'll have to ultiamtely mount nvme0n1p1 somewhere else and bind-mount its EFI into /boot but the structure of

sudo os-prober
/dev/nvme0n1p1@/EFI/Microsoft/Boot/bootmgfw.efi:Windows Boot Manager:Windows:efi

suggests that os-prober doesn't care about the mount point, so create a mountpoint in eg. /mnt/esp, mount /dev/nvme0n1p1 there (mount *nothing* to /boot), run os-prober again and if it succeeds grub-mkconfig.

Then probably create an fstab entry (use the UUID rather than "nvme0n1p1") so the esp is mounted when you run grub-mkconfig next time.

Offline

#31 2021-01-07 09:52:26

Head_on_a_Stick
Member
From: The Wirral
Registered: 2014-02-20
Posts: 8,999
Website

Re: grub stopped showing windows

seth wrote:

so create a mountpoint in eg. /mnt/esp, mount /dev/nvme0n1p1 there

Or just (temporarily) mount it under /mnt, as I suggested earlier.

seth wrote:

Then probably create an fstab entry (use the UUID rather than "nvme0n1p1") so the esp is mounted when you run grub-mkconfig next time.

Or just add the menuentry stanza I posted earlier to the end of the file at /etc/grub.d/40_custom so that Windows can be booted without having to mount the ESP permanently.


Jin, Jîyan, Azadî

Offline

#32 2021-01-08 05:18:37

lgtegetege
Member
From: Rosales
Registered: 2020-11-08
Posts: 38

Re: grub stopped showing windows

ok so it just worked by mounting the partition under /mnt, but you say its temporary, do i have to unmount it? how do i do it? just "umount /mnt"?  and then i have to add that stanza to the file? or do i create the fstab entry?


Depressed Mexican Fairy Rockstar

Offline

#33 2021-01-08 08:06:57

V1del
Forum Moderator
Registered: 2012-10-16
Posts: 25,104

Re: grub stopped showing windows

It's not temporary. It will remain as long as you don't run grub-mkconfig again. If you run grub-mkconfig again you can do either of the mentioned solutions to ensure the Windows entry is picked up again.

But yes you can unmount the partition as it is irrelevant for other runtime purposes.

Last edited by V1del (2021-01-08 08:08:10)

Offline

#34 2021-01-08 08:11:22

seth
Member
From: Don't DM me only for attention
Registered: 2012-09-03
Posts: 74,307

Re: grub stopped showing windows

The /etc/grub.d/40_custom stanza will "hardcode" a windows entry.
Upside: you won't have to worry about mounting the ESP.
Downside: It won't adapt to future changes (eg. if mickeysoft decides to use bootx64.efi only…)

Fstab read:
You do not want to "block" /mnt for this partition but use eg. "/mnt/esp" in case you want to add other static mounts to a /mnt sub-path.

The current  mount (w/o fstab entry) remains active until you reboot or umount" it.

Offline

#35 2021-01-08 14:54:38

lgtegetege
Member
From: Rosales
Registered: 2020-11-08
Posts: 38

Re: grub stopped showing windows

ok so let me know if im wrong, yesterday i shut down my device, now if i boot again it will not be mounted in /mnt? So if i grub-mkconfig again it will not detect os prober and ill have to mount it again? So if i wanted to not have to mount it everytime i grub-mkconfig, any of those two options.
About the fstab, how do i create the mount point? And whats the main upside of taking that path?


Depressed Mexican Fairy Rockstar

Offline

#36 2021-01-08 15:10:34

seth
Member
From: Don't DM me only for attention
Registered: 2012-09-03
Posts: 74,307

Re: grub stopped showing windows

The mountpoint is just a directory, the fstab entry is explained in the wiki… I wanted to link: https://wiki.archlinux.org/index.php/Fstab
The upside of mounting the ESP is that of using os-prober - technically you don't need any of this, incl. grub-mkconfig. The grub config is just a text file that you could write yourself.
os-prober and grub-mkconfig are just tools to abstract and simplify the process.

Offline

#37 2021-01-09 05:55:56

lgtegetege
Member
From: Rosales
Registered: 2020-11-08
Posts: 38

Re: grub stopped showing windows

Ok so i was checking and back when i made the installation, i created a directory called /boot/EFI and mounted the partition there, i guess its a similar mount point that the one you were suggesting, but looks like everytime i reboot, it is automatically unmounted as i have to mount the partition again anywere to make os-prober recognize windows, the fstab entry that you are suggesting will fix this?


Depressed Mexican Fairy Rockstar

Offline

#38 2021-01-09 08:28:26

seth
Member
From: Don't DM me only for attention
Registered: 2012-09-03
Posts: 74,307

Re: grub stopped showing windows

If it's a syntactically and sematically correct fstab entry ;-)

But don't use /boot/EFI and certainly not /boot as mountpoints.
While the latter is the preferred location, this is obviously not how you set up the system and you may screw your boot process by messing around this way.

The typical mountpoint for your case seems to be "/efi" - https://wiki.archlinux.org/index.php/EF … unt_points

Offline

Board footer

Powered by FluxBB