1

I just got an external drive with the purpose of running Ubuntu on it. I've searched fora for a while but I haven't found an answer to my specific question, What I would like to have is my exteral SSD divided in 3 partitions - 1 full Ubuntu partition (so not a live mode) - 1 partition (preferable NTFS or FAT) where I can store my work documents - 1 partition (hfs) where I store personal documents

I was hoping to make the external disk bootable by different systems (windows PC and Mac) This is the particular issue I am struggling with as I am not very familiar with booting procedures. I do know I might have to boot in (u)efi most of the time but still in legacy bios from time to time.

How should I do this?

  • This might be what you're looking for – Sumeet Deshmukh Apr 11 '17 at 15:12
  • Anyone who attempts dual booting without reading https://en.wikipedia.org/wiki/Power-on_self-test , https://en.wikipedia.org/wiki/BIOS , https://en.wikipedia.org/wiki/Master_boot_record , https://en.wikipedia.org/wiki/GUID_Partition_Table , https://en.wikipedia.org/wiki/UEFI is doomed to confusion, failure and frustration. – waltinator Apr 11 '17 at 17:22

2 Answers2

1

Preparing an external hard disk to boot Ubuntu in either BIOS/CSM/legacy mode or in EFI/UEFI mode is possible but tricky. I don't have a step-by-step procedure for this, but I do have some tips and recommendations:

  • Use GPT -- Partition the disk using the GUID Partition Table (GPT), rather than the older Master Boot Record (MBR) system. This will facilitate EFI-mode booting, and it should not preclude BIOS-mode booting of Ubuntu. OTOH, use of GPT will complicate accessing the disk from older or more obscure OSes, such as Windows XP, since they don't support GPT.
  • Put the Windows-accessible partition first -- Windows treats some external media (especially USB flash drives) as "superfloppies," meaning that it gives you access to just the first partition, even if that partition is one that Windows can't read because it's HFS+, a Linux partition, etc. This restriction might not apply to your particular disk, so I recommend testing this detail before you put too much effort into anything else; and if you have any doubt, put your Windows data partition first on the disk.
  • Create both a BIOS Boot Partition and an ESP -- A BIOS Boot Partition is a small (~1 MiB) partition that holds part of the BIOS-mode GRUB installation. An EFI System Partition (ESP) is a larger (I recommend 550 MiB) FAT32 partition that holds EFI boot loaders and related files. Although you can do without a BIOS Boot Partition if you use something other than GRUB for the BIOS-mode boot loader, an ESP will be required for your proposed configuration.
  • Learn to control the computer's boot mode -- For your purpose, it's important that you learn to control whether the computer boots in BIOS/CSM/legacy mode or in EFI/UEFI mode. If you don't know how to do this, you'll install in whichever mode the installer happens to boot in, which may not be optimal for your plan. Unfortunately, details of how to do this vary from one computer to another. Typically, you'll see two options for booting your installation medium, one of which includes the string "UEFI" and the other of which doesn't. Once booted, look for a directory called /sys/firmware/efi. If it's present, you've booted in EFI mode; and if it's absent, you've booted in BIOS mode. If you can't seem to get the Ubuntu installer to boot in the desired mode, it may be missing the relevant boot loader, which means you may need to fiddle with the options of whatever program you use to write the .iso file onto a USB flash drive, or even switch programs altogether.
  • Install Ubuntu in BIOS mode, then add an EFI-mode boot loader -- If you install Ubuntu in BIOS mode to the disk, you can tell the installer to put GRUB on the external disk. The external disk should then boot in BIOS mode (or on BIOS-only computers). You can then add an EFI-mode boot loader to the ESP, stored as EFI/BOOT/bootx64.efi (the "fallback filename"). Note that most installation tools for EFI boot loaders will try to store the boot loader under another filename and register it with the NVRAM, but this is not what you want. One relatively easy way to get the desired behavior is to install the Debian package or PPA for my rEFInd boot manager while booted in BIOS mode. When the rEFInd installer sees it's running in BIOS mode, it will install to the fallback filename. Note, however, that I've not tested this code path in a while, so it's conceivable a bug has crept in. You might also want to read this page of mine, which covers EFI boot loader installation in general terms. If you install Ubuntu in EFI mode, it's likely to work on the first computer but then fail when you try to boot it on another computer. You can fix this by copying the boot loader to the fallback filename, but that's a (minor) hassle even if you know exactly what to do, and a head-banger if you don't.
  • Lean about Secure Boot -- If any of the computers on which you want to boot your installation uses Secure Boot, you may need to adjust your EFI-mode boot loader. This is one area where GRUB will work better than rEFInd, since Ubuntu's GRUB and Shim (a program that most Linux distributions use to cope with Secure Boot) can work without modification with Secure Boot. Although you can use rEFInd with Shim and Secure Boot (see its documentation on this subject, you may need to jump through some extra hoops to do so, and you'll have to register at least one Machine Owner Key (MOK) with each Secure Boot computer. This may be an acceptable hassle if you want to boot just a couple of your own computers; but if you want to take the disk to random computers or give it to friends or relatives for them to use, having to register MOKs via the poor user interfaces required to do so may not be acceptable.
  • Test the installed system on multiple computers -- You might think it's working just fine because the system boots on one or two computers, but it might then fail on a third.
  • Be prepared to start again from scratch -- Your first attempt may well end in failure. If this happens, try to figure out what went wrong and either fix the problem or, if necessary, start again from scratch.
Rod Smith
  • 44,284
  • 7
  • 63
  • 105
  • 2nd attempt already ;) – Dave Young Apr 12 '17 at 09:12
  • One more point: Use a 64-bit Ubuntu. The vast majority of EFI-based systems have 64-bit EFIs, which boot 64-bit OSes. Installing a 32-bit Ubuntu on such systems is difficult at best except via the CSM, so you should stick with a 64-bit Ubuntu. The main exception to this rule is certain small systems (mostly Atom-based netbooks and tablets, although some very old Intel-based Macs also quality), which have 32-bit EFIs. – Rod Smith Apr 12 '17 at 13:09
0

You can start Ubuntu from your internal disk and do:

sudo apt install gparted sudo gparted

From there you can repartition the external disk as you like. If you boot from a USB disk with the attached SSD disk on another usb port you can install Linux on it. If you need to install Windows, you better start by installing Windows first and after that you can install Linux, otherwise Windows will destroy the boot sector and Linux will not start. I hope this helps.

You can find more details here: How can I dual-boot Windows 10 and Ubuntu on a UEFI HP notebook?