ubuntu shows two boots. (ubuntu and an empty hard drive) in the boot menu. Please help fix

please after installing ubuntu i get dual boot. One which is the ubuntu itself and the other which is an empty hard drive (the name of the hard drive). this sometimes causes the system to boot into the empty hard drive whenever i turn it on. Tried deleting using the terminal. Did not work


Use sudo os-prober to see why that entry appears.

os-prober is a Python script to check other partitions for possible operating systems. It is used in update-grub (which is called whenever you get a new kernel via normal updates) to generate the grub config file /boot/grub/grub.cfg from fixed parameters (which you can edit) in /etc/default/grub and dynamic contents, i.e. the kernels that you have on your current Linux partition, and other operating systems on other partitions (for which it uses os-prober).

There are parameters that you can change to disable that automatic OS probing; but I would recommend you check why it detects other systems.

It might be some incomplete (and unbootable) remnants of another system on that partition; of course os-prober cannot know if that other OS is healthy and bootable, it only uses heuristics to check if there is something that probably can be booted.

How to disable it completely:

https://unix.stackexchange.com/questions/56004/how-to-stop-update-grub-from-scanning-all-drives#:~:text=Os-prober%20is%20a%20utility,--purge%20remove%20os-prober%20.