3

I've successfully used mkusb to install a persistent Ubuntu 18.04.2 LTS system on a new Samsung T5 USB SSD. What is nice about mksusb is that it creates a bootable system that works on a wide variety of computer systems. However, I would like to have a portable 'real' Ubuntu installation vs. a live/persistent install that works with both UEFI and BIOS boot methods.

The process outlined here looked like it would do the trick, but in my case I'm just presented with the grub prompt when booting the drive. Note, that I interpreted the step:

Cut grub.cfg from sdx5/boot/grub and paste to sdx3/boot/grub, overwriting the existing grub.cfg file

...to mean that I should move the new grub.cfg file from /dev/sdx5/boot/grub to /dev/sdx3/boot/grub, overwriting the grub.cfg file created by mkusb and deleting the grub configuration file created by the installation from the installation partition. Also, /dev/sdx3 was not mounted after the Ubuntu installation completed, I had to manually mount it (/dev/sdx5 was already mounted on /target).

Since mkusb without modifications works fine with the T5 SSD drive, I assume that there is something about the Ubuntu 18.04.2 LTS installation grub.cfg file that is causing an issue.

Is there an alternative approach that would work, or is there something inherently different with a portable SSD vs. a USB thumb drive that prevents creating a truly portable drive?

Update: I just ran through the process linked above with a spare 64GB micro-USB drive, and it worked fine. I was able to boot it via BIOS and UEFI modes. I think I can safely rule out the specific version of Ubuntu (18.04.2) as the source of the problem, and assume that there is something unique about using a USB SSD vs. a 'standard' thumb drive... not sure if it's the drive size or the hardware interface (I suspect the latter).

Slab
  • 41
  • 2
    See these.https://askubuntu.com/questions/906857/installing-ubuntu-on-usb-and-booting-from-destop-with-uefi & http://askubuntu.com/questions/559007/is-it-still-possible-to-install-ubuntu-to-an-external-harddrive-with-uefi But you can get out of sync on updates. I just use one flash drive for UEFI and one for BIOS. But hardware since 2012 and release of Windows 8 is all UEFI based, so only old systems are still BIOS only. – oldfred Apr 30 '19 at 16:28
  • This ^^^ Unless really needed do not complicate yourself. –  Apr 30 '19 at 16:37
  • 2
    You can try according to this link. The easy way is to use the image file directly. If you want something else, you can make it yourself according to the description in the link. But if it is enough to boot in UEFI mode, you can make it easier according to the tips by oldfred, or according to the following link. – sudodus Apr 30 '19 at 16:57
  • Let us hope that @C.S.Cameron (who created the method in your link) will see your question and help you. – sudodus Apr 30 '19 at 17:18
  • 1
    @sudodus +1 on hoping that he sees this (I attempted to respond directly in that question, but apparently new users can't do that). I appreciate the links that you provided, they did give me a couple of things to try. However, I am looking for a single portable drive that can boot Ubuntu 18.04.2 on both older generation and newer generation systems (I do some traveling education sessions, I often encounter older systems). And thanks for mkusb, far and away the best/easiest tool I've encountered for creating bootable USB drives (persistent or otherwise). – Slab Apr 30 '19 at 17:43
  • 1
    You can make a system yourself for example like this: It is easiest with an MSDOS partition table (but possible also with a GPT, you need a small bios_grub partition). Install in UEFI mode. Boot into the installed system. Remove grub-efi. Install grub-pc (for BIOS mode). Create a BIOS bootloader. Now you can remove grub-pc and reinstall grub-efi. This way you can make your installed system boot both in UEFI mode and BIOS mode. I have used this method several times. This link may help you. Good luck :-) – sudodus Apr 30 '19 at 20:05
  • @Slab: I am at your service. What happens if you try to boot the SSD using the Persistent mkusb install, does that boot? – C.S.Cameron May 01 '19 at 01:42
  • @C.S.Cameron: I appreciate the offer to assist. As per the answer that I just posted, I finally figured it out. As a new user, I don't have the ability to comment in your original answer or to edit it... my only suggestion would be to change 'cut' to 'copy' (as a Windows and Linux user, 'cut and paste' means something different than 'copy and paste' :-)). Thanks so much for posting the brilliant approach! – Slab May 01 '19 at 19:44
  • @Slab: Thanks I will edit the answer. – C.S.Cameron May 01 '19 at 21:28

1 Answers1

1

I've finally determined that the mkusb process linked to in my original question can indeed be used to create a 'real' Ubuntu install, on a portable USB SSD or thumb drive, that boots on both BIOS and UEFI systems.

As it turns out, my assumption as to this step in that process:

Cut grub.cfg from sdx5/boot/grub and paste to sdx3/boot/grub, overwriting the existing grub.cfg file

...was simply incorrect. One doesn't actually 'cut' the grub.cfg file from the /dev/sdx5 partition, you need to 'copy' the grub.cfg file to the /dev/sdx3 partition. As mentioned, /dev/sdx3 was not mounted after the Ubuntu installation, and /dev/sdx5 was mounted on /target. I manually mounted /dev/sdx3 on /media/ubuntu (that directory is created by the installation process it seems) and then copied the file over the mkusb iteration:

sudo mount /dev/sdx3 /media/ubuntu
sudo cp /target/boot/grub/grub.cfg /media/ubuntu/boot/grub

That simple adjustment is all that was necessary, otherwise the procedure that @C.S.Cameron detailed works perfectly well with a portable SSD!

Slab
  • 41
  • While this process worked great for ubuntu 18.04 (through numerous updates no less), I have not been able to make it work with 20.04.1. I've also tried various permutations of this process, also by @C.S.Cameron, and while the resulting drive boots on a UEFI system, the drive is not recognized as bootable by a BIOS system. – Slab Jan 11 '21 at 16:42