Score:1

Creating a clone of an Ubuntu installation is not recognised as a bootable media

br flag

For a bit of context, I've been dual booting my laptop with Windows 11 / Ubuntu 20.04 no problem for the past 5 months until my laptop got fried. It is a brand new Dell Inspiron 5415 and I believe Ubuntu had something to do with my laptop being rendered useless though the reasons behind my suspicions are irrelevant to my question.

I've taken the included SSD from the fried laptop, put it in an external enclosure and used DiskInternals Linux Reader to extract my entire OS into my tower PC (running Windows 10) as a folder, as well as creating a DSK backup image of it. I continued to use PowerISO to convert said DSK image into an IMG file, which I then used to create a bootable disk using the dd command from a live boot Ubuntu image.

Visualisation to above explanation

However, after all the above, although the extraction was successful and the files are in my new hard drive, my PC can not recognise it as a bootable media (i.e. Hitting F11 on my startup screen does not show me an option to boot from the drive that has my Ubuntu files).

Reading a bit on this maybe the bootloader or some files were missed during the extraction of my data from the laptops drive? I'm not very versed in the low-level parts of an OS so I can't really tell why this is happening.

ChanganAuto avatar
us flag
Did you cloned the ESP (EFI System Partition) as well? If not then there's your answer.
oldfred avatar
cn flag
If UEFI and gpt partitons, you have to make sure GUIDs in primary partition table, backup partition table & any new partitions all match. What does this say? `sudo gdisk -l /dev/sda` change sda to whatever device it is. Often easier just to do a new install & restore from your normal backup.
Marios Yiannakou avatar
br flag
@ChanganAuto I suppose I did not? ... is there a way to check this? A file, a system command?
oldfred avatar
cn flag
If gdisk says partitions are ok, then run this, but best if we see report first before any fix. Probably need advanced mode, not any default fix it suggests. Please copy & paste the pastebin link to the Bootinfo summary report ( do not post report), do not run the auto fix till reviewed.Lets see details, use ppa version with your USB installer (2nd option) or any working install, not Boot-Repair ISO https://help.ubuntu.com/community/Boot-Repair
Marios Yiannakou avatar
br flag
@oldfred Thank you for the suggestion, I have just finished posting the answer that managed to get my Ubuntu installation to be recognised as a boot option. Would it be worth executing the above steps to potentially help anyone else, or will not tell something new since the problem has been fixed?
oldfred avatar
cn flag
Gdisk just shows partitions, if everything works then it will not show much. Boot-Repair essentially runs what you posted as an answer. Its main fixes are updating grub menu or reinstalling grub similar to what you did. But if a more complicated install with /boot or you boot install media in different boot mode UEFI or BIOS than install, then repair does not work. Boot-Repair advises that mode is different, normally.
Score:0
br flag

I managed to fix this by following this guide

  • Boot into Ubuntu from a live CD/USB
  • Using lsblk determine which partition your Ubuntu files are in and mount it.
    • $sudo mount /dev/sdX /mnt where sdX is the drive/partition with the Ubuntu installation that isn't loading
  • Run the following commands
$sudo grub-install --root-directory=/mnt /dev/sdY

$sudo update-grub

$sudo reboot

Where:

  • /mnt is the same directory path that you specified in the previous step.
  • sdY is NOT a partition but the drive with the Ubuntu installation on it (i.e. NOT sda1, but sda regardless of what you mounted in the previous step).

Try this first!

I do want to state though that maybe I was simply dumb and due to my PC hard disk already having another Ubuntu installation, the one I was trying to restore was fine, just not shown by the Windows Boot Manager.

I found the partition I have been trying to install/restore by pressing the F11 key and accessing my motherboards Windows Boot Manager. I am presented with two choices: Windows, and Ubuntu.

After clicking the Ubuntu choice, I am THEN presented with another two choices, boot from the Ubuntu installation from /dev/sdb1 or the Ubuntu installation from /dev/sdb2. After some digging around, turns out my system was restored perfectly fine to /dev/sdb2, but this option was 'hidden' inside the Ubuntu boot manager (i.e. I was not presented with three options in my motherboards boot manager).

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.