DEV Community

Discussion on: How to Install Ubuntu on a Portable External Hard Drive?

Collapse
 
geraldew profile image
geraldew

Ok, with time spare again I've now read the whole post. I see this has been written as a posed question along with a provided answer, which I hadn't realised on a first reading.

Nonetheless, the solution then given takes a different tack compared to my stock method. So that's what I'll now cover.

So in short, the question asked was:

  • Will Ubuntu run entirely on external hard drive, without writing anything to Windows system folders and to registry?

And in short, the answer to that is yes. It is quite possible.

A thing to note however, is that once the booting technology in use is EFI (otherwise known as UEFI), there is more than just the "Windows system folders and .. registry" to worry about. If this distinction is overlooked, then you can find yourself in a situation where updates of either system will interfere with the other (by rewriting the ESP partition).

The other thing to note is that relying on settings on one hard drive (the one internal to the computer) to control how you boot the other (external USB) can cause problems when you don't have both of those in place. Say:

  • when the USB drive is elsewhere, you now have a boot option that won't work (somewhat obviously)
  • a USB drive with Ubuntu Linux on it that can't (easily) be booted in another computer.

Aside: the original question doesn't make it clear if the "OS: Windows 7" is also on a USB drive - or even perhaps the same one. As I don't use Windows much I don't have any experience of installing it to external drives. For this context I'll assume that was internal.

However, another part of the situation given just before that question was:

  • "My external hard drive is partially filled, I need to keep all files."

I would concur with the given answer that it is much better to copy that material off to another drive, perform the new setup and test it, then copy the files back. Assuming the requirement is to have those files instantly accessible to both the Linux and Windows boot, then my method would need adjusting to carve out a partition for them (probably at the end) and formatted as NTFS.

It would be possible to do it all without copying them off and back, but I can't imagine that as being worth the complications involved.

Some other points I'd make:

  • Will USB2 be ok for this? Yes. Will USB3 be noticeably better? Yes.
  • What size USB drive is required? While my article is mainly about using hard drives, I do also use the same technique with USB "thumb" drives - i.e. memory sticks. I have a 16GB one with Ubuntu 20.04 on it, and have had to run a cleanup script a couple of times to make room for updates to work. FWIW the culprit is Snap. I also maintain a 64GB thumb drive with Ubuntu 20.04 without that problem. At a guess, a 32GB might be minimum size to recommend.
  • lately, USB hard drives on the market are coming as Shingled Magnetic Recording (SMR) rather than the older Conventional Magnetic Recording (CMR). I can vouch that SMR drives are NOT suitable for use as bases for a running system. The symptom you'll encounter is that your system will just pause for ten seconds at a time while the drive reshuffles the shingles on write. Alas, like EFI, that becomes a whole other topic and is controversial as manufacturers are being neither open nor clear about which they are using.
Collapse
 
stackallflow profile image
Stack All Flow

Excellent Explanation.