7

I've recently installed ubuntu on a SSD, and would like to remove the old grub entries belonging to the ubuntu on the old HDD. I'd like to do one of the following:

  1. Remove the entry from grub (preferably without deleting /etc/grub.d/10_linux)
  2. Remove the files in the old HDD that tell the grub OS-prober that this is an OS.

Any help would be much appreciated.

1 Answers1

3

If you aren't going to be booting from the old HDD, cd to the old HDD root partition and run:

sudo mv /boot /backup-boot 

and then run

sudo update-grub

This should prevent the old installation from being detected.

ish
  • 139,926
  • On Ubuntu 16.04, this doesn't prevent detection. What else OS Prober could be looking for? – marcus Mar 06 '18 at 20:40
  • I renamed bin, boot, lib, lib32, lib64, etc, and usr and finally the old installation stops being detected. The etc dir seems to be essential, I'm not so sure about the others – marcus Mar 06 '18 at 21:01
  • 1
    Another solution is using GRUB_OS_PROBER_SKIP_LIST=UUID@/dev/???? in /etc/default/grub — See: https://askubuntu.com/questions/453038/update-grub-ignoring-some-options-in-etc-default-grub – marcus Mar 09 '18 at 04:37