Score:0

Recover Grub dual boot UEFI Windows 8 + CSM installed Lubuntu 20.04

pl flag

I have an old Toshiba Satellite C855D-S5105. It has the original Windows 8. I have just installed dual booting Lubuntu on it, selecting "Something Else" during installation. To be able to boot the installation disk, I had to change boot from UEFI to CSM, as per this, which is what I am currently using.

After installation, there was no grub. I recovered it editing /etc/default/grub. But I don't have the Windows entry there.

Now I see here I might have done wrong

Case when Ubuntu must be installed in UEFI mode

Having a PC with UEFI firmware does not mean that you need to install Ubuntu in UEFI mode. What is important is below:

  1. if the other systems (Windows Vista/7/8, GNU/Linux...) of your computer are installed in UEFI mode, then you must install Ubuntu in UEFI mode too.

(which, as mentioned above, I did not do). This also suggests I did wrong.

To get the Windows entry in grub, I tried this, but it did not work. So I tried this other answer to the same question:

$ lsblk 
NAME    MAJ:MIN RM   SIZE RO TYPE MOUNTPOINT
sda       8:0    0 298,1G  0 disk 
├─sda1    8:1    0   450M  0 part 
├─sda2    8:2    0   260M  0 part 
├─sda3    8:3    0   128M  0 part 
├─sda4    8:4    0    64G  0 part /media/user1/TI10657600C
├─sda5    8:5    0    91G  0 part /media/user1/Data
├─sda6    8:6    0  10,4G  0 part 
├─sda7    8:7    0   3,8G  0 part [SWAP]
├─sda8    8:8    0    11G  0 part /
├─sda9    8:9    0  68,4G  0 part /home
└─sda10   8:10   0  48,8G  0 part /media/user1/02B990C61E8CA20B
sr0      11:0    1  1024M  0 rom  

Description: sda1-3 (ntfs, fat32, ntfs) already existed. sda4 is my Windows partition. sda5 is my Windows data partition. sda6 is an existing recovery partition (which is actually at the end of the drive). sda7-10 were added by me during Lubuntu installation (swap, root, home, and an extra ntfs partition for exchange, I might later extend sda9 with this).

I see there is no /boot/efi partition. So now I am stuck, and I do not want to take any further action to avoid messing with my system (if I did not already do that).

I mean to have dual boot, be it UEFI (I guess it is preferrable) or not. So my questions are:

  1. Can I get UEFI dual boot? What steps should I follow?
  2. If not, can I get legacy dual boot? What steps should I follow?

Note that I can boot the Windows partition, entering the BIOS and setting UEFI boot. This boots straight to Windows. Then I can switch the BIOS to CSM boot, and that goes straight to grub (where there is no Windows).

Related (but which I did not risk trying yet):

  1. Grub not creating a boot option in UEFI Dual-Boot Win10
  2. Boot into GRUB from Windows boot manager in UEFI dual boot configuration
  3. Dual Boot Problem in UEFI Mode
  4. dual boot UEFI installation
  5. https://www.welivesecurity.com/la-es/2014/07/04/como-tener-dual-boot-ubuntu-windows-8-uefi/
  6. ubuntu 16.04 install creates no boot/efi/
oldfred avatar
cn flag
Converting Windows is just about a new install. Windows requires gpt partitioning for UEFI & MBR(msdos) partitioning for BIOS. Converting from gpt to MBR normally erases drive. Some complicated work arounds, but easier just to have good backup & reinstall. You can convert Ubuntu if installed on gpt drive, just by totally reinstalling grub. You need the UEFI version of grub, not BIOS version. Use Boot-Repair booted in UEFI as that is how systems install or repair. https://help.ubuntu.com/community/Boot-Repair & https://sourceforge.net/p/boot-repair/home/Home/ If issues post link to report.
sancho.s ReinstateMonicaCellio avatar
@oldfred - (Note: I would certainly try avoiding a reinstall of Windows. I don't have the installers, nor for whatever I have in there. It will take me tens of hours, just to get something similar to what I had... I have no problem in reinstalling Lubuntu, but I would avoid it as well, if possible, it would also take a few hours). I am not understanding fully what you mean. I will read some more and get back. So in the meantime, *Would you think I can get UEFI dual boot, without reinstalling Windows?*
oldfred avatar
cn flag
You should always have good backups. Drives fail, systems get stolen or lost, users make errors & select "erase drive" and it erases entire system. And sometimes software fails. Should also have full Windows installer & Lubuntu installer for current version. If updated, get newer version of live installer or Windows ISO. you should only need to reinstall UEFI version of grub or grub-efi-amd64. And Boot-Repair makes it a bit easier but you must be in UEFI mode. https://unix.stackexchange.com/questions/674626/how-to-reinstall-uefi-grub-in-a-disk-where-i-only-can-legacy-boot-using-another
sancho.s ReinstateMonicaCellio avatar
@oldfred - I know about backups, and I often get close to that. As for my specific question, just to double check, I understand you mean "Yes, you can get UEFI dual boot, without reinstalling Windows. You should only need to reinstall UEFI version of grub or grub-efi-amd64...." Is that correct?
oldfred avatar
cn flag
You can use Boot-Repair from Ubuntu live installer in UEFI boot mode, see link on how to use ppa to add it to live installer. Or you have to boot live installer and chroot into your install to repair it. Multiple questions & answers on chroot as bit more involved. UEFI chroot, must include ESP - efi system partition http://askubuntu.com/questions/53578/can-i-install-in-uefi-mode-with-the-alternate-installer/57380#57380
sancho.s ReinstateMonicaCellio avatar
@oldfred - Again, I appreciate your extensive responses. But still, what I am not sure with all you write, is if you mean that "Yes, you can get UEFI dual boot, without reinstalling Windows"... or that I would end up with something different.
oldfred avatar
cn flag
If you have good backups you never have to worry. And I cannot guarantee you will follow the directions in link to add & use Boot-Repair. But Boot-Repair will reinstall grub which only modifies Ubuntu install and will reset UEFI boot order to have Lubuntu as first in boot order. Also grub only boots working Windows, but you should always be able to boot Windows from UEFI boot menu. Again repair disks always recommended.
oldfred avatar
cn flag
Chroot is the command line method. Both chroot & Boot-Repair require a live installer. Many find Boot-Repair easier as it is gui based. How you boot install or repair media UEFI or BIOS, is then how it installs or repairs. So always boot in UEFI mode.
sancho.s ReinstateMonicaCellio avatar
pl flag
@oldfred - I have now read a bit, and I think I understand better what you meant. A few questions popped. 1) [This link](https://askubuntu.com/a/57380/226614) you provided seems to show a method alternative to boot-repair, is that correct? Do I still need to boot the referred-to Live CD (or USB, for that matters) in UEFI mode?
sancho.s ReinstateMonicaCellio avatar
@oldfred - [This](https://serverfault.com/questions/963178/how-do-i-convert-my-linux-disk-from-mbr-to-gpt-with-uefi/963179#963179) (aimed mainly at a conversion MBR->GPT, but nonetheless useful) suggests one can boot in BIOS mode, go through a several-steps procedure, and end with a disk with UEFI boot. 1) Would you agree? 2) Would you think something similar would be applicable in my case? (Information on how to create a UEFI Ubuntu boot is available, but it is also scattered).
oldfred avatar
cn flag
If Windows is in UEFI boot mode, drive must already be gpt partitioned. If you want to keep Windows and it is BIOS/MBR then better to reinstall. Multiple posts where users tried the Windows MBR to gpt conversion & it just did not work, then ended up reinstalling & restoring data from backups. If Windows not involved. Converting to or from GPT - must have good backups. http://www.rodsbooks.com/gdisk/mbr2gpt.html But conversion changes all GUIDs & UUIDs, so editing of fstab to have correct UUIDs and then full reinstall of grub required.
sancho.s ReinstateMonicaCellio avatar
@oldfred - I would go part-by-part. 1) My Windows is in UEFI mode, and the disk has GPT. Anything related to conversion MBR-> GPT is not relevant. 2) I know I need good backups. 3) Would you agree in that one can boot in BIOS mode, go through a several-steps procedure, and end with a disk with UEFI boot? (That is what it seems to me it is implied in the link). For me, it is essential to understand if that is YES or NO. Whatever I try doing depends strongly on that.
oldfred avatar
cn flag
I think so, about step 10 onwards. I do not see the ESP being added to fstab, but grub install will probably do that. You need an ESP and install of grub-efi-amd64. I prefer to use gparted from live installer, to create ESP and then use Boot-Repair from that live installer to reinstall grub. Live installer then must be booted in UEFI mode.
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.