Score:0

Is it possible to convert external Ubuntu installation from CSM to EUFI?

cn flag

I'm dual booting Windows 10 (on internal SSD) and Ubuntu 21.04 (on external SSD). Grub is only installed on external SSD, so when it's unplugged PC boots directly into Windows.

I switched from CSM to UEFI booting (this was required to enable SAM on my AMD GPU) and Ubuntu does not boot anymore. However, if I run Ubuntu live from USB stick, it tells me it's is already installed on my external SSD.

Is there a way to boot my external Ubuntu installation? I wouldn't want to reinstall because everything is set up the way I like it.

cn flag
https://help.ubuntu.com/community/Installation/UEFI-and-BIOS https://askubuntu.com/questions/509423/which-commands-to-convert-a-ubuntu-bios-install-to-efi-uefi-without-boot-repair
oldfred avatar
cn flag
Is drive gpt partitioned? Better if it is, but Ubuntu will UEFI boot from MBR(msdos) partitioned drive where Windows will not. Do you have an ESP - efi system partition on external drive? If you just convert from MBR to gpt with most tools, it will erase drive. This supposedly will convert, but require total reinstall of grub which you need anyway. Converting to or from GPT - must have good backups. http://www.rodsbooks.com/gdisk/mbr2gpt.html Use gparted to add ESP, and Boot-Repair's advance mode to totally reinstall grub in UEFI boot mode. Boot live installer in UEFI mode only.
ar flag
If you want to start over, see [Installing Ubuntu in a external hard drive and NOT placing GRUB of my C: hard drive](https://askubuntu.com/questions/327229/installing-ubuntu-in-a-external-hard-drive-and-not-placing-grub-of-my-c-hard-dr)
Score:1
eg flag

You can reinstall Grub2 using your Ubuntu live stick.

Mount the partition your Ubuntu Installation is on. If you are not sure which it is, launch GParted (included in the Live CD) and find out. It is usually a EXT4 Partition. Replace sda1 with the drive and partition number your installation is on, for example:

sudo mount -t ext4 /dev/sda1 /mnt

Now bind the directories that grub needs access to to detect other operating systems, like so.

sudo mount --bind /dev /mnt/dev && sudo mount --bind /dev/pts /mnt/dev/pts && sudo mount --bind /proc /mnt/proc && sudo mount --bind /sys /mnt/sys

Now we need to mount chroot:

sudo chroot /mnt

Now install, check, and update grub.

This time you only need to add the drive letter (usually a) to replace , for example:

grub-install /dev/sda grub-install –recheck /dev/sda update-grub

Now grub is back, all that is left is to exit the chrooted system and unmount everything.

exit && sudo umount /mnt/sys && sudo umount /mnt/proc && sudo umount /mnt/dev/pts && sudo umount /mnt/dev && sudo umount /mnt

Shut down, take out the usb-stick and turn your computer back on, and you will be met with the default Grub2 screen.

If you want to put grub on your internal SSD ( where your Windows is installed ) you need to set it to your internal drive. Although I don't see the point in this ( without the external disk it cannot boot into Ubuntu. ( see gparted ). In my case nvme0n1. see pictureenter image description here

If you want to put grub on your external SSD use that drivename. In my case sda ( external usb-stick ). see pictureenter image description here

If you put grub2 on your external disk and want to boot from it you have to change your settings in your ( what many people still call ) BIOS to boot from usb first.

And Nixie has a video on youtube about this: enter link description here

This should get you booting into Ubuntu again.

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.