Can't boot Mint from external drive on different computer

Questions about Grub, UEFI,the liveCD and the installer
Forum rules
Before you post please read how to get help
Post Reply
AMDphreak
Level 1
Level 1
Posts: 7
Joined: Wed Oct 16, 2019 2:16 am

Can't boot Mint from external drive on different computer

Post by AMDphreak »

Fresh install of Mint on an external drive. I installed it using a Mac desktop. It boots on the Mac desktop (hold Alt key and then select disk).
I brought the disk home. Tried to boot from it on a Windows desktop. It fails every time and instead boots Windows from internal disk.

I'm analyzing the disk from a Live USB Mint drive. It looks like there is a bootloader partition on the drive.

Linux Mint also partitioned the disk wrong: Partition 1 does not start on physical sector boundary. This really sucks, because I went through hell before installing Linux Mint to get rid of overlapping partitions. Some idiotic tool wrote a partition to my drive inside of an existing partition. So all of the partition editors refused to erase the drive entirely, because the partition table was botched. Can anyone in Linux land get any of this stuff right?

I have already inspected the contents of /dev/sdc1 (the FAT partition that has the boot flag set). I mounted it to a folder and there was nothing inside the folder. This doesn't seem promising. Is the bootloader gone?

Screenshots:
https://imgur.com/a/X07p4BY

pbear
Level 14
Level 14
Posts: 5206
Joined: Wed Jun 21, 2017 12:25 pm
Location: San Francisco

Re: Can't boot Mint from external drive on different computer

Post by pbear »

Hello AMDphreak, welcome to the Linux Mint Forums.

Let's start with, this is a user forum. We're volunteers. We don't design the operating system. We're not responsible for its foibles, bugs and other problems. It's not only unfair but pointless to scold us because you're frustrated.

I mention all this because it might be worse than you realize. Have you tried booting the Mac since you did the installation? There's a bug in the installer which I expect will have made it unbootable without the USB drive attached. Don't shoot the messenger. Please don't even shout at the messenger. I've spent a lot of time on this problem (as a user) and wrote a tutorial on how to get around the bug. I don't have one, but a few Mac users have reported success using the methods described in the tutorial. Meanwhile, you're probably looking at boot repair on the Mac, about which I know nothing.

As for your partition table problem, I'm puzzled. The main partition tool in Mint (indeed, Linux generally) is GParted. Have you tried using that? It's included in the live ISO. I've never had the least trouble redoing the partition table of a USB drive. First you create a new table, then you format the partitions. If you didn't use GParted, what did you use?

fabien85
Level 7
Level 7
Posts: 1761
Joined: Tue Mar 11, 2014 4:30 pm

Re: Can't boot Mint from external drive on different computer

Post by fabien85 »

To repair the boot on MacOS is very simple :
with nothing attached to the computer, boot pressing Alt/option. You will get an entry to boot MacOS, usually called Macintosh HD (unless you changed the name of the internal hard drive) with the icon of an internal hard drive. Once you are booted to MacOS, got to System Preferences > Startup Disk, and click to select the internal hard drive (you may need to unlock the panel with your password).

I dont think it's really a problem if the Partition 1 does not start on physical sector boundary. It's just 34 MB, negligible compared to the size of the drive.
If you really want to get rid of this, you would need to reformat the hard drive (and thus lose the install), e.g. with gparted as pbear says in Device > Create Partition Table. This erases all partitions on the disk, so make sureyou are applying this to the correct disk, and make sure that's really what you want to do.

For the empty EFI partition, indeed that's a bug in the installer, the bootloader probably went to the EFI partition of the Mac as pbear said.
But anyway it wouldnt have worked.
To make a (EFI-) bootable external drive is slightly different than just installing to an internal drive. Because the machine needs to know where to look for the bootloader. For a standard install, the location of the bootloader is stored in the NVRAM (it's the same for MacOS, Linux and windows).
With an external drive, the new machine wouldnt know where to look for the bootloader. So you have to put it at what is called the fallback location : EFI/BOOT/bootx64.efi on the EFI partition. You can e.g. take a look at my tutorial (which does other things too) : viewtopic.php?f=42&t=256750

pbear
Level 14
Level 14
Posts: 5206
Joined: Wed Jun 21, 2017 12:25 pm
Location: San Francisco

Re: Can't boot Mint from external drive on different computer

Post by pbear »

fabien85 wrote:
Wed Oct 16, 2019 7:08 am
To repair the boot on MacOS is very simple :
Cool beans. Bookmarked.

AMDphreak
Level 1
Level 1
Posts: 7
Joined: Wed Oct 16, 2019 2:16 am

Re: Can't boot Mint from external drive on different computer

Post by AMDphreak »

pbear wrote:
Wed Oct 16, 2019 3:05 am
Hello AMDphreak, welcome to the Linux Mint Forums.

Let's start with, this is a user forum. We're volunteers. We don't design the operating system. We're not responsible for its foibles, bugs and other problems. It's not only unfair but pointless to scold us because you're frustrated.
Hey, I understand the volunteer situation. I'm pointing fingers...at the whole practice of software development and system engineering. It's too much for one person to learn, and too much for one person to maintain coherence between the specific programs that the industry relies on. And the problem is that in order for users to have any confidence in their own software systems, they need to learn this stuff, so it needs to have a less drastic learning curve. The idea behind FOSS is that the user can be his own operating system designer. I want it to be that way without making it unbearable for future programmers to retrace our steps and then pick up where we left off. The opposite of pointing fingers is no accountability for a problem that affects everyone. Unabated, this results in an unsustainable ecosystem (and an unwelcome ecosystem will result in further erosion of the ecosystem). We all love Mint (or whatever Linux you join), so we all have to make it liveable.
pbear wrote:
Wed Oct 16, 2019 3:05 am
I mention all this because it might be worse than you realize. Have you tried booting the Mac since you did the installation? There's a bug in the installer which I expect will have made it unbootable without the USB drive attached. Don't shoot the messenger. Please don't even shout at the messenger. I've spent a lot of time on this problem (as a user) and wrote a tutorial on how to get around the bug. I don't have one, but a few Mac users have reported success using the methods described in the tutorial. Meanwhile, you're probably looking at boot repair on the Mac, about which I know nothing.
That is correct. The MacOS computer will not boot without the external drive connected. I found some advice suggesting using the MacOS installation medium (USB flash drive in my case) to restore the NVRAM and boot sector by tricking the partition tool into rewriting it (drag to resize partition, then drag back to original size and position, but the app will let you click the write button, and it overwrites the sector). This incidental fix has been removed from newer Installers. The last time it worked was 2016.

As far as getting around the error, I'm going to try to change the default boot target in grub.cfg. I wonder if the bootloader is loading information from the external drive when running (before the user selects what to boot)--or if the bootloader is going to work in isolation. If it works in isolation, then Mint is mounting the bootloader partition onto a directory (maybe /boot/EFI or one of the other folders in /boot).
pbear wrote:
Wed Oct 16, 2019 3:05 am
As for your partition table problem, I'm puzzled. The main partition tool in Mint (indeed, Linux generally) is GParted. Have you tried using that? It's included in the live ISO. I've never had the least trouble redoing the partition table of a USB drive. First you create a new table, then you format the partitions. If you didn't use GParted, what did you use?
To create the partition scheme in the screenshots, I used the Mint installer with a blank SSD as the install target. The SSD was originally not blank. It had the overlapping partitions in the partition table. I had written to it from Windows using BalenaEtcher (formerly Etcher.io) to write an ISO image. (EDIT: The overlapping partitions are the result of a bug that I just documented and reported to BalenaEtcher here)

To get rid of the broken partition table, I used `wipefs` (man page). parted and sfdisk did not work--they did not like the overlapping partitions and refused to erase the table or reformat partitions. In the Mint installer, the Disk util app and Installer app wouldn't erase it either (guess they are based on parted). They read the partition table and gave up when it didn't make sense.

MacOS's partition tools also were incapable of erasing the disk. The tools required the user to specify a partition to reformat and a mac-supported filesystem to format as. It reformatted the partition that was listed inside the other partition, but not the outer partition--but it wouldn't let me delete the inner partition, after reformatting it.

I tried to modify and overwrite the partition table using `sfdisk` unsuccessfully:
Following these instructions:
I used `sfdisk` to extract the partition table (`sfdisk -d` to dump the partition table. `sfdisk -d /dev/sda > file.txt` to dump table into a text file). Then I edited the table in a text editor and overwrote the partition table with the modified table (`sfdisk /dev/sda < file.txt`), but it didn't work. It still showed the inner partition, afterward. `sfdisk` reporte it successful, so I interpret that to mean that it simply overwrote the first part of the table and stopped writing when it ran out of input file bits (leaving the erased entry untouched on the partition table, instead of erasing it).

Pertaining to your tutorial for getting around the bug:
I believe it would be more sensible for the installer to automatically write the bootloader to the drive which the distribution is installed to. I know there isn't an easy answer, but if the drive is empty, then it makes sense that the user wants to boot from that drive as well. Multiboot environments make this assumption a no-go, but to be fair, the installer does not warn the user that it is going to overwrite the bootloader on the internal drive and rewrite the NVRAM (I'm still fuzzy on whether it overwrote the NVRAM).

Also, since it is *not* a fair assumption that the user wants to replace the NVRAM with a pointer to GRUB on the external drive, there needs to be a solid explanation of what the installer is going to do to the NVRAM, and ideally it would also explain what it's going to do to the boot sector. Not explaining is easier, but this is causing problems, obviously, so the user needs to make the decision. I don't believe a textual explanation is sufficient for non-technical people, so we should provide a visual diagram in addition to a questionnaire to guide them through the decision-making process.

questions to ask:
  • Do you intend to use this installation on an external drive? Yes/No -- Instead of asking, the installer could detect this by using some command to identify whether the device is connected internally or externally. I searched for a command that does this or a way to do this with pipes/script but came up with no answer. hdparm, lsusb are included in Mint. Grepping `hdparm -I /dev/sdblah might be a starting point.
    • Do you intend to use this installation on more than one computer? Yes/No -- If yes, we can infer from their answer that the bootloader should be put on the install disk and NVRAM should be unchanged.
Last edited by AMDphreak on Sat Oct 19, 2019 5:49 pm, edited 2 times in total.

pbear
Level 14
Level 14
Posts: 5206
Joined: Wed Jun 21, 2017 12:25 pm
Location: San Francisco

Re: Can't boot Mint from external drive on different computer

Post by pbear »

Sigh. We've given you three suggestions and you discard all three. In particular, you decline to use any of the installation workarounds because you "believe it would be more sensible for the installer to" work the way you think it should. Suit yourself. I hope it works out repairing the MacOS bootloader. Has to be possible. Try a Mac user forum. Good luck.

AMDphreak
Level 1
Level 1
Posts: 7
Joined: Wed Oct 16, 2019 2:16 am

Re: Can't boot Mint from external drive on different computer

Post by AMDphreak »

fabien85 wrote:
Wed Oct 16, 2019 7:08 am
To repair the boot on MacOS is very simple :
with nothing attached to the computer, boot pressing Alt/option. You will get an entry to boot MacOS, usually called Macintosh HD (unless you changed the name of the internal hard drive) with the icon of an internal hard drive. Once you are booted to MacOS, got to System Preferences > Startup Disk, and click to select the internal hard drive (you may need to unlock the panel with your password).
Thanks. I'll test.
fabien85 wrote:
Wed Oct 16, 2019 7:08 am
I dont think it's really a problem if the Partition 1 does not start on physical sector boundary. It's just 34 MB, negligible compared to the size of the drive.
If you really want to get rid of this, you would need to reformat the hard drive (and thus lose the install), e.g. with gparted as pbear says in Device > Create Partition Table. This erases all partitions on the disk, so make sureyou are applying this to the correct disk, and make sure that's really what you want to do.
Thank you. I'm concerned in the sense that the tool should not generate any formatting that it detects as errors later. This just seems like a basic tooling principle. Everything seems to work right now, but perhaps this points to a logic or arithmetic bug in the installer or the upstream projects. I've used computers a long time, and what "seems to work" today inevitably gives me a problem down the road.
fabien85 wrote:
Wed Oct 16, 2019 7:08 am
For the empty EFI partition, indeed that's a bug in the installer, the bootloader probably went to the EFI partition of the Mac as pbear said.
But anyway it wouldnt have worked.
To make a (EFI-) bootable external drive is slightly different than just installing to an internal drive. Because the machine needs to know where to look for the bootloader. For a standard install, the location of the bootloader is stored in the NVRAM (it's the same for MacOS, Linux and windows).
With an external drive, the new machine wouldnt know where to look for the bootloader. So you have to put it at what is called the fallback location : EFI/BOOT/bootx64.efi on the EFI partition. You can e.g. take a look at my tutorial (which does other things too) : viewtopic.php?f=42&t=256750
I'll take a look and update this.

AMDphreak
Level 1
Level 1
Posts: 7
Joined: Wed Oct 16, 2019 2:16 am

Re: Can't boot Mint from external drive on different computer

Post by AMDphreak »

fabien85 wrote:
Wed Oct 16, 2019 7:08 am
To repair the boot on MacOS is very simple :
with nothing attached to the computer, boot pressing Alt/option. You will get an entry to boot MacOS, usually called Macintosh HD (unless you changed the name of the internal hard drive) with the icon of an internal hard drive. Once you are booted to MacOS, got to System Preferences > Startup Disk, and click to select the internal hard drive (you may need to unlock the panel with your password).
If this is different advice from the one I mentioned above, then this cannot work for me. I do not have admin rights on the installation of macOS. I am using an institutional computer to run Mint on the external drive. Short of having the institution reinstall and reconfigure the macOS installation, my options are to fix it the [no-so] fast way.

Most OSes provide a way to fix the bootloader from an installation medium, but I did not find any way to do this.

fabien85
Level 7
Level 7
Posts: 1761
Joined: Tue Mar 11, 2014 4:30 pm

Re: Can't boot Mint from external drive on different computer

Post by fabien85 »

AMDphreak wrote:
Thu Oct 17, 2019 4:49 pm
fabien85 wrote:
Wed Oct 16, 2019 7:08 am
To repair the boot on MacOS is very simple :
with nothing attached to the computer, boot pressing Alt/option. You will get an entry to boot MacOS, usually called Macintosh HD (unless you changed the name of the internal hard drive) with the icon of an internal hard drive. Once you are booted to MacOS, got to System Preferences > Startup Disk, and click to select the internal hard drive (you may need to unlock the panel with your password).
If this is different advice from the one I mentioned above, then this cannot work for me. I do not have admin rights on the installation of macOS.
This advice is the same as the first one you quoted in the post of 8:42pm. It's the same quote.

If you do not have admin rights on macOS
- first may I say that it has been quite bold from your side to use a computer you have no admin right on, in order to install Linux.
I would never do this.
- second, still try the advice, it may work
- third, if it does not work you should reset the NVRAM. On Macs there is a key combination that you can press at boot to do this. The next boot is going to be longer : the time that the firmware finds macOS and reinitialises the NVRAM. After that the machine will boot directly to macOS.
If that does not work, go to your sysadmin and tell them you screwed up.

pbear
Level 14
Level 14
Posts: 5206
Joined: Wed Jun 21, 2017 12:25 pm
Location: San Francisco

Re: Can't boot Mint from external drive on different computer

Post by pbear »

fabien85 wrote:
Fri Oct 18, 2019 5:57 am
If that does not work, go to your sysadmin and tell them you screwed up.
Well, whether the OP screwed up will depend on the precise terms of his (or her) organization's policy.

In any event, AMDphreak, if it comes to this, be sure to mention you're in this mess because of a bug you had no reason to know would be a problem. Here's a link to the main bug report. Understand, Mint is based on Ubuntu and uses its installer, so this bug applies also to Mint.

Good luck.

deepakdeshp
Level 17
Level 17
Posts: 7726
Joined: Sun Aug 09, 2015 10:00 am

Re: Can't boot Mint from external drive on different computer

Post by deepakdeshp »

pbear wrote:
Fri Oct 18, 2019 10:43 am
fabien85 wrote:
Fri Oct 18, 2019 5:57 am
If that does not work, go to your sysadmin and tell them you screwed up.
Well, whether the OP screwed up will depend on the precise terms of his (or her) organization's policy.

In any event, AMDphreak, if it comes to this, be sure to mention you're in this mess because of a bug you had no reason to know would be a problem. Here's a link to the main bug report. Understand, Mint is based on Ubuntu and uses its installer, so this bug applies also to Mint.

Good luck.
The bug report is 6 year old. So should the op report it?
If I have helped you solve a problem, please add [SOLVED] to your first post title, it helps other users looking for help, and keeps the forum clean.
Regards,
Deepak

I am using Mint 19.3 Cinnamon 64 bit with AMD A8/7410 processor . Memory 8GB

pbear
Level 14
Level 14
Posts: 5206
Joined: Wed Jun 21, 2017 12:25 pm
Location: San Francisco

Re: Can't boot Mint from external drive on different computer

Post by pbear »

deepakdeshp wrote:
Fri Oct 18, 2019 2:23 pm
The bug report is 6 year old. So should the op report it?
Perhaps you know something I don't, but my understanding is that Ubuntu doesn't accept bug reports from Mint users.

By the way, it's not like bug has been forgotten in Ubuntu land. Two senior members of the Ubuntu forum (oldfred and sudodus) have been fielding help requests on this issue for years. If they can't get Canonical to focus on it, I'm skeptical anyone can. Frankly, I think it's outrageous a bug of this magnitude has gone unfixed for six years. For that matter, I don't think it's okay at this point for Mint to pass the buck. But it is what it is.

Anyhoo, AMDphreak, if you want to try reminding Ubuntu about the bug, by all means go for it.

AMDphreak
Level 1
Level 1
Posts: 7
Joined: Wed Oct 16, 2019 2:16 am

Re: Can't boot Mint from external drive on different computer

Post by AMDphreak »

Thanks for the help, all of you.

I will bug Canonical to death...pun intended.

It appears I ran into two separate bugs during this install process. The Ubuntu one, and another one with the burn tool I used, which formatted the install disk with a random bogus listing in the partition table pointing to an EFI FAT partition inside the real partition. I already reported the bug to Balena Etcher here.
That is--assuming that all of the Linux distros aren't using the same ISO-creation software with a bug which then writes a bogus table into the ISO image.

AMDphreak
Level 1
Level 1
Posts: 7
Joined: Wed Oct 16, 2019 2:16 am

Re: Can't boot Mint from external drive on different computer

Post by AMDphreak »

I think it's funny that I can break their computer without permission, but I can't fix it without permission. *sigh*

pbear
Level 14
Level 14
Posts: 5206
Joined: Wed Jun 21, 2017 12:25 pm
Location: San Francisco

Re: Can't boot Mint from external drive on different computer

Post by pbear »

AMDphreak wrote:
Sat Oct 19, 2019 6:01 pm
I think it's funny that I can break their computer without permission, but I can't fix it without permission. *sigh*
True that.

Post Reply

Return to “Installation & Boot”