LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Laptop and Netbook
User Name
Password
Linux - Laptop and Netbook Having a problem installing or configuring Linux on your laptop? Need help running Linux on your netbook? This forum is for you. This forum is for any topics relating to Linux and either traditional laptops or netbooks (such as the Asus EEE PC, Everex CloudBook or MSI Wind).

Notices


Reply
  Search this Thread
Old 10-29-2017, 04:11 AM   #1
watchingu
LQ Newbie
 
Registered: Oct 2017
Distribution: Debian Stable & Unstable
Posts: 27

Rep: Reputation: 11
Grub-Install Results in Unbootable Laptop


A few days ago, I performed a grub-install while booted into Debian 9 Stretch on sda2 on my laptop. Following is the output resulting from that attempt:

Code:
sudo grub-install /dev/sda

Installing for x86_64-efi platform.
Could not prepare Boot variable: No space left on device
grub-install: error: efibootmgr failed to register the boot entry: Input/output error.
When I rebooted the computer, I was immediately brought to the BIOS screen for my laptop; i.e. I'm not able to boot my laptop any longer.

Pertinent hardware info for my laptop, which is an ASUS Zenbook UX303LA.

BIOS: American Megatrends, version UX303LA.204, 09/01/2014
Mobo: ASUSTek

parted printout:

Code:
parted /dev/sda print

Model: ATA Crucial_CT512M55 (scsi)
Disk /dev/sda: 512GB
Sector size (logical/physical): 512B/4096B
Partition Table: gpt
Disk Flags:

Number  Start   End     Size    File system     Flags
 1      1049kB  538MB   537MB   fat32           boot, esp
 2      538MB   27.4GB  26.8GB  ext4
 3      27.4GB  54.2GB  26.8GB  ext4
Output of efibootmgr -v (using SystemRescueCD):
Code:
Boot0002* Hard Drive    BBS(HD,,0x0)..GO..NOs........Q.S.a.n.D.i.s.k....................A....................$..Gd-.;.A..MQ..L.S.a.n.D.i.s.k........BO
Contents of sda1, the boot partition:
Code:
ls -l /mnt/boot
total 8
drwxr-xr-x 3 root root 4096 Mar 20  2015 EFI
drwxr-xr-x 2 root root 4096 Oct 16 00:01 grub

ls -l /mnt/boot/EFI
total 4
drwxr-xr-x 2 root root 4096 Mar 20  2015 debian

ls -l /mnt/boot/grub
total 0

ls -l /mnt/boot/EFI/debian
total 120
-rwxr-xr-x 1 root root 121856 Oct 14 05:13 grubx64.efi
Contents of /boot on sda2:
Code:
total 55740
-rw-r--r-- 1 root root    186386 Sep 18 21:34 config-4.9.0-3-amd64
-rw-r--r-- 1 root root    186386 Sep 28 13:27 config-4.9.0-4-amd64
drwxr-xr-x 2 root root      4096 Aug 24 16:48 efi
drwxr-xr-x 5 root root      4096 Oct 14 01:18 grub
-rw-r--r-- 1 root root  20946714 Sep 21 00:51 initrd.img-4.9.0-3-amd64
-rw-r--r-- 1 root root  20955296 Oct  9 00:05 initrd.img-4.9.0-4-amd64
-rw-r--r-- 1 root root   3180929 Sep 18 21:34 System.map-4.9.0-3-amd64
-rw-r--r-- 1 root root   3182709 Sep 28 13:27 System.map-4.9.0-4-amd64
-rw-r--r-- 1 root root   4204320 Sep 18 21:34 vmlinuz-4.9.0-3-amd64
-rw-r--r-- 1 root root   4208416 Sep 28 13:27 vmlinuz-4.9.0-4-amd64
My attempt to re-install grub using SystemRescueCD:
Code:
grub-install /dev/sda
Installing for x86_64-efi platform.
grub-install: error: cannot find EFI directory.
My attempt to boot sda using SystemRescueCD v5.1.1:
Code:
...
>> Searching root filesystem having /sbin/init
>> File /sbin/init found on alread mounted filesystem, link created in /newroot
>> Checking /sbin/init can be executed by the current kernel...
readelf: Error: '/newroot/sbin/init': No such file
   /sbin/init on the root filesystem is an  binary
   The current running kernel architecture is x86_64
mount: mounting /dev on /newroot/dev failed: No such file or directory
!! /sbin/init not found on root filesystem
!! Running a mini shell (cannot complete the boot process)
/bin/sh: can't access tty; job control turned off
/ # _
Contents of /sbin/init on sda2:
Code:
mkdir -p /mnt/linux
mount -r /dev/sda2 /mnt/linux
ls -l /mnt/linux/sbin/init
lrwxrwxrwx 1 root root 20 Jul  5 20:31 /mnt/linux/sbin/init -> /lib/systemd/systemd
Based on research I've done, this could be an issue with non-volatile RAM (NVRAM), but I've not found a good solution for the issue.
 
Old 10-30-2017, 09:14 AM   #2
plasmonics
Member
 
Registered: Jan 2009
Distribution: Fedora, Gentoo, LFS
Posts: 193

Rep: Reputation: 63
It looks like it is not finding the EFI system partition. The ESP has to be mounted at /boot/efi. The command is just "grub-install". it looks for the ESP and creates subdirectories EFI/debian. Then it runs efibootmgr to register the boot loader with the NVRAM. If you have done all this and it still doesn't work then it is probably the nvram. Not sure how to fix that. You could try looking for the latest bios for your motherboard and flash it.
 
Old 11-01-2017, 01:31 AM   #3
watchingu
LQ Newbie
 
Registered: Oct 2017
Distribution: Debian Stable & Unstable
Posts: 27

Original Poster
Rep: Reputation: 11
I have the latest BIOS...204.
 
Old 11-10-2017, 06:02 PM   #4
watchingu
LQ Newbie
 
Registered: Oct 2017
Distribution: Debian Stable & Unstable
Posts: 27

Original Poster
Rep: Reputation: 11
I just wanted to provide an update on some things I have done that have not resolved the problem.

I compared the contents of the ESP partition (sda1) on my desktop and laptop and noticed that my laptop contained a grub folder, but my desktop did not. So, I deleted the grub folder under sda1 on my laptop, but the laptop still boots directly into the BIOS setup.

I read that resetting your BIOS to its default values might work, so I tried that. My laptop still boots directly into the BIOS setup.

Finally, I decided to try to delete and recreate the ESP and attempt to reinstall Debian Stretch. When the Debian Stretch installer gets to the point of setting up grub, it attempts to install grub on the hard drive and fails. Basically, that tells me that the Debian installer is unable to see, or install grub on, the ESP. Error message:

Code:
Unable to install GRUB in dummy
Executing 'grub-install dummy' failed.
This is a fatal error.

Last edited by watchingu; 11-10-2017 at 06:05 PM.
 
Old 11-17-2017, 05:45 PM   #5
TheEzekielProject
Member
 
Registered: Dec 2016
Distribution: Devuan
Posts: 476

Rep: Reputation: 115Reputation: 115
Quote:
sudo grub-install /dev/sda

Installing for x86_64-efi platform.
Could not prepare Boot variable: No space left on device
grub-install: error: efibootmgr failed to register the boot entry: Input/output error.
Says there was no space on the device, sounds like you just ran out of room on the EFI partition.

Being an UEFI computer, it should be able to boot the kernel directly, without Grub. I have an Asus laptop as well if yours happens to have American Megatrends UEFI (bios) interface, you should be able to select Boot>Add new boot option> and select your disk and boot
 
Old 11-18-2017, 01:42 AM   #6
watchingu
LQ Newbie
 
Registered: Oct 2017
Distribution: Debian Stable & Unstable
Posts: 27

Original Poster
Rep: Reputation: 11
Thank you for your response, TEP. No, there's plenty of space on the EFI partition. As I stated in my OP, I believe the issue has to do with NVRAM.

I do have an American Megatrends BIOS. I still have Debian Stretch installed on one partition, so I'll try your suggestion. However even if it works, it is only a bandaid solution IMO. I need to be able to get grub to install or I will not be able to install/re-install any distros. I would also like to understand why this is happening.
 
Old 11-19-2017, 06:52 AM   #7
NevemTeve
Senior Member
 
Registered: Oct 2011
Location: Budapest
Distribution: Debian/GNU/Linux, AIX
Posts: 3,315

Rep: Reputation: 1008Reputation: 1008Reputation: 1008Reputation: 1008Reputation: 1008Reputation: 1008Reputation: 1008Reputation: 1008
If you want only use Linux, maybe you could deactivate (U)EFI, Secure Boot, GPT, and the other cool modern features; and use old and boring stuff like BIOS, MBR and lilo.
 
Old 11-19-2017, 04:49 PM   #8
watchingu
LQ Newbie
 
Registered: Oct 2017
Distribution: Debian Stable & Unstable
Posts: 27

Original Poster
Rep: Reputation: 11
I'm elated to report that I have found a solution to my problem. I thought maybe the rEFInd boot manager might be a solution, but then read about Compatibility Support Mode (CSM) and remembered that I had that option enabled in my BIOS/UEFI settings. I disabled CSM and was able to successfully install Debian Stretch, and thus Grub, and boot my laptop.

I don't remember exactly why I had CSM enabled, but I think I read something about UEFI and Linux recommending having CSM enabled when I installed Linux over 3 years ago. It's also possible that I was just confused and chose to enable the option. UEFI was completely new to me at the time. The CSM option only recently gave me a problem though.

Special thank you to Rod Smith whose rEFInd Boot Manager and The rEFInd Boot Manager: What's Your Boot Mode? pages led me to a solution.

Last edited by watchingu; 11-19-2017 at 04:52 PM.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Fresh 11.4 usb hard drive install results hd0 out of disk grub console natlose Ubuntu 23 01-17-2012 11:58 AM
Solaris 10 10/08 grub stage2 failed, unbootable installation Randux Solaris / OpenSolaris 5 02-02-2009 06:32 AM
Unbootable stops with just short grub on screen TheBrick Linux - Newbie 4 03-16-2006 05:04 AM
Unbootable laptop - nothing shows Ineed2muchHelp Linux - Laptop and Netbook 2 05-19-2005 03:24 PM
Typo with GRUB caused Win98 to be unbootable wapcaplet Linux - Software 7 11-28-2003 09:21 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Laptop and Netbook

All times are GMT -5. The time now is 05:37 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration