Question: Years ago i installed ubuntu on a hard drive in my computer. A few days ago, after the release of 18.04, i bought a ssd and reinstalled everything on that. The old hdd is still linked in the computer - just to look up things.

GRUB does index the old hdd as secondary boot option. But i will never ever boot the old system again. So is there any way to remove the old hard drive from the grub options?

Answer: 
I found my notes on this.

Edit `/etc/default/grub` and add the line

`GRUB_DISABLE_OS_PROBER=true`

Exit, saving changes, then run

`sudo update-grub`

From the grub [wiki](https://help.ubuntu.com/community/Grub2/Setup) (item 16)

> 
> This entry is used to prevent GRUB from adding the results of
>  os-prober to the menu. A value of "true" disables the os-prober check
>  of other partitions for operating systems, **including Windows, Linux,
>  OSX and Hurd**, during execution of the update-grub command. This will
>  keep grub from looking for other OS'es.
> 
> 
>
You can use the `GRUB_OS_PROBER_SKIP_LIST` option to selectively disable scanning devices. So for example, if you want to exclude /dev/sdb1 and /dev/sdc1, first you need to find out their `UUID`:

```
blkid | grep -E 'sdb1|sdc1'

```

Will output something like:

```
/dev/sdb1: LABEL="bkp_root" UUID="1-2-3-4-5" TYPE="ext4" PARTUUID="123"
/dev/sdc1: LABEL="bkp2_root" UUID="a-b-c-d-e" TYPE="ext4" PARTUUID="abc"

```

Then write the option to `/etc/default/grub` using this format:

```
GRUB_OS_PROBER_SKIP_LIST="1-2-3-4-5@/dev/sdb1 a-b-c-d-e@/dev/sdc1"

```

Finally, when you run `sudo update-grub` it will inform you of the changes:

```
Skipped Ubuntu 18.04.5 LTS (18.04) on /dev/sdb1 by user request.
Skipped Ubuntu 18.04.5 LTS (18.04) on /dev/sdc1 by user request.

```