[Solved] Fatal error: Unable to install GRUB

Questions about Grub, UEFI,the liveCD and the installer
Forum rules
Before you post read how to get help. Topics in this forum are automatically closed 6 months after creation.
Locked
Frederick Turner

[Solved] Fatal error: Unable to install GRUB

Post by Frederick Turner »

In a previous thread ( No disk space left during mint upgrade from 17.3 to 18.0 ) I reported on an upgrade problem. I was recommended to clean install LM on my dual boot device. So I did. At the end of the installation process, I got a fatal error message:

Code: Select all

Executing 'grub-install /dev/sda' failed
. I have two drives in my laptop. A 2TB HDD (sda) and a SSD (sdb). I fairly certain to have installed LM on the later. Choosing a different partition to intall GRUB on did not succeed. Same error message. I therefore opted to "continue without bootloader". I didn't know that I would not only not be able to boot LM but also not Windows 7. When I try to boot, I get the following message.
error: unknown filesystem.
Entering rescue mode...
grub rescue> _
I would be really grateful for beginner friendly assistance to get my laptop to (dual) boot again.
Last edited by LockBot on Wed Dec 28, 2022 7:16 am, edited 2 times in total.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
kukamuumuka

Re: Fatal error: Unable to install GRUB

Post by kukamuumuka »

You did not install grub, so the error occured. For helping you, it would be good to know things like partitions and msdos or UEFI. What are results for the next questions:

Code: Select all

sudo parted -l

Code: Select all

inxi -po

Code: Select all

[ -d /sys/firmware/efi ] && echo "EFI mode" || echo "Legacy Bios mode"

Code: Select all

sudo os-prober
Frederick Turner

Re: Fatal error: Unable to install GRUB

Post by Frederick Turner »

The results are posted below the respective questions:

Code: Select all

sudo parted -l

Code: Select all

Model: ATA ST1750LM000 HN-M (scsi)
Disk /dev/sda: 1750GB
Sector size (logical/physical): 512B/4096B
Partition Table: gpt
Disk Flags:

Number  Start   End     Size    File system  Name                          Flags
 1      17.4kB  134MB   134MB                Microsoft reserved partition  msftres
 2      134MB   128GB   128GB   ntfs                                       msftdata
 3      129GB   1239GB  1110GB  ntfs         Basic data partition          msftdata
 4      1239GB  1750GB  511GB   ext4


Model: ATA SAMSUNG MZ7PC128 (scsi)
Disk /dev/sdb: 128GB
Sector size (logical/physical): 512B/512B
Partition Table: msdos
Disk Flags:

Number  Start   End     Size    Type      File system  Flags
 1      1049kB  106MB   105MB   primary   ntfs         boot
 2      106MB   94.0GB  93.9GB  primary   ntfs
 3      94.0GB  128GB   34.0GB  extended
 5      94.0GB  117GB   23.1GB  logical   fat32
 6      117GB   128GB   10.9GB  logical   ext4


Model: Lexar USB Flash Drive (scsi)
Disk /dev/sdc: 64.0GB
Sector size (logical/physical): 512B/512B
Partition Table: msdos
Disk Flags:

Number  Start   End     Size    Type     File system  Flags
 1      1049kB  64.0GB  64.0GB  primary  fat32        boot

Code: Select all

inxi -po

Code: Select all

Partition: ID-1: /cdrom size: 60G used: 2.8G (5%) fs: vfat dev: /dev/sdc1
           ID-2: / size: 969M used: 295M (33%) fs: overlay dev: N/A
Unmounted: ID-1: /dev/sda1 size: 0.13G label: N/A uuid: N/A
           ID-2: /dev/sda2 size: 127.93G fs: NTFS label: Samsung 830 uuid: 5CF83049F83023A4
           ID-3: /dev/sda3 size: 1110.25G fs: NTFS label: Major uuid: 384EB1AD4EB16472
           ID-4: /dev/sda4 size: 511.11G fs: ext4 label: Mint_Data uuid: b02f5948-b0d1-4b22-9a42-bbd88bd9949e
           ID-5: /dev/sdb1 size: 0.10G fs: NTFS label: System Reserved uuid: 1A042EB2042E9135
           ID-6: /dev/sdb2 size: 93.89G fs: NTFS label: N/A uuid: N/A
           ID-7: /dev/sdb5 size: 23.14G fs: FAT (32 bit) label: LM uuid: 827A-5730
           ID-8: /dev/sdb6 size: 10.90G fs: ext4 label: N/A uuid: c5a5d6a8-417e-435e-b9ff-68dafaf8ad75

Code: Select all

[ -d /sys/firmware/efi ] && echo "EFI mode" || echo "Legacy Bios mode"

Code: Select all

Legacy Bios mode

Code: Select all

sudo os-prober

Code: Select all

/dev/sdb1:Windows 7:Windows:chain
/dev/sdb6:Linux Mint 19 Tara (19):LinuxMint:linux
I hope that helps with further troubleshooting.
Frederick Turner

GRUB: Dual boot into W7 does not work.

Post by Frederick Turner »

Okay, I think I have made some progress. I installed LM to sdb5. I installed GRUB to sdb1. I left the previous install of LM on sdb6 untouched. I can now boot into LM on sdb5. However, I cannot boot into Windows 7. The W7-OS shows up in the GRUB bootloader but when I select it nothing happens. What can I do to correct this?

The GRUB bootloader currently looks as follows.

Code: Select all

GNU GRUB version 2.02

Linux Mint 19 Xfce
Advanced options for Linux Mint 19 Xfce
Memory test (memtest86+)
Memory test (memtest86+, serial console 115200)
*Windows 7 (on /dev/sdb1)
Linux Mint 19 Tara (19) (on /dev/sdb6)
Advanced options for Linux Mint 19  Tara (19) (on /dev/sdb6)
Many thanks for your patience and help in advance.
kukamuumuka

Re: GRUB: Dual boot into W7 does not work.

Post by kukamuumuka »

Frederick Turner wrote: Fri Oct 12, 2018 7:52 am Okay, I think I have made some progress. I installed LM to sdb5. I installed GRUB to sdb1. I left the previous install of LM on sdb6 untouched. I can now boot into LM on sdb5. However, I cannot boot into Windows 7. The W7-OS shows up in the GRUB bootloader but when I select it nothing happens. What can I do to correct this?
The problem is that grub is installed into windows-partition, which makes Windows unbootable. The fix is to use Windows´ repair or installation disk and run

Code: Select all

bootrec /fixboot
https://neosmart.net/wiki/bootrec/#Bootrec_in_Windows_7

Do not run bootrec /fixmbr because it makes linux unbootable.

For knowing if grub is installed windows-partition (/dev/sdb1), run

Code: Select all

sudo fdisk -l 2>/dev/null | egrep "Disk /|/dev/" | sed "s#^/dev/#Part /dev/#" | awk '{print $2}' | sed 's/://' | xargs -n1 -iX sudo sh -c "dd if=X count=1 2>/dev/null | grep GRUB > /dev/null && echo Grub found: X || echo no Grub: X"
Frederick Turner

Re: Fatal error: Unable to install GRUB

Post by Frederick Turner »

It appears that GRUB is not (any more) installed in the Windows partition sdb1.

Code: Select all

no Grub: /dev/sda
no Grub: /dev/sda1
no Grub: /dev/sda2
no Grub: /dev/sda3
no Grub: /dev/sda4
Grub found: /dev/sdb
no Grub: /dev/sdb1
no Grub: /dev/sdb2
no Grub: /dev/sdb3
no Grub: /dev/sdb5
no Grub: /dev/sdb6
This might be because I tried to fix the W7 boot problem with boot repair myself. However, so far to no avail. My attempts to fix the MBR led to W7 now not being displayed by GRUB any more on the boot screen.

UPDATE:

I actually found a Windows 7 installation disc and applied the fix "bootrec /fixboot", It didn't seem to do anything as it was "fixed" immediately. However, W7 still does not show up in the GRUB menu. Also trying another standard boot-repair job did not change this. So how do I get W7 back into the GRUB boot screen?

One idea would be to actually use the fix "bootrec /fixmbr" and then start a live LM USB instance and use boot-repair to re-install GRUB. However, I am not sure whether this is a good idea or whether it will create more harm than good. So, it would be great to get your counsel and advice.
Frederick Turner

Re: Fatal error: Unable to install GRUB

Post by Frederick Turner »

Frederick Turner wrote: Fri Oct 12, 2018 4:08 pm One idea would be to actually use the fix "bootrec /fixmbr" and then start a live LM USB instance and use boot-repair to re-install GRUB. However, I am not sure whether this is a good idea or whether it will create more harm than good. So, it would be great to get your counsel and advice.
That idea seems to have worked. I now most certainly have a working dual boot system again. I really wonder what went wrong to start with.

I formatted sdb6 to FAT32 as I didn't need the second LM installation.

My OS SSD setup now looks as follows.

Code: Select all

Model: ATA SAMSUNG MZ7PC128 (scsi)
Disk /dev/sdb: 128GB
Sector size (logical/physical): 512B/512B
Partition Table: msdos
Disk Flags: 

Number  Start   End     Size    Type      File system  Flags
 1      1049kB  106MB   105MB   primary
 2      106MB   94,0GB  93,9GB  primary   ntfs         boot
 3      94,0GB  128GB   34,0GB  extended               lba
 5      94,0GB  117GB   23,1GB  logical   ext4
 6      117GB   128GB   10,9GB  logical   fat32
The inxi -po output is:

Code: Select all

Partition: ID-1: / size: 22G used: 7.5G (38%) fs: ext4 dev: /dev/sdb5
Unmounted: ID-1: /dev/sda1 size: 0.13G label: N/A uuid: N/A
           ID-2: /dev/sda2 size: 127.93G fs: NTFS
           label: Samsung 830 uuid: 5CF83049F83023A4
           ID-3: /dev/sda3 size: 1110.25G fs: NTFS
           label: Major uuid: 384EB1AD4EB16472
           ID-4: /dev/sda4 size: 511.11G fs: ext4
           label: Mint_Data uuid: b02f5948-b0d1-4b22-9a42-bbd88bd9949e
           ID-5: /dev/sdb1 size: 0.10G label: N/A uuid: N/A
           ID-6: /dev/sdb2 size: 93.89G fs: NTFS label: N/A uuid: N/A
           ID-7: /dev/sdb6 size: 10.90G fs: FAT (32 bit)
I wonder whether it would be sensible to merge former sdb6 with the current LM partition sdb5 to create more space so that I shall never ever run into "no space" problems during OS upgrades. What are your thoughts? Is my system now OK or do I need to do a bit more tidying to prevent troubles ahead?
pgmer6809
Level 4
Level 4
Posts: 228
Joined: Sun Mar 04, 2012 9:06 pm

Re: Fatal error: Unable to install GRUB

Post by pgmer6809 »

I have not read all of the info in this thread but here are a couple of points for those coming later.
1) The original ISOs of Tara had a bug in them where the install of grub would fail.
see this forum topic for example:
viewtopic.php?f=46&t=273862&p=1499747&h ... l#p1499747

This is supposed to have been fixed in version 2 of the ISO, but if you are running from an older DVD then you still have this problem.
I solved this problem by installing Tara (from DVD) then installing BIONIC Ubuntu (from DVD) which did succeed in installing grub.
Then booting BIONIC and running update-grub (which found my Tara install and added it to the menus).

2) I notice that the original OP had both a GPT disk where his WIN7 was installed, and an MSDOS disk where his Linux was installed.
Linux has no problem with this, but many (all?) UEFI's will not boot from an MSDOS disk, regardless of whether it has grub on it or not.
They only boot from an ESP partition on a GPT disk. So if you want to boot your Linux with your computer in UEFI mode, you need to have the grub installed to the ESP on the first disk, the one with windows on it.
If you have booted your computer correctly (in UEFI mode -- many Linux DVDs allow you to boot in BIOS or UEFI mode and do the install according to what mode of boot you had), so if you have booted in UEFI mode the install process will automatically detect the presence of an ESP on the GPT drive and put the correct versions of grub in there. (They will have names like shimx64.efi, grubx64.efi, grub.efi etc.) The .EFI extension is a signal to the UEFI bios that it can try to boot that binary.

The Grub binary once loaded has no problem loading an OS (Linux or Windows) from an MSDOS disk -- unlike the MS bootloader which tries to restrict you.

pgmer6809
kukamuumuka

Re: Fatal error: Unable to install GRUB

Post by kukamuumuka »

Frederick Turner wrote: Fri Oct 12, 2018 5:51 pm I wonder whether it would be sensible to merge former sdb6 with the current LM partition sdb5 to create more space so that I shall never ever run into "no space" problems during OS upgrades. What are your thoughts? Is my system now OK or do I need to do a bit more tidying to prevent troubles ahead?
Absolutely a good idea, because you have a very small linux-partition.
Frederick Turner

Re: Fatal error: Unable to install GRUB

Post by Frederick Turner »

administrollaattori wrote: Sat Oct 13, 2018 2:06 pm Absolutely a good idea, because you have a very small linux-partition.
Done. Thanks for the reassurance and overall guidance.

I don't seem to have a swap-partition. Is that a cause for concern? I think with LM Xfce 19 and 4 GB RAM I should be fine but who knows.
vansloneker

Re: Fatal error: Unable to install GRUB

Post by vansloneker »

Mint 19 uses a swap file.
Locked

Return to “Installation & Boot”