1

So I had a dual boot system where I had Windows and Ubuntu. Since windows wasn't needed I had deleted it. Now I'm not able to boot into anything as it says there is nothing to boot into.

I then used a live usb of Ubuntu 18.04. Using that I can access my Ubuntu as I see all my files and folders.

Running fdisk -l shows that I have Ubuntu installed on /dev/sda8 and there is grub installed on /dev/sda1.

Now it looks like this:

Disk /dev/sda: 238.5 GiB, 256060514304 bytes, 500118192 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
Disk identifier: 0F9F7ABB-A37C-4FE7-8496-93B1538A2283

Device Start End Sectors Size Type
/dev/sda8 2048 500105215 500103168 238.5G Linux filesystem

/dev/sda8 disk contains 120+ Gb of data.

How can I enable grub at startup so I can boot into Ubuntu? I am a newbie in installing multi-OS so please let me know if any additional info is needed.

Gryu
  • 7,279
  • 9
  • 31
  • 52
  • 1
    why grub was installed on a partition, not on disk. You can use `boot-repair` utility from a liveusb to fix it. – Pilot6 Feb 19 '20 at 10:50
  • Try this: https://askubuntu.com/a/326661/925971 – Gryu Feb 19 '20 at 10:53
  • 1
    @Gryu When I try to boot-repair I get "The boot of your PC is in EFI mode, but no EFI partition was detected. You may want to retry after creating a EFI partition(FAT32, 100MB~250MB, start of the disk,boot flag). " – krishnanspace Feb 19 '20 at 11:00
  • Then look at this: https://askubuntu.com/a/831241/925971 – Gryu Feb 19 '20 at 11:03
  • @Gryu Can you help me what is the `X`, `XX`, `XXX` mentioned in the answer?Thanks – krishnanspace Feb 19 '20 at 11:05
  • `sdX` is `sda`, `sdXX` is `sda1` – Gryu Feb 19 '20 at 11:08
  • @Gryu Thanks. What about sdXXX? – krishnanspace Feb 19 '20 at 11:10
  • I think, that is `sda8` with your ubuntu system. But you could show us `ls /dev/sd*` command output. – Gryu Feb 19 '20 at 11:10
  • @Gryu Thanks! Will try it out – krishnanspace Feb 19 '20 at 11:11
  • But there should be present efi partition and boot partition. Maybe you need to repartition your sda1 into three partitions with mount points `/boot`, `/boot/efi`, `/home`. `/boot` and `/boot/efi` should be small – Gryu Feb 19 '20 at 11:16
  • @Gryu How would I do that? Sorry to trouble you – krishnanspace Feb 19 '20 at 11:17
  • Let us [continue this discussion in chat](https://chat.stackexchange.com/rooms/104641/discussion-between-gryu-and-krishnanspace). – Gryu Feb 19 '20 at 11:19
  • Does this answer your question? [How can I repair grub? (How to get Ubuntu back after installing Windows?)](https://askubuntu.com/questions/88384/how-can-i-repair-grub-how-to-get-ubuntu-back-after-installing-windows) – karel Feb 19 '20 at 13:03

1 Answers1

0

The easiest way:

  1. Backup your data
  2. Reinstall Ubuntu by creating proper partition sizes for EFI, boot, root and home partitions: 100Mb, 1Gb, 60Gb, 175+Gb
  3. Move your data back into /home partition

Without reinstalling:

  1. Using GParted shrink /dev/sda8 partition to get 1.2Gb of unallocated space. /dev/sda8 partition should be unmounted.

  2. Create a new partition for /boot/efi mount point of 100Mb size.

  3. Create a new partition for /boot mount point of residual Unallocated space - 1+Gb size.

  4. Try the next:

    sudo mount /dev/sda8 /mnt
    sudo mount /dev/sda5 /mnt/boot (see what it actually is in GParted or fdisk -l - it should be of 1+Gb size)
    sudo mount /dev/sda2 /mnt/boot/efi (see what it is in GParted - it should be 100Mb size)
    for i in /dev /dev/pts /proc /sys /run; do sudo mount -B $i /mnt$i; done
    sudo chroot /mnt
    grub-install /dev/sda
    update-grub

Gryu
  • 7,279
  • 9
  • 31
  • 52