PDA

View Full Version : selecting grub install device



lvm
March 20th, 2020, 05:40 PM
During a routine package upgrade (apt-get upgrade) it prompted me


┌─────────────────────────────────────────┤ Configuring grub-pc ├─────────────────────────────────────────┐
│ The grub-pc package is being upgraded. This menu allows you to select which devices you'd like │
│ grub-install to be automatically run for, if any. │
│ │
│ Running grub-install automatically is recommended in most situations, to prevent the installed GRUB │
│ core image from getting out of sync with GRUB modules or grub.cfg. │
│ │
│ If you're unsure which drive is designated as boot drive by your BIOS, it is often a good idea to │
│ install GRUB to all of them. │
│ │
│ Note: it is possible to install GRUB to partition boot records as well, and some appropriate │
│ partitions are offered here. However, this forces GRUB to use the blocklist mechanism, which makes it │
│ less reliable, and therefore is not recommended. │
│ │
│ GRUB install devices: │
│ │
│ [ ] /dev/sda (2000398 MB; HGST_HUS726020ALE614) │
│ [ ] - /dev/sda2 (1999860 MB; /) │


So what should I choose - /dev/sda or /dev/sda2 (mounted as root and where grub.cfg is) or both? grub.cfg mentions /dev/sda2 by uuid. Where is /dev/sda1 which is mounted as /boot/efi? And how can I run it automatically as mentioned in the second paragraph?

18.04. grub-efi-signed is installed although secure boot is disabled - don't know why the installer did it.

Rick St. George
March 20th, 2020, 06:36 PM
I recommend this posting by Old Fred on UEFI boot install & repair - Regularly Updated and Very Detailed:
http://ubuntuforums.org/showthread.php?t=2147295

oldfred
March 20th, 2020, 07:30 PM
This is a BIOS with grub-pc install.

But whether BIOS or UEFI, you always select a drive like sda, never a partition.
If you update partition boot sector it will never be used as BIOS systems only boot from MBR, not PBR. And then the version of grub in MBR is the old version and may not want to boot updated grub in your install.

With BIOS you should have correct settings for update.
#To see what drive grub2 uses see this line - grub-pc/install_devices:
sudo debconf-show grub-pc # for BIOS with grub-pc
It will show drive model & serial number
to see similar drive info
sudo lshw -C Disk -short

#to get grub2 to remember where to reinstall on major updates
sudo dpkg-reconfigure grub-pc
#Enter thru first pages,tab to ok, spacebar to choose/unchoose drive, enter to accept, do not choose partitions
http://ubuntuforums.org/showthread.php?t=2189643