0

My PC 1 originally had two operating systems on hard disk 1 (HDD1) -

  1. Windows 10 20H2
  2. Ubuntu 20.04.x

I recently attached another hard disk HDD2 from my PC2. It will remain on this machine for a few months now after which it would go back to PC2. That has two operating systems -

  1. Windows 10 1909
  2. Ubuntu 18.04.x LTS

After a recent kernel update to Ubuntu 20.04.x, the bootloader now lists all the four operating systems while booting.

Now I am hoping to update the operating systems on PC2 HDD2 to latest versions but my concerns are -

  1. Windows 10 can be updated in-place and won't disturb bootloader. How do I avoid grub update when I update Ubuntu?
  2. I learnt that if I don't install the bootloader (I plan a fresh install) during the installation process, I can use PC1 - HDD1 Ubuntu's grub but this approach means my PC2 won't boot when I attach this hard drive back.

Is there any other way so that whenever I can just plug HDD2 on PC2 everything works right away?

Chethan S.
  • 2,864
  • 1
    @MarkKirby It's updating grub.cfg what needs to be prevented, not an upgrade of the package. A kernel upgrade would triger update-grub, so should one really prevent upgrading to new kernel (which may be security relevant)? – mook765 Nov 28 '20 at 14:59
  • @mook765 Good point, I may of been a bit quick to dupe this one. Freezing the kernel is probably a bad idea for most people. – Mark Kirby Nov 28 '20 at 15:02
  • What is your reason for connecting PC2 disk to PC1? Data access? I wouldn't try to update PC2 disk while PC1 disk is connected. Is there any reason that you can't return PC2 disk back to PC2 and update there? – heynnema Nov 28 '20 at 15:18
  • 1
    Why don't you change the primary boot drive to the second one in the BIOS settings and update operating systems then switch back? – Jijo Joseph Nov 28 '20 at 16:17
  • I turn off os-prober and only add the systems I really want in grub menu to 40_custom. https://askubuntu.com/questions/848119/how-to-update-grub-on-a-dual-boot-machine/848614#848614 You can also copy boot stanzas from grub.cfg for other systems, if desired before updating with os-prober off. – oldfred Nov 28 '20 at 19:33
  • @heynnema, yes, the main reason is data access. Just wanted to work with my set of customizations. PC2 is in a different city and I won't be going back for a few months. Hence considering how to keep it up-to-date. PC1 operating systems are used by others at home. – Chethan S. Nov 29 '20 at 05:51
  • 1
    If it was ME, I'd just leave it alone... too risky... BUT, if you wish to continue, as I mentioned earlier, I'd disconnect the original PC1 HDD, TRY and boot to the PC2 HDD, and update that way. Windows will have to reconfigure itself at boot time. Are these MBR or GPT disks? – heynnema Nov 29 '20 at 13:57
  • These are GPT disks but yes, I think I will stick to your advice - just leaving it there. – Chethan S. Nov 30 '20 at 14:14

1 Answers1

0

from info manual for grub.

'GRUB_OS_PROBER_SKIP_LIST' List of space-separated FS UUIDs of filesystems to be ignored from os-prober output. For efi chainloaders it's @

I can only give you an example for Bios mode.

GRUB_OS_PROBER_SKIP_LIST='"88411b09-1aaa-4775-9fc7-f60041049d6c@/dev/sda1" "8cc02316-1cd7-4f54-bd1a-c3f174e55251@/dev/sdc1"'

It "tells" os-proper ignore my debian on /dev/sda1 and my groovy on /dev/sdc1.

nobody
  • 5,437