0

I have a situation with my reinstalled Ubuntu 16.04.3 system. During boot stage up, it would stop at the "Grub vr2.02 beta2-36ubuntu3.14" screen, where the grub> prompt appears.

Initially, to boot successfully, I would first use ls and cat (hdX,X)/etc/issue to identify the disk with the Ubuntu 16.04.3 root partition and type:

set root=(hd2,2)
linux /boot/vmlinuz-3.XX.X.X.-XX-generic root=/dev/nvme0n1p2
initrd /boot/initrd.img-3.XX.X.X.-XX-generic
boot

Ubuntu would then boot up and shutdown correctly. However, during the next boot, the above cycle has to be repeated.

After a few such cycles, my system is now stuck at Grub2 again. Grub2 cannot locate my SSD device, i.e. (hdX,X)/dev/nvme0n1 does not exist. However, when I use the Ubuntu bootdisk to enter Ubuntu, I am able to see my SSD via fdisk -l, Gparted and lsblk. E.g.

ubuntu@ubuntu:~$ sudo fdisk -l
Disk /dev/loop0: 1.4 GiB, 1532116992 bytes, 2992416 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes


Disk /dev/nvme0n1: 447.1 GiB, 480103981056 bytes, 937703088 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: gpt

Device             Start       End   Sectors   Size Type
/dev/nvme0n1p1      2048   1050623   1048576   512M EFI System
/dev/nvme0n1p2   1050624 870897663 869847040 414.8G Linux filesystem
/dev/nvme0n1p3 870897664 937701375  66803712  31.9G Linux swap


Disk /dev/sda: 1.8 TiB, 2000398934016 bytes, 3907029168 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
Disklabel type: gpt

Device     Start    End Sectors  Size Type
/dev/sda1   2048 526335  524288  256M EFI System

ubuntu@ubuntu:~$ lsblk
NAME        MAJ:MIN RM   SIZE RO TYPE MOUNTPOINT
loop1         7:1    0  83.1M  1 loop /snap/core/3247
sr0          11:0    1   1.5G  0 rom  /cdrom
loop0         7:0    0   1.4G  1 loop /rofs
sda           8:0    0   1.8T  0 disk 
└─sda1        8:1    0   256M  0 part 
nvme0n1     259:0    0 447.1G  0 disk 
├─nvme0n1p3 259:6    0  31.9G  0 part 
├─nvme0n1p1 259:4    0   512M  0 part 
└─nvme0n1p2 259:5    0 414.8G  0 part 

My SSD and HDD are using GPT and have a EFI partition. Also, my system's UEFI is configured to use EFI.

Questions:

  1. How do I configure Grub2 to locate and connect with the SSD?
  2. How do I fix the Grub boot so that Ubuntu can boot up automatically?

Edit: I do not know the technical steps behind answering my question, however I can share here what I did to recover from my situation. I installed linux mint in the other disk of my system. I did this because my Ubuntu installers had problem installing and I had a functioning Linux Mint installer in-hand. The idea was, if I could successfully install an equivalent OS that utilized grub2 as a bootloader, hopefully that success could fix my bootloading issues too. Fortunately, it worked! Grub2 does detect my SSD and Ubuntu 16.04.3 can boot up flawlessly.

0

I found this article explaining the grub2 repair,restore,reinstall process using a ubuntu-live-cd. I think it gives the answer to my question.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.