Grub Menu Vanished on Dual OS System - Page 1
Forum section: electronics / general

author: bostonman
author_rank: Super Contributor
timestamp: December 11, 2024, 05:17:23 am
content: 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?

author: Postal2
author_rank: Frequent Contributor
timestamp: December 11, 2024, 12:30:04 pm
content: Quote from: bostonman on December 11, 2024, 05:17:23 amI installed Ubuntu on BPI-banana.

author: bostonman
author_rank: Super Contributor
timestamp: December 11, 2024, 03:59:39 pm
content: 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.

author: Postal2
author_rank: Frequent Contributor
timestamp: December 11, 2024, 04:28:19 pm
content: Quote from: bostonman on December 11, 2024, 03:59:39 pmThis shows you who to ask, because you can see the name of the maker of that piece of cake.

author: darkspr1te
author_rank: Frequent Contributor
timestamp: December 11, 2024, 06:50:36 pm
content: You have a few options,first i would follow this guide ,https://askubuntu.com/questions/83771/recovering-grub-after-installing-windows-7if 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 commandgood luckdarkspr1te

author: bostonman
author_rank: Super Contributor
timestamp: December 11, 2024, 11:21:28 pm
content: 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?

author: Postal2
author_rank: Frequent Contributor
timestamp: December 12, 2024, 12:12:45 am
content: Quote from: bostonman on December 11, 2024, 11:21:28 pmEspecially 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.)

author: garrettm
author_rank: Frequent Contributor
timestamp: December 12, 2024, 07:59:09 am
content: 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.

author: bostonman
author_rank: Super Contributor
timestamp: December 12, 2024, 01:26:41 pm
content: 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.

author: garrettm
author_rank: Frequent Contributor
timestamp: December 12, 2024, 11:26:05 pm
content: 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-11https://en.wikipedia.org/wiki/EFI_system_partitionAnyways, 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.

author: Postal2
author_rank: Frequent Contributor
timestamp: December 12, 2024, 11:51:11 pm
content: Isn't it easier to buy a 120GB SSD on Aliexpress?Quote from: garrettm on December 12, 2024, 11:26:05 pmI can image and clone GPT disks from Windows XP just fine.

author: bostonman
author_rank: Super Contributor
timestamp: December 13, 2024, 12:54:32 am
content: 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.

author: garrettm
author_rank: Frequent Contributor
timestamp: December 13, 2024, 01:45:58 am
content: Quote from: bostonman on December 13, 2024, 12:54:32 amFair enough. And that is what I would do too.Quote from: bostonman on December 13, 2024, 12:54:32 amWell 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.

author: garrettm
author_rank: Frequent Contributor
timestamp: December 13, 2024, 01:54:55 am
content: Quote from: Postal2 on December 12, 2024, 11:51:11 pmNot 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-11Quote

author: Postal2
author_rank: Frequent Contributor
timestamp: December 13, 2024, 02:09:39 am
content: Quote from: garrettm on December 13, 2024, 01:54:55 amQuote from: Postal2 on May 26, 2024, 01:09:08 pm

author: themadhippy
author_rank: Super Contributor
timestamp: December 13, 2024, 02:49:22 am
content: Quotehows about boot repairhttps://sourceforge.net/p/boot-repair-cd/home/Home/Used it in the past when i managed to screw my machine up

author: bostonman
author_rank: Super Contributor
timestamp: December 18, 2024, 04:50:51 am
content: 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?

author: garrettm
author_rank: Frequent Contributor
timestamp: December 19, 2024, 04:16:43 am
content: 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

author: garrettm
author_rank: Frequent Contributor
timestamp: December 19, 2024, 04:21:29 am
content: Apparently, you can do the partitioning directly from the Windows installer:Quote

author: bostonman
author_rank: Super Contributor
timestamp: December 19, 2024, 04:55:39 am
content: QuoteHahaha 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.

author: garrettm
author_rank: Frequent Contributor
timestamp: December 19, 2024, 05:11:12 am
content: Quote from: bostonman on December 19, 2024, 04:55:39 amOther 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 usehttps://station-drivers.com/but the website is a little annoying to navigate.