LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
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, 03:11 AM   #1
watchingu
Member
 
Registered: Oct 2017
Location: USA
Distribution: Arch Linux, Debian Stable, Debian Unstable
Posts: 73

Rep: Reputation: 17
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, 08:14 AM   #2
plasmonics
Member
 
Registered: Jan 2009
Distribution: Fedora, Gentoo, LFS
Posts: 224

Rep: Reputation: 69
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, 12:31 AM   #3
watchingu
Member
 
Registered: Oct 2017
Location: USA
Distribution: Arch Linux, Debian Stable, Debian Unstable
Posts: 73

Original Poster
Rep: Reputation: 17
I have the latest BIOS...204.
 
Old 11-10-2017, 05:02 PM   #4
watchingu
Member
 
Registered: Oct 2017
Location: USA
Distribution: Arch Linux, Debian Stable, Debian Unstable
Posts: 73

Original Poster
Rep: Reputation: 17
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 05:05 PM.
 
Old 11-17-2017, 04:45 PM   #5
TheEzekielProject
Member
 
Registered: Dec 2016
Distribution: arch
Posts: 668

Rep: Reputation: 190Reputation: 190
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, 12:42 AM   #6
watchingu
Member
 
Registered: Oct 2017
Location: USA
Distribution: Arch Linux, Debian Stable, Debian Unstable
Posts: 73

Original Poster
Rep: Reputation: 17
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, 05:52 AM   #7
NevemTeve
Senior Member
 
Registered: Oct 2011
Location: Budapest
Distribution: Debian/GNU/Linux, AIX
Posts: 4,886
Blog Entries: 1

Rep: Reputation: 1872Reputation: 1872Reputation: 1872Reputation: 1872Reputation: 1872Reputation: 1872Reputation: 1872Reputation: 1872Reputation: 1872Reputation: 1872Reputation: 1872
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, 03:49 PM   #8
watchingu
Member
 
Registered: Oct 2017
Location: USA
Distribution: Arch Linux, Debian Stable, Debian Unstable
Posts: 73

Original Poster
Rep: Reputation: 17
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 03:52 PM.
 
Old 02-23-2018, 05:18 PM   #9
watchingu
Member
 
Registered: Oct 2017
Location: USA
Distribution: Arch Linux, Debian Stable, Debian Unstable
Posts: 73

Original Poster
Rep: Reputation: 17
I know this is an old thread and I marked it solved, but a recent kernel upgrade on the Debian Unstable partition on my laptop resulted in the same issue. This is very frustrating. I did a little bit of research earlier and I'm now thinking that the ASUS UX303LA laptop is not such a great machine for multi-booting Linux, or maybe even using Linux period.

Edit: It wasn't a kernel upgrade. It was an upgrade to grub-efi-amd64. Following is what happened when setting up grub-efi-amd64:
Code:
Setting up grub-efi-amd64 (2.02+dfsg1-1) ...
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.
Failed: grub-install --target=x86_64-efi  
WARNING: Bootloader is not properly installed, system may not be bootable
Generating grub configuration file ...
Found background image: /usr/share/images/desktop-base/desktop-grub.png
Found linux image: /boot/vmlinuz-4.15.0-1-amd64
Found initrd image: /boot/initrd.img-4.15.0-1-amd64
Found linux image: /boot/vmlinuz-4.14.0-3-amd64
Found initrd image: /boot/initrd.img-4.14.0-3-amd64
Found linux image: /boot/vmlinuz-4.14.0-2-amd64
Found initrd image: /boot/initrd.img-4.14.0-2-amd64
Found Debian GNU/Linux 9 (stretch) on /dev/sda2
Adding boot menu entry for EFI firmware configuration
done

Last edited by watchingu; 02-24-2018 at 02:48 PM. Reason: Incorrect info provided
 
Old 02-24-2018, 06:08 AM   #10
ondoho
LQ Addict
 
Registered: Dec 2013
Posts: 19,872
Blog Entries: 12

Rep: Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053
if you use debian unstable, you have to expect that sort of occasional breakage & be willing & able to deal with it.
 
1 members found this post helpful.
Old 02-24-2018, 02:42 PM   #11
watchingu
Member
 
Registered: Oct 2017
Location: USA
Distribution: Arch Linux, Debian Stable, Debian Unstable
Posts: 73

Original Poster
Rep: Reputation: 17
Quote:
Originally Posted by ondoho View Post
if you use debian unstable, you have to expect that sort of occasional breakage & be willing & able to deal with it.
I've been using Debian Unstable for quite some time and realize that things can and do break. However, this issue has nothing to do with Debian Unstable; read my initial post. Additionally, I'm dual-booting with Debian Unstable on my desktop and I'm not experiencing the issue there. In fact, I've never experienced this issue on my desktop and it's made by ASUS as well.

Last edited by watchingu; 02-24-2018 at 02:49 PM.
 
Old 02-25-2018, 07:52 PM   #12
watchingu
Member
 
Registered: Oct 2017
Location: USA
Distribution: Arch Linux, Debian Stable, Debian Unstable
Posts: 73

Original Poster
Rep: Reputation: 17
Quote:
Originally Posted by NevemTeve View Post
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.
This has got me thinking. I think I started having problems with Linux on my laptop when I started installing Debian under UEFI mode. I'm thinking of enabling CSM (compatibility support mode) again, repartitioning my SSD without GPT, and then perform the Debian installs in non-UEFI mode (for lack of the correct term).
 
Old 04-07-2018, 06:13 PM   #13
linuxbawks
Member
 
Registered: Apr 2013
Distribution: Snuckware
Posts: 240

Rep: Reputation: 17
Quote:
Originally Posted by watchingu View Post
This has got me thinking. I think I started having problems with Linux on my laptop when I started installing Debian under UEFI mode. I'm thinking of enabling CSM (compatibility support mode) again, repartitioning my SSD without GPT, and then perform the Debian installs in non-UEFI mode (for lack of the correct term).
That's rubbish. UEFI works just as well legacy MBR if you know the correct way to use it. In fact EFI works easier and is more flexible than MBR. If you know how.

This command is really for MBR install. Why it defaults to efi is a little odd to me.

Code:
sudo grub-install /dev/sda
You should do this. Make sure your efi partition is formatted vfat. Mouse the partition at /boot/efi. Then:

Code:
sudo grub-install --target=x86_64-efi
This will install grubx64.efi in ./boot/efi/EFI/<distro name or grub version>/

Do this:

Code:
# sudo mkdir -p /boot/efi/EFI/boot
# sudo cp /boot/efi/EFI/<distro name or grub version>/grubx64.efi /boot/efi/EFI/boot/bootx64.efi
Reboot and make sure you have the system set to boot from UEFI. Leave Secure Boot disabled.
 
Old 04-18-2018, 04:42 PM   #14
watchingu
Member
 
Registered: Oct 2017
Location: USA
Distribution: Arch Linux, Debian Stable, Debian Unstable
Posts: 73

Original Poster
Rep: Reputation: 17
@linuxbawks: I disagree. UEFI is not implemented in a standard way by PC manufacturers, so there can be issues. I've researched it, I'll let you do your own.

I think I tried the
Code:
sudo grub-install --target=x86_64-efi
command and that didn't work either.

In any case, I did attempt a MBR install with a GPT partition table, but Debian wouldn't install because it couldn't locate the EFI partition. So, I ended up creating a BIOS partition table and successfully performed a MBR install. However, after reading the fine writeup on Partitioning hard disk drives for BIOS-MBR, BIOS-GPT and UEFI-GPT in Linux, perhaps I should have created a bios-grub partition to perform a MBR install on a GPT partition table.

I have a working laptop, so I'm not interested in playing around with things anymore. Next go around, I'll try a GPT partition table, create a BIOS-Grub partition, and attempt a MBR install to see if and how that works.

Last edited by watchingu; 04-18-2018 at 04:50 PM.
 
  


Reply



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 10:58 AM
Solaris 10 10/08 grub stage2 failed, unbootable installation Randux Solaris / OpenSolaris 5 02-02-2009 05:32 AM
Unbootable stops with just short grub on screen TheBrick Linux - Newbie 4 03-16-2006 04:04 AM
Unbootable laptop - nothing shows Ineed2muchHelp Linux - Laptop and Netbook 2 05-19-2005 02:24 PM
Typo with GRUB caused Win98 to be unbootable wapcaplet Linux - Software 7 11-28-2003 08:21 AM

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

All times are GMT -5. The time now is 02:39 AM.

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
Open Source Consulting | Domain Registration