Score:0

Is it possible to eject a USB drive after installation?

cn flag

I am trying to do the whole process of automatic Ubuntu installation. Meaning I plug in the install USB drive and then turn on the PC. The installation finishes without human interaction and finally a login screen shows up.

I have achieved this goal more or less except that the installation reboots after installation. Since the USB drive is still plugged in, it starts to repeat the very same installation again.

I used to do the installation using DVD. The installer eject the DVD after the installation is done. Without pushing the DVD back into the driver, the machine would not go into a installation loop. Therefore, I can start the installation before leaving the office. Let it run overnight, and just have everything ready next morning. Since USB drives do not have a mechanical ejection, it seems no way to run a full unmanned installation process?

Any suggestion for the best practice?

Score:1
jp flag

If your UEFI/BIOS system is set to boot from an internal drive it will do so after reboot. In most computers that kind of boot behaviour can be set via a menu in the UEFI/BIOS system, and you enter that system via a hotkey at boot (press or tap repeatedly, specified in the manual of the computer) or in UEFI mode via one of the options in the grub menu of a standard Ubuntu live drive.

Usually there is a way to get a temporary boot menu (using a hotkey, different in different computers, often but not always F12). Use that method to boot into the USB installer drive and let it install the system into the internal drive.

When it is done, and nobody is there to press the hotkey, the computer will reboot into the new system in the internal drive.


An alternative would be to make the installer shutdown instead of reboot. Then someone can remove the USB installer drive before booting the computer.

neuron mac avatar
cn flag
I am interested in the alternative way. How to do it? I have non-technical personal to help for the installation. To press a hotkey and switch to USB drive boot is kind of complicate to the person.
sudodus avatar
jp flag
@neuronmac, Which version and flavour of Ubuntu do you want to install? (I guess version 22.04.1 LTS but I am not sure). Ubuntu Desktop or Ubuntu Server? Which installer are you using? Did you create a custom installer or modify the standard installer? In that case you could modify it to shutdown instead of reboot after the installation. Please describe what systems you have and what methods/tools you can manage. (You can edit the original question to add these details.)
I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.