This is an automated archive.

The original was posted on /r/ubuntu by /u/Jonthepug on 2023-08-07 11:24:01+00:00.


Hello, I recently installed Ubuntu on an external usb hard drive because it is more comfortable for me, but the problem I am facing here is that I only want to access Ubuntu if I plug in the hard drive. Otherwise, if it’s not plugged in, I just want to go to Windows with my internal hard drive, and what happens is that the moment I unplug the external hard drive, the Ubuntu boot option stays there and so if I have it unplugged I have to go to the BIOS and delete the boot option in order to get to Windows.

So is there any option or way to automatically detect if the hard drive is plugged or not, and if it isn’t, delete the Ubuntu boot option? Thanks!

EDIT: Just to clarify: I am using as an external hard drive a NVMe SSD with a NVMe adapter to USB. It’s an NVMe SSD from a laptop I had and I want to use it with another laptop without replacing the new laptop’s internal space, because I will have Windows on it