Author Topic: Grub Menu Vanished on Dual OS System  (Read 2986 times)

0 Members and 1 Guest are viewing this topic.

Offline bostonmanTopic starter

  • Super Contributor
  • ***
  • Posts: 2271
  • Country: us
Grub Menu Vanished on Dual OS System
« on: December 11, 2024, 05:17:23 am »
I have a Win7 laptop with Ubuntu.

Earlier I did some upgrades and noticed that Grub placed Ubuntu before Win7 on the boot menu. I went into Grub in Ubuntu and thought I was saving the order of OS's so Win7 is first.

This way when I boot the laptop, Win7 will be on top and automatically boot after 30 or so seconds of not selecting it.

Whichever menu I was in and saved it caused Grub to vanish. Now the system just boots Win7 without the option of Ubuntu.

I've tried a few options I read online, but without success.

Anything I can try to get Ubuntu back?
 

Offline Postal2

  • Frequent Contributor
  • **
  • !
  • Posts: 826
  • Country: 00
Re: Grub Menu Vanished on Dual OS System
« Reply #1 on: December 11, 2024, 12:30:04 pm »
... Anything I can try to get Ubuntu back?
I installed Ubuntu on BPI-banana.
 

Offline bostonmanTopic starter

  • Super Contributor
  • ***
  • Posts: 2271
  • Country: us
Re: Grub Menu Vanished on Dual OS System
« Reply #2 on: December 11, 2024, 03:59:39 pm »
Not sure how this helps me.

My system automatically boots to Win7. Normally it boots to the grub menu or whatever it's called and let's me select which OS too boot.
 

Offline Postal2

  • Frequent Contributor
  • **
  • !
  • Posts: 826
  • Country: 00
Re: Grub Menu Vanished on Dual OS System
« Reply #3 on: December 11, 2024, 04:28:19 pm »
Not sure how this helps me. ....
This shows you who to ask, because you can see the name of the maker of that piece of cake.
 

Offline darkspr1te

  • Frequent Contributor
  • **
  • Posts: 381
  • Country: zm
Re: Grub Menu Vanished on Dual OS System
« Reply #4 on: December 11, 2024, 06:50:36 pm »
You have a few options,

first i would follow this guide ,
https://askubuntu.com/questions/83771/recovering-grub-after-installing-windows-7

if that fails backup your system(s) and lookto manual install of grub,
be it a partition install (/dev/sda1 ) or a drive install (/dev/sda) or a folder install (/dev/sda/boot/grub/efi)


a failed grub install is common, the most extreme way I've fixed one is using chroot method which requires a lot of manual command


good luck
darkspr1te
 

Offline bostonmanTopic starter

  • Super Contributor
  • ***
  • Posts: 2271
  • Country: us
Re: Grub Menu Vanished on Dual OS System
« Reply #5 on: December 11, 2024, 11:21:28 pm »
That looks a bit deep for me and I don't have a live CD either. I discovered a Linux Recovery thumb drive I have.

It allows me to use Gparted and I can see the Win7 is labeled as 'boot' and 'esp'. I'm assuming this tells the system to boot from this partition, but I don't get what 'esp' is.

Can I change the 'boot' and 'esp' to the Ubuntu partition, load Ubuntu, and then tinker with Grub?
 

Offline Postal2

  • Frequent Contributor
  • **
  • !
  • Posts: 826
  • Country: 00
Re: Grub Menu Vanished on Dual OS System
« Reply #6 on: December 12, 2024, 12:12:45 am »
... Can I change the 'boot' and 'esp' to the Ubuntu partition, load Ubuntu, and then tinker with Grub?
Especially if you see a red exclamation mark, feel free to click OK. I already did, and everything is fine for me.
(Actually, I cloned the disk beforehand.)
 

Offline garrettm

  • Frequent Contributor
  • **
  • Posts: 342
  • Country: us
Re: Grub Menu Vanished on Dual OS System
« Reply #7 on: December 12, 2024, 07:59:09 am »
So, what you are talking about is the "boot loader" (or boot manager). I'm not sure what you did, but it sounds like the Windows 7 boot manager is taking over.

It also sounds like you are on some sort of legacy system that likely uses MBR instead of GPT and BIOS instead of UEFI.

If the FW were UEFI all you would have to do is go into the firmware settings and select which OS to boot into. UEFI acts like a boot manager and saves one from all the bullshit you are encountering. GRUB is a legacy tool that distros keep because it "just works" for both legacy and modern systems. It's only real use on a modern UEFI system is to allow one to easily change kernel versions at boot.

Anyways, you can boot into Linux from a 3rd party boot loader installed from Windows. I did this years ago, so the details are foggy, but an internet search for "dual boot" and "boot loader" will likely find what you need. You will likely loose booting into different kernel versions when going down this route.

Otherwise reinstall Ubuntu (it won't harm your Windows install unless you pick the wrong partition) and you will get the GRUB/GRUB2 boot loader back. You can install BTRFS and I believe EXT4 drivers in Windows so you can backup your files on the Linux partition from Windows. Or just use a "livecd" to do the same. I recommend using Ventoy with a USB flash drive: it lets you store .iso images directly on the flash drive and provides a menu to select which one to boot from. It's an amazing little tool.

Anyways, its an easy fix. And it sounds like you prefer Windows anyways, so wiping the Linux partition and starting fresh isn't a big deal if you backup anything of import on it first.
« Last Edit: December 19, 2024, 05:23:32 am by garrettm »
 
The following users thanked this post: Someone

Offline bostonmanTopic starter

  • Super Contributor
  • ***
  • Posts: 2271
  • Country: us
Re: Grub Menu Vanished on Dual OS System
« Reply #8 on: December 12, 2024, 01:26:41 pm »
You're correct and that losing Ubuntu by reinstalling won't affect me, so this is probably the best solution and good advice; although I'm uncertain which partition Ubuntu is on.

Yesterday I changed the 'boot' and 'esp' flags to another partition (or whatever it would be called in this case) thinking it wouldn't save. I wanted to see if they could be changed. Little did I know it would automatically change without having to save the new flags.

After I changed them back, but accidentally put them on (I believe) the Win7 partition (it needed to be on the FAT32 partition), so trying to load Win7 caused the laptop to freeze. Went back and changed them to the FAT32 partition and Win7 loaded.

Can I just make the Ubuntu partition the 'boot' flag, hope Ubuntu loads, tinker with Grub, and then change the 'boot' flag back to the FAT32 partition? I don't know what the 'esp' flag means, but assumed it had to be included to whichever partition I make the 'boot' flag.

I honestly don't know what I did wrong in Grub. I've worked with it before and believe all I did was access Grub by searching in Ubuntu apps, saw Win7 in the list, maybe checked something or moved it up the list thinking it would be the default OS should I not pick an OS when the option menu pops up during booting, and saved it. Next minute the Grub OS booting menu vanished and Win7 automatically loaded.

Typically I've gone into Grub, made Win7 the default OS to load, and set a timer to 30s. When I turn on the laptop, it boots to a menu that has Win7, Ubuntu, and some other stuff, the timer counts down, Win7 is highlighted, and, if I don't pick Ubuntu before the 30s, then Win7 loads.
 

Offline garrettm

  • Frequent Contributor
  • **
  • Posts: 342
  • Country: us
Re: Grub Menu Vanished on Dual OS System
« Reply #9 on: December 12, 2024, 11:26:05 pm »
Well, things are somewhat complicated by BIOS/MBR and UEFI/GPT systems being used with the same tooling. The ESP is for UEFI/GPT systems, but may also be present on an BIOS/MBR system because it makes things simpler for GRUB.

If using legacy BIOS with MBR: https://neosmart.net/wiki/mbr-boot-process/

As for ESP stuff:

https://learn.microsoft.com/en-us/windows-hardware/manufacture/desktop/configure-uefigpt-based-hard-drive-partitions?view=windows-11
https://en.wikipedia.org/wiki/EFI_system_partition

Anyways, you will know the correct partition to reformat by 1) its size (> 1GiB) and 2) the file system on it (EXT4, XFS, BTRFS, etc.). If the FS is FAT32 (for the ESP) or NTFS, don't touch it.

As an aside, a "legacy" Windows 7 (32bit) install (using MBR) can be done with a single partition, like all 32bit versions of Windows before it. A UEFI install of Windows 7 (64bit) will create an small FAT32 EFI partition (at the beginning of the drive) that the firmware can use to boot into Windows directly.

It's possible that you actually have a UEFI compliant firmware but are running in "Compatibility Support Mode" or CSM which emulates a legacy BIOS system. To fully take advantage of UEFI, your SSD/HDD must have a GUID (globally unique identifier) Partition Table or GPT. This is mutually exclusive to MBR (Master Boot Record) and cannot be seen or used with 32bit legacy OSes like Windows XP. To get Windows 7 (64bit) to install in UEFI mode, you must first convert the disk's MBR to GPT with a Linux livecd or remove the drive and convert it with another Windows PC. Or possibly use the Windows 8 (64bit) installer to format the drive first and then reboot and use the Windows 7 installer. Otherwise it will use MBR by default when installing.
« Last Edit: December 19, 2024, 05:22:26 am by garrettm »
 

Offline Postal2

  • Frequent Contributor
  • **
  • !
  • Posts: 826
  • Country: 00
Re: Grub Menu Vanished on Dual OS System
« Reply #10 on: December 12, 2024, 11:51:11 pm »
Isn't it easier to buy a 120GB SSD on Aliexpress?


.... GPT. .... cannot be seen or used with legacy OSes like Windows XP. ....
I can image and clone GPT disks from Windows XP just fine.
« Last Edit: December 13, 2024, 01:23:14 am by Postal2 »
 

Offline bostonmanTopic starter

  • Super Contributor
  • ***
  • Posts: 2271
  • Country: us
Re: Grub Menu Vanished on Dual OS System
« Reply #11 on: December 13, 2024, 12:54:32 am »
Maybe I'll just reinstall Ubuntu.

I never got into or understood all the different drive formats (FAT32, EFI, ESP, UEFI, etc...).

I should learn them, but they have become very complicated and I haven't dug into seeing if a complete list exists to explain the differences along with which is obsolete.
 

Offline garrettm

  • Frequent Contributor
  • **
  • Posts: 342
  • Country: us
Re: Grub Menu Vanished on Dual OS System
« Reply #12 on: December 13, 2024, 01:45:58 am »
Maybe I'll just reinstall Ubuntu.

Fair enough. And that is what I would do too.

I never got into or understood all the different drive formats (FAT32, EFI, ESP, UEFI, etc...).

I should learn them, but they have become very complicated and I haven't dug into seeing if a complete list exists to explain the differences along with which is obsolete.

Well this is stuff you should know. At least which file systems are used by Linux (EXT4, BTRFS, XFS, and F2FS) and Windows (FAT12/16/32, NTFS, and ReFS).

BIOS/MBR is legacy. For Windows XP and older, but Vista and Windows 7 default to using MBR.
UEFI/GPT is for Windows Vista and newer, but Windows XP 64bit can apparently access GPT disks.

Generally, most pre Windows 8 UEFI systems are configured for CSM so only MBR will work for booting. I think I only had one Windows 7 system that I got UEFI/GPT booting working on, so I don't think it was all that common a thing to do, even if supported since Vista.

The primary use case for GPT are disks larger than 2TiB and as a requirement for PCIe Resizable Bar on Windows for newish GPUs on select motherboards that back-ported support for it (like my old Coffee Lake system). But nVidia decided not to enable it for the GTX 1060, only the GTX 16xx cards and newer.
 

Offline garrettm

  • Frequent Contributor
  • **
  • Posts: 342
  • Country: us
Re: Grub Menu Vanished on Dual OS System
« Reply #13 on: December 13, 2024, 01:54:55 am »
I can image and clone GPT disks from Windows XP just fine.

Not unless you are using Windows Xp 64-bit Edition. The 32-bit version of Windows XP will only see the "protective MBR" of the GPT:

https://learn.microsoft.com/en-us/windows-hardware/manufacture/desktop/windows-and-gpt-faq?view=windows-11

Quote
Windows disk support
Whether Windows XP x64 can read, write, and boot from GPT disks

Windows XP x64 Edition can use GPT disks for data only.

Whether the 32-bit version of Windows XP read, write, and boot from GPT disks

No. The 32-bit version will see only the Protective MBR. The EE partition will not be mounted or otherwise exposed to application software.
 

Offline Postal2

  • Frequent Contributor
  • **
  • !
  • Posts: 826
  • Country: 00
Re: Grub Menu Vanished on Dual OS System
« Reply #14 on: December 13, 2024, 02:09:39 am »
Not unless you are using Windows Xp 64-bit Edition. The 32-bit version of Windows XP will only see the "protective MBR" of the GPT: .....
Also cloning of GPT-disks from Windows XP is supported.
 

Online themadhippy

  • Super Contributor
  • ***
  • Posts: 3318
  • Country: gb
Re: Grub Menu Vanished on Dual OS System
« Reply #15 on: December 13, 2024, 02:49:22 am »
Quote
I've tried a few options I read online, but without success.
hows about boot repair https://sourceforge.net/p/boot-repair-cd/home/Home/ Used it in the past when i managed to screw my machine up
 

Offline bostonmanTopic starter

  • Super Contributor
  • ***
  • Posts: 2271
  • Country: us
Re: Grub Menu Vanished on Dual OS System
« Reply #16 on: December 18, 2024, 04:50:51 am »
After lots of tinkering, I am somewhat back to where I was before messing with things.

I was having issues trying to install Ubuntu, so I deleted the partition and sub (?) partition associated with it.

Now what I seemed to have learned is that grub is still used, however, a program can be used to edit it, but it doesn't seem to install on Ubuntu 24.0. Looking deeper, I can edit the grub file using nano, but I need to change things manually.

The issue I have now that I don't understand: when it boots to the menu allowing me to select which OS, it shows Win7 twice (one on SDA1 and SDA2), and I also have a FAT32 partition with what appears to be an explanation mark.

Why do I have two Win7 on the boot menu and a FAT32?
« Last Edit: December 18, 2024, 04:53:05 am by bostonman »
 

Offline garrettm

  • Frequent Contributor
  • **
  • Posts: 342
  • Country: us
Re: Grub Menu Vanished on Dual OS System
« Reply #17 on: December 19, 2024, 04:16:43 am »
The first NTFS / 100MiB partition is the EFI system partition (ESP) and should be FAT32 not NTFS. Not sure how that happened. The second partition NTFS / 232.62GiB is for Windows 7. The third partition FAT32 / 513MiB was made by Ubuntu to act as a work around for the small ESP. The final partition EXT4 / 232.54GiB is for Ubuntu.

Honestly, you have a messed up setup. Windows, in general, makes too small of EFI partition by default (100 to 300 MiB) and cannot be used by Linux for storing multiple kernels due to its small size. Normally, it is recommended to partition the drive first using a Linux livecd to have a 500 to 600 MiB FAT32 ESP and then install Windows 7 on an NTFS partition following this one and finally install Linux last (using the remaining space after these two partitions--or more for Windows 8 and up). It looks like you put Windows 7 on first, and, apparently, your system is set to UEFI and Windows made an EFI system partition and then you installed Linux.

The FAT32 / 513 MiB partition is a work around to get Linux to boot under UEFI and store your kernels. The two Windows 7 entries is likely because GRUB sees the native Windows boot manager on SDA1 and possibly uses GRUB to load Win7 directly on SDA3? I'm honestly not sure. But it's an issue with GRUB. You'd need to look this up to see how you might remove the extra entry without it being added again when changing something in your Linux boot configuration.

I'd look at the Arch Linux Wiki for how to properly dual boot with Windows, otherwise you end up wasting space from the extra partition and potentially have multiple boot entries for Windows as we see here.

https://wiki.archlinux.org/title/Dual_boot_with_Windows
« Last Edit: December 19, 2024, 04:44:00 am by garrettm »
 

Offline garrettm

  • Frequent Contributor
  • **
  • Posts: 342
  • Country: us
Re: Grub Menu Vanished on Dual OS System
« Reply #18 on: December 19, 2024, 04:21:29 am »
Apparently, you can do the partitioning directly from the Windows installer:

Quote
The EFI system partition created by Windows Setup is too small

By default, Windows Setup creates a 100 MiB EFI system partition (except for Advanced Format 4K native drives where it creates a 300 MiB ESP). This is generally too small to fit everything you need. You can replace the existing EFI system partition with a new, larger one.

If you are installing Windows from scratch, you can dictate the size of the EFI system partition during installation[9]:

    Select your installation target and make sure it has no partitions.
    Click New and then the Apply buttons. The Windows installer will then generate the expected partitions (allocating nearly everything to its primary partition) and just 100MB to the EFI.
    Use the UI to delete the System, MSR, and Primary partitions. Leave the Recovery partition (if present) alone.
    Press Shift+F10 to open the Command Prompt.
    Type diskpart.exe and press Enter to open the disk partitioning tool.
    Type list disk and press Enter to list your disks. Find the one you intend to modify and note its disk number.
    Type select disk disk_number with the disk number to modify.
    Type create partition efi size=size with the desired size of the ESP in Mebibytes (MiB), and press Enter. See the note at EFI system partition#Create the partition for the recommended sizes.
    Type format quick fs=fat32 label=System and press Enter to format the ESP
    Type exit and press Enter to exit the disk partitioning tool and exit followed by Enter again.

Once Windows is installed, you can resize the primary partition down within Windows and then reboot and go about your usual Arch install, filling the space you just created.

Alternatively, you can use the Arch install media to create a single EFI system partition of your preferred size before you install Windows on the drive. Windows Setup will use the EFI system partition you made instead of creating its own.
 

Offline bostonmanTopic starter

  • Super Contributor
  • ***
  • Posts: 2271
  • Country: us
Re: Grub Menu Vanished on Dual OS System
« Reply #19 on: December 19, 2024, 04:55:39 am »
Quote
Honestly, you have a messed up setup.

Hahaha Just when I thought things were normal.

You're correct, Win7 was installed first. If I remember correctly, I bought a larger SSD (I got this laptop used for cheap), duplicated it, and let Ubuntu setup another partition when I installed the second OS.

Does leaving it like this cause an issue? I don't mind if I've wasted a few hundred megabytes of space, but it seems Win7 is running slower. Maybe it's my imagination, but odd.
 

Offline garrettm

  • Frequent Contributor
  • **
  • Posts: 342
  • Country: us
Re: Grub Menu Vanished on Dual OS System
« Reply #20 on: December 19, 2024, 05:11:12 am »
Hahaha Just when I thought things were normal.

You're correct, Win7 was installed first. If I remember correctly, I bought a larger SSD (I got this laptop used for cheap), duplicated it, and let Ubuntu setup another partition when I installed the second OS.

Does leaving it like this cause an issue? I don't mind if I've wasted a few hundred megabytes of space, but it seems Win7 is running slower. Maybe it's my imagination, but odd.

Other than GRUB being dumb and making two entries for Win7, I don't think your current setup hurts anything. Windows 7 shouldn't be impacted by the recent changes, but SSDs are weird. You might want to run TRIM on the NTFS partition to help speed it up (compacts partially filled blocks to free up room for new writes). On Windows 10 TRIM can be done through the Degfrag system utility, but I honestly don't know how to do it for Win7. Generally, you only want to fill an SSD half-full or leave some unpartitioned space at the end of the drive otherwise the disk performance falls off a cliff as it fills up. I'd also check if there is a firmware update for the drive. Sometimes a complete reformat is required to return performance back to normal. It's hard to say without profiling the drive. CrystalDiskInfo is a great tool for checking disk performance on Windows. And then there are drivers to consider too. If its an Intel system, new drivers are easy to get and do improve system performance.

For getting old drivers, I like to use https://station-drivers.com/ but the website is a little annoying to navigate.
« Last Edit: December 19, 2024, 05:13:40 am by garrettm »
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf