Grub installation failed on a USB stick.

Questions about Grub, UEFI,the liveCD and the installer
Forum rules
Before you post please read how to get help
Post Reply
rastabaik
Level 1
Level 1
Posts: 3
Joined: Sat Feb 24, 2018 7:13 am

Grub installation failed on a USB stick.

Post by rastabaik » Sat Feb 24, 2018 7:29 am

I want to install a non live version of linux mint on a sub stick. So since my laptop has 2 usb ports i used 2 usb sticks, one with a bootable live version and the other on which the system has to be installed.

So let us call /dev/sdd the target USB drive.

In the installer i choose "other, custom" and created 2 partitions (/dev/sdd1,/dev/sdd2) on the usb stick (/home and /), i formated them and asked the installer to put the system here and to install grub on /dev/sdd.

The instalation process went fine till the instalation of grub point at which it failed.

Then i tried to install grub from the live session.

i mounted /dev/sdd1 on mnt and did:
sudo grub-install --root-directory=/mnt/ /dev/sdd
but it failed too.

I m puzzled, i also checked that /dev/sdd1 has the boot flag on.

I don't understand at all, my usb stick should behave exactly like any other storage device (ie like any harddrive).

Last i would also be happy to find a non uefi installer for linux mint, i know how to handly the legacy system and how to boot (repair) as system from Grub -- it is a bit messy but once you found the initram file and the kernel file you are done. The uefi boot mode is just obscure to me and i don' t even know why it was pushed by the hardware designer (may be to prevent us from using open soruce operatng systes

User avatar
kc1di
Level 13
Level 13
Posts: 4666
Joined: Mon Sep 08, 2008 8:44 pm
Location: Maine USA

Re: Grub installation failed on a USB stick.

Post by kc1di » Sat Feb 24, 2018 8:42 am

I think what you may be running into (not sure from your description) is that it's trying to install grub in UEFI mode. which requires a seperate efi file/partition.
Grub will try to make that file but sometimes it fails. if you can boot the machine in legacy bios mode and do the install that way it should work.
If you need uefi boot. I'm not sure you can place grub on the stick.
good luck.
Easy tips : https://sites.google.com/site/easylinuxtipsproject/
Linux Mint Installation Guide: http://linuxmint-installation-guide.rea ... en/latest/
Registered Linux User #462608

rastabaik
Level 1
Level 1
Posts: 3
Joined: Sat Feb 24, 2018 7:13 am

Re: Grub installation failed on a USB stick.

Post by rastabaik » Sat Feb 24, 2018 12:38 pm

Ok i will check that, i m not too sure how to boot in legacy mode, probably some option in the bios.

User avatar
pbear
Level 5
Level 5
Posts: 564
Joined: Wed Jun 21, 2017 12:25 pm
Location: San Francisco

Re: Grub installation failed on a USB stick.

Post by pbear » Sat Feb 24, 2018 12:45 pm

Caution: Installing to a USB drive in UEFI can be hazardous to your internal hard drive's bootloader. It's a bug. There are a couple of strategies for getting around this, of which I prefer the one described in this thread. Notice the install is done in BIOS mode, then the UEFI bootloader added manually in Terminal.
Time flies like an arrow. Fruit flies like a banana.
Running Mate 18.3 64 bit (by upgrade from 18.1-2)

rastabaik
Level 1
Level 1
Posts: 3
Joined: Sat Feb 24, 2018 7:13 am

Re: Grub installation failed on a USB stick.

Post by rastabaik » Sat Feb 24, 2018 1:21 pm

So changed in the bios the option to boot in legacy mode, but then the usb stick that i created using dd is not considered as a valid boot device.

When i change back to UEFI the usb stick is found and boot normaly.

The file system on the usb stick does not look like a traditionnal linux root file system, no vmlinux and initram file, instead i have the weird uefi organisation :
/mnt/Linux Mint 18.3 Cinnamon 64-bit/boot/grub $-> ls
efi.img font.pf2 grub.cfg loopback.cfg x86_64-efi

I tried to find a traditional (legacy) iso image for mint but could not fund it.

User avatar
kc1di
Level 13
Level 13
Posts: 4666
Joined: Mon Sep 08, 2008 8:44 pm
Location: Maine USA

Re: Grub installation failed on a USB stick.

Post by kc1di » Sat Feb 24, 2018 3:04 pm

Then mint .iso boot to whatever mode you have the machine set to , there is not seperate .iso for legacy boot.
it your machine is set to boot in bios mode then mint will boot and install in that mode. if it's set to boot uefi it will install in that boot mode.
hope this helps.
Easy tips : https://sites.google.com/site/easylinuxtipsproject/
Linux Mint Installation Guide: http://linuxmint-installation-guide.rea ... en/latest/
Registered Linux User #462608

User avatar
kc1di
Level 13
Level 13
Posts: 4666
Joined: Mon Sep 08, 2008 8:44 pm
Location: Maine USA

Re: Grub installation failed on a USB stick.

Post by kc1di » Sat Feb 24, 2018 3:13 pm

perhaps this thread will be helpful too you.
viewtopic.php?f=46&t=186040&p=963551#p963551
Easy tips : https://sites.google.com/site/easylinuxtipsproject/
Linux Mint Installation Guide: http://linuxmint-installation-guide.rea ... en/latest/
Registered Linux User #462608

User avatar
pbear
Level 5
Level 5
Posts: 564
Joined: Wed Jun 21, 2017 12:25 pm
Location: San Francisco

Re: Grub installation failed on a USB stick.

Post by pbear » Sun Feb 25, 2018 12:09 am

rastabaik wrote:
Sat Feb 24, 2018 1:21 pm
the usb stick that i created using dd is not considered as a valid boot device.
The problem isn't the ISO. As kc1di says, that's dual boot. Rather, I don't think dd is generally recommended for this task. If you have access to a Windows machine, Rufus is very reliable. Failing that, Etcher is probably the second best choice.
Time flies like an arrow. Fruit flies like a banana.
Running Mate 18.3 64 bit (by upgrade from 18.1-2)

fabien85
Level 6
Level 6
Posts: 1345
Joined: Tue Mar 11, 2014 4:30 pm

Re: Grub installation failed on a USB stick.

Post by fabien85 » Sun Feb 25, 2018 9:06 am

rastabaik wrote:
Sat Feb 24, 2018 7:29 am
In the installer i choose "other, custom" and created 2 partitions (/dev/sdd1,/dev/sdd2) on the usb stick (/home and /),
[..]
Then i tried to install grub from the live session.
i mounted /dev/sdd1 on mnt and did:
sudo grub-install --root-directory=/mnt/ /dev/sdd
but it failed too.
Unless there is a typo in your post, you tried to install grub to /home instead of / (the latter containing /boot where grub needs to put its config file)

Also you can force installation in Legacy mode thanks to the --target option.
So I would do :

Code: Select all

sudo mount /dev/sdd2 /mnt
sudo grub-install --target=i386-pc --root-directory=/mnt  /dev/sdd
If that fails, please provide the error message.

User avatar
Sgthawker
Level 3
Level 3
Posts: 198
Joined: Sun Apr 27, 2014 2:23 am

Re: Grub installation failed on a USB stick.

Post by Sgthawker » Sun Feb 25, 2018 11:05 am

I use uefi boot. When doing an install to any drive on a uefi system the boot loader install looks to the drives in a prescribed order. The first drive in that sequence that has an esp is used to install the boot loader. So if the sequence is

sda
sdb
sdc
sdd

and there is an esp on sda it will use that esp even if you tell the installer to use sdd.

A way around that is to disconnect all other internal drives during the live USB to USB drive install so there is no other esp to be selected in lieu of your directive.

Hope this helps.
LM 18.3 Cinnamon/KDE/LM 19 Cinnamon/Peppermint 9 UEFI on Sabertooth Z170 S, i6700K, Echelon GTX950, Samsung 950 Pro M.2 NVMe
LM 18.3 Cinnamon/KDE/LM 19 Cinnamon/Peppermint 9 UEFI on Asus ROG STRIX laptop, i7700 HQ, GTX 1060, Samsung 960 Pro M.2 NVMe

User avatar
Sir Charles
Level 7
Level 7
Posts: 1832
Joined: Thu Jan 04, 2018 1:00 pm

Re: Grub installation failed on a USB stick.

Post by Sir Charles » Sun Feb 25, 2018 11:25 am

Sgthawker wrote:
Sun Feb 25, 2018 11:05 am
A way around that is to disconnect all other internal drives during the live USB to USB drive install so there is no other esp to be selected in lieu of your directive.
I just finished an installation of LM 18.3 Xfce onto a USB flashdrive in UEFI-mode. Prior to the installation process, I made three partitions on the target USB. First, one fat32-formatted 512 MiB partition flagged as esp and boot. Then one partition for / and one for swap.
Screenshot_2018-02-25_16-11-32.png
I chose the first partition as the location for the bootloader and the installation completed without any problem. I am actually posting this booted into this newly made installation.

Edit: Just upgraded to the latest kernel, rebooted and everything seems to work fine so far.

Code: Select all

uname -a
Linux minty 4.13.0-36-generic #40~16.04.1-Ubuntu SMP Fri Feb 16 23:25:58 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux
I suppose that's one of the ironies of life, doing the wrong thing at the right moment -C.C.

Post Reply

Return to “Installation & Boot”