2

I'm trying to install Ubuntu overwriting Windows on a Lenovo ideapad 320 (151IAP). I'm booting off a usb stick created using startup disk creator and an 18.04 image.

This will be a long post, because I've tried quite a few different things, but my hypothesis was that I have a working install of ubuntu and I just need to get it to boot properly; I'm not so sure that's the case anymore. Here is my latest boot-repair output.

Update: I tried booting from grub using these instructions and got errors "can't find /root in /etc/fstab" and "mounting /dev on /root/dev failed: No such file or directory" and same with run. Also, I saw that the /home/dustan/ directory is empty. I'm not really sure how the directory system is supposed to look after a proper install, so correct me if I'm wrong: this seems to me to be evidence against my hypothesis that I only need to repair grub. I tried making the usb stick using mkusb instead of the default startup disk creator; it still hangs on installing grub.

Here's the full story:

The first problem I ran into was the installer hanging on "configuring hardware". I eventually figured out how to disable secure boot and fast boot, per the advice given here, and the installer no longer hangs there.

Instead it hangs at Grub2, so I followed the advice given here (after several failed attempts) to specify the Ubuntu partition (sda2) separate from the boot partition (sda1). It still hung on Grub2 (didn't bypass it, so I'm not really sure what that answer was actually getting at).

In both the configuring hardware and the Grub2 hang cases, I have given the computer literally hours to install properly.

When I look at the log in the installer, it shows repeated instances of "invalid report id data", associated to using the touchpad. There is indeed a known problem with this touchpad and Ubuntu's drivers, but the touchpad has been working in spite of these errors, and I figure if I can ever actually get Ubuntu working I can likely deal with the driver problem later. And unfortunately these errors are probably obscuring any actual crippling errors.

So after many attempts to get that to work properly, I finally decided to attempt to repair Grub.

Before I list boot-repair errors, I forgot to mention another thing that I tried while installing in the midst of the above; once I figured out how to modify the boot line, I tried noacpi, nolapic, irqpoll, and noapic (I was somewhat using this as a reference, but I still had no idea what I was actually doing).

If I follow the recommended repair in boot-repair, it hangs without giving any feedback.

If I disable SecureBoot under advanced options in boot-repair and then run the recommended repair, it will set itself to purge grub, and then it says "Please open a terminal and type the following commands:"

sudo chroot "/mnt/boot-sav/sda2" dpkg --configure -a
sudo chroot "/mnt/boot-sav/sda2" apt-get install -fy
sudo chroot "/mnt/boot-sav/sda2" apt-get purge -y grub*-common grub-common:i386 shim-signed

Running the first command gives:

ubuntu@ubuntu:~$ sudo chroot "/mnt/boot-sav/sda2" dpkg --configure -a
Setting up grub-efi-amd64-signed (1.93+2.02-2ubuntu8) ...
Installing for x86_64-efi platform.
grub-install: error: efibootmgr failed to register the boot entry: Unknown error -1.
dpkg: error processing package grub-efi-amd64-signed (--configure):
 installed grub-efi-amd64-signed package post-installation script subprocess returned error exit status 1
Errors were encountered while processing:
 grub-efi-amd64-signed
ubuntu@ubuntu:~$

I didn't expect the second command to work, but I tried it anyway, and it hung after this:

ubuntu@ubuntu:~$ sudo chroot "/mnt/boot-sav/sda2" apt-get install -fy
Reading package lists... Done
Building dependency tree       
Reading state information... Done
0 upgraded, 0 newly installed, 0 to remove and 43 not upgraded.
1 not fully installed or removed.
After this operation, 0 B of additional disk space will be used.
Setting up grub-efi-amd64-signed (1.93+2.02-2ubuntu8) ...
Installing for x86_64-efi platform.

Trying the terminal method here, the instructions for a separate boot partition are kind of vague, but here was my interpretation:

ubuntu@ubuntu:~$ sudo mkdir /mnt/ubuntu
ubuntu@ubuntu:~$ sudo mkdir /mnt/ubuntu/boot
ubuntu@ubuntu:~$ sudo mount /dev/sda1 /mnt/ubuntu/boot
ubuntu@ubuntu:~$ sudo grub-install --boot-directory=/mnt/ubuntu/boot /dev/sda
Installing for i386-pc platform.
grub-install: warning: this GPT partition label contains no BIOS Boot Partition; embedding won't be possible.
grub-install: warning: Embedding is not possible.  GRUB can only be installed in this setup by using blocklists.  However, blocklists are UNRELIABLE and their use is discouraged..
grub-install: error: will not proceed with blocklists.
ubuntu@ubuntu:~$ sudo umount /mnt/ubuntu/boot

Another terminal method.

ubuntu@ubuntu:~$ sudo mount /dev/sda2 /mnt
ubuntu@ubuntu:~$ sudo mount --bind /dev /mnt/dev && sudo mount --bind /dev/pts /mnt/dev/pts && sudo mount --bind /proc /mnt/proc && sudo mount --bind /sys /mnt/sys
ubuntu@ubuntu:~$ sudo chroot /mnt
root@ubuntu:/# grub-install /dev/sda
Installing for x86_64-efi platform.
grub-install: error: cannot find EFI directory.
root@ubuntu:/# exit
exit
ubuntu@ubuntu:~$ sudo umount /mnt/sys && sudo umount /mnt/proc && sudo umount /mnt/dev/pts && sudo umount /mnt/dev && sudo umount /mnt

Trying again with sda1.

ubuntu@ubuntu:~$ sudo mount /dev/sda2 /mnt
ubuntu@ubuntu:~$ sudo mount /dev/sda1 /mnt/boot
ubuntu@ubuntu:~$ sudo mount --bind /dev /mnt/dev && sudo mount --bind /dev/pts /mnt/dev/pts && sudo mount --bind /proc /mnt/proc && sudo mount --bind /sys /mnt/sys
ubuntu@ubuntu:~$ sudo chroot /mnt
root@ubuntu:/# grub-install /dev/sda
Installing for x86_64-efi platform.
grub-install: error: cannot find EFI directory.
root@ubuntu:/# exit
exit
ubuntu@ubuntu:~$ sudo umount /mnt/sys && sudo umount /mnt/proc && sudo umount /mnt/dev/pts && sudo umount /mnt/dev && sudo umount /mnt/boot && sudo umount /mnt

One more.

ubuntu@ubuntu:~$ sudo mount /dev/sda2 /mnt
ubuntu@ubuntu:~$ sudo mount /dev/sda1 /mnt/boot
ubuntu@ubuntu:~$ sudo mkdir -p /mnt/boot/efi
ubuntu@ubuntu:~$ sudo mount /dev/sda1 /mnt/boot/efi
ubuntu@ubuntu:~$ sudo mount --bind /dev /mnt/dev
ubuntu@ubuntu:~$ sudo mount --bind /proc /mnt/proc
ubuntu@ubuntu:~$ sudo mount --bind /sys /mnt/sys
ubuntu@ubuntu:~$ sudo chroot /mnt
root@ubuntu:/# apt-get install grub-efi-amd64
E: dpkg was interrupted, you must manually run 'sudo dpkg --configure -a' to correct the problem. 
root@ubuntu:/# sudo dpkg --configure -a
Setting up grub-efi-amd64-signed (1.93+2.02-2ubuntu8) ...
Installing for x86_64-efi platform.
grub-install: error: efibootmgr failed to register the boot entry: Unknown error -1.
dpkg: error processing package grub-efi-amd64-signed (--configure):
 installed grub-efi-amd64-signed package post-installation script subprocess returned error exit status 1
Errors were encountered while processing:
 grub-efi-amd64-signed
root@ubuntu:/# exit
exit
ubuntu@ubuntu:~$ sudo umount /mnt/dev
ubuntu@ubuntu:~$ sudo umount /mnt/proc
ubuntu@ubuntu:~$ sudo umount /mnt/sys
ubuntu@ubuntu:~$ sudo umount /mnt/boot/efi
ubuntu@ubuntu:~$ sudo umount /mnt/boot
ubuntu@ubuntu:~$ sudo umount /mnt
  • 1
    You show Ubuntu installed to ESP - efi system partition. But the efibootmgr boot order still shows Linpus Lite as first in boot order. Use f12 or whatever key in UEFI chooses boot order and select the Ubuntu entry. If you have Boot-Repair, you do not need chroot methods. And you must mount efi partition (ESP) and only install the UEFI version of grub, not grub-pc which is for BIOS boot. See man efibootmgr for details, but you can delete the old UEFI entry with sudo efibootmgr -b XXXX -B where XXXX is entry you want to delete, or probably 0003. Use efibootmgr -v to confirm boot order. – oldfred May 21 '18 at 19:47
  • @oldfred That's strange, I see that the pastebin shows 0003 first, but when I listed efibootmgr -v just now, it showed 0000 first. sudo efibootmgr -b 0003 -B caused a segfault. – Dustan Levenstein May 21 '18 at 22:13
  • @oldfred It looks like the bootorder must have come from some of my boot repair efforts, and it was reset after I rebooted. – Dustan Levenstein May 21 '18 at 22:14
  • If you boot Ubuntu entry in UEFI mode, does it boot? Since only one install, it will not show grub menu by default. Can you get grub menu if you press escape after UEFI screen, but before grub finishes. If UEFI fast boot is on, you may not have time to press any key. What brand/model system? What video card/chip? – oldfred May 21 '18 at 22:34
  • 1
    There should be arabbit-hole tag. – Nonny Moose Jun 4 '18 at 22:24
1

The solution was simple: change the bios settings: boot mode to legacy support, boot priority to legacy first. Then reinstall Ubuntu and it worked.

0

I would suggest a manual install using debootstrap.

Boot from the usb drive or rescue cd, then run:

apt update && apt install --yes debootstrap gdisk linux-headers-$(uname -r)

Find out the ID for your HDD, always use ID and not sda, sdb etc.

ls /dev/disk/by-id/

Delete old partitions and create new ones using fdisk (Search Linux Partitioning Scheme on Google)

Mount the root partition to /mnt

Install the OS: (download the latest debootstrap)

wget http://ftp.de.debian.org/debian/pool/main/d/debootstrap/debootstrap_1.0.88_all.deb

dpkg -i debootstrap_1.0.88_all.deb
rm debootstrap_1.0.88_all.deb
apt install ubuntu-archive-keyring
chmod 1777 /mnt/var/tmp
debootstrap xenial /mnt

chroot into the OS:

mount --rbind /dev  /mnt/dev
mount --rbind /proc /mnt/proc
mount --rbind /sys  /mnt/sys
chroot /mnt /bin/bash --login

ln -s /proc/self/mounts /etc/mtab

install a text editor:

apt install nano

edit /etc/apt/sources.list and add:

deb http://archive.ubuntu.com/ubuntu xenial main universe deb-src http://archive.ubuntu.com/ubuntu xenial main universe

deb http://security.ubuntu.com/ubuntu xenial-security main universe deb-src http://security.ubuntu.com/ubuntu xenial-security main universe

deb http://archive.ubuntu.com/ubuntu xenial-updates main universe deb-src http://archive.ubuntu.com/ubuntu xenial-updates main universe

Setup keyboard language and locale:

apt update
locale-gen en_US.UTF-8
echo 'LANG="en_US.UTF-8"' > /etc/default/locale
dpkg-reconfigure tzdata

Install Ubuntu:

apt install --yes ubuntu-minimal
apt install --yes --no-install-recommends linux-image-generic

Set a password:

passwd

Install GRUB: Install GRUB to the disk(s), not the partition(s)!

apt update
apt install --yes grub-pc

(do not install grub, yet)

Edit /etc/default/grub

  • Comment out: GRUB_HIDDEN_TIMEOUT=0
  • Remove quiet and splash from: GRUB_CMDLINE_LINUX_DEFAULT
  • Uncomment: GRUB_TERMINAL=console
  • At the line GRUB_CMDLINE_LINUX add net.ifnames=0

Then Run:

update-grub

grub-install /dev/disk/by-id/YOUR HDD ID

if you have more HDD's install grub on them too!

Should say:

Installing for i386-pc platform. Installation finished. No error reported.

Now time for reboot:

exit
reboot

reboot -f (if it doesn't want to reboot)

You will now hopefully be inside a minimal Ubuntu.

From there you want to configure Swap and install all the programs you want. And install a sudo user so that you do not run as root.

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.