5

I have a home server that I plan to boot off a USB drive (NOT a live USB, but rather a permanent install to the USB drive). The usual procedure for creating a USB drive with a permanent install on it is this: you use two USB drives. One is a live USB that you boot into, which you then use to install the OS to the other as if it were a normal drive.

Is it possible to skip the middleman and create the permanent install directly? Can I run the installer as a CLI application from within an existing installation, instead of from within the live USB environment?

This might be an XY problem, in which case I'd appreciate any pointers to a better solution! My use case for this is that I'd like to automate my setup as much as possible. Ideally I'd have a script that creates a full installation on a drive without any manual intervention.

  • Have you heard of Automated Server Installation? Would this serve your needs? – mpboden Nov 02 '23 at 21:24
  • @mpboden that's going to be my fallback option if I can't figure out something better. But the problem with it is that you still create a live USB drive. I could probably figure out how to have it automatically install to another USB drive, but this seems error-prone (how do I make sure it doesn't accidentally format my internal drives?) Just feels like directly installing to a USB drive is cleaner, faster, and safer. – Cassiterite Nov 02 '23 at 21:34

1 Answers1

5

Yes, you can, because there is a compressed image of Ubuntu Server that is portable like the iso files. You need no iso file, no installer, only extract and clone from the compressed image to the drive where you want it, an internal drive, an external drive or maybe a virtual drive in a virtual machine.

I would recommend the jammy image that corresponds to version 22.04.x LTS.

See also the thread about the preinstalled image at the Ubuntu Forums, Ubuntu Server amd64 compressed image (when extracted) boots in UEFI and BIOS mode . Please read the whole thread before you start extracting and cloning to your computer.

sudodus
  • 46,324
  • 5
  • 88
  • 152
  • Sick, thanks! Seems like this + Ansible should be able do exactly what I was looking for. Just to make sure: this image is a stable version, right? (asking mostly because it's called "daily", and some discussion in the linked thread) – Cassiterite Nov 02 '23 at 23:24
  • Jammy alias 22.04.x, the stable LTS version is still receiving updates/upgrades. After the installation and testing, you might want to remove the proposed repository in order to get only well tested upgrades. – sudodus Nov 02 '23 at 23:29