Article 5KX5J Repair Grub 2 distro's on 1 hard disk

Repair Grub 2 distro's on 1 hard disk

by
MeneerJansen
from LinuxQuestions.org on (#5KX5J)
I'd like to know how to repair Grub with a Ubuntu (20.04) live USB stick.

I've got one swap partition and two ext4 partitions, both with a Linux distro on it.

I'm going to (have to) upgrade my Linux distro. For this I'll have to do some resizing with GParted first. Gparted warns me about the risk of Grub getting corrupted. I'm afraid I can't restart my computer after this. I forgot how I configured Grub (years ago). If I'm not mistaken then Grub installs something on the MBR and then looks at one of your partitions for Grub itself and its config files.

These are my particulars:
Code:sudo fdisk -l

Disk /dev/sda: 1000.2 GB, 1000204886016 bytes
255 heads, 63 sectors/track, 121601 cylinders, total 1953525168 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disk identifier: 0x0007240f

Device Boot Start End Blocks Id System
/dev/sda1 1945710592 1953523711 3906560 82 Linux swap / Solaris
/dev/sda2 1863788544 1945710591 40961024 83 Linux
/dev/sda3 * 2048 1043722239 521860096 83 Linux

Partition table entries are not in disk orderCode:sudo blkid
/dev/sda2: UUID="bla bla" TYPE="ext4"
/dev/sda1: UUID="bla bla" TYPE="swap"
/dev/sda3: UUID="bla bla" TYPE="ext4"Sda3 contains my current distro (which isn't supported anymore). Sda2 needs to be expanded using Gparted after which I intend to install Ubuntu 20.04 LTS on it. I have a sneakin' suspicion that the partition that Grub uses to start up my computer is sda3 because it has an asterisk (*) next to it.

How do I repair Grub from Live USB-stick in case of a disaster?latest?d=yIl2AUoC8zA latest?i=ZNyRL7HjynI:VrMIHlBOdTY:F7zBnMy latest?i=ZNyRL7HjynI:VrMIHlBOdTY:V_sGLiP latest?d=qj6IDK7rITs latest?i=ZNyRL7HjynI:VrMIHlBOdTY:gIN9vFwZNyRL7HjynI
External Content
Source RSS or Atom Feed
Feed Location https://feeds.feedburner.com/linuxquestions/latest
Feed Title LinuxQuestions.org
Feed Link https://www.linuxquestions.org/questions/
Reply 0 comments