5

I know you are gonna say this question is already asked but all i could find in searching is answers on how to update grub to remove old kernels and/or installations of linux.

My question is a bit different i have an old installations of windows and linux systems in my grub but i don't have them anymore on my hdd's.

I use dual boot of windows and linux because i have to use photoshop on windows. And recently i bought and SSD, divided it in 2 partitions and installed windows on one and linux on another partitions.

But before that i had 2 HDD's and windows was on one and linux on another hdd.

So when i installed finally linux on my SSD the grub loader found windows and linux installations from old HDD's. But later i formated both my old HDD's and don't have os on them. So now i am stuck with having windows and linux installations of HDD's in grub.

lonerunner
  • 383
  • 1
  • 6
  • 19
  • Related: http://askubuntu.com/questions/88384/how-can-i-repair-grub-how-to-get-ubuntu-back-after-installing-windows/88432#88432 – Elder Geek Mar 12 '15 at 15:23
  • Another use case, where the accepted answer fits perfectly: my work computer is a work station which came with Ubuntu 14.04 pre-installed. Over the years, I added new partitions to install Ubuntu 16.04 and Ubuntu 18.04. This way, I retain my old OS in case something goes wrong. However, not I decided to get rid of the 14.04 and 16.04 partitions to make room for 20.04. As a good housekeeper, I want to update grub after nuking the 14.04 and 16.04 partitions. – Dohn Joe Aug 12 '20 at 09:27

1 Answers1

8

To remove obsolete entries from the GRUB menu open the terminal and type:

sudo update-grub  

update-grub is a stub for running grub-mkconfig -o /boot/grub/grub.cfg to generate a grub2 config file. Other operating systems which have been removed from the computer will also be removed from the GRUB menu once update-grub is run as root.

karel
  • 114,770