How to use GRUB to boot from USB to Install LMDE2

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
jmkegley

How to use GRUB to boot from USB to Install LMDE2

Post by jmkegley »

I'm trying to boot LMDE2 from a USB using grub. I press C at grub menu to get the command line. Grub labels the usb drive as (hd0,msdos1) formatted as FAT (fat32 actually). From what I've read (links included later) I need to use the root command and chainloader +1 command. I've tried using root and I get "error: can't find command 'root' ". I've tried entering it different ways like root(hd0,msdos1) and with spaces included. Any guidance to help with is issue is appreciated. I'm using grub built in to Mint 18.2... grub version 2.02~beta2-36ubuntu3.9.

The reason I am using grub is my laptop will not boot from usb even though I have changed the boot order in bios. The laptop just wants to boot directly into mint 18.2. I do get the grub menu during startup though because I modified the grub config file to have it show up. Just hoping I can get grub to boot the usb and try out LMDE2.

Thanks for any help you can give me.

links I've referenced in my efforts:
https://superuser.com/questions/349633/ ... using-grub
https://www.gnu.org/software/grub/manua ... mands.html
https://www.linuxquestions.org/question ... ost1396839
Last edited by LockBot on Wed Dec 28, 2022 7:16 am, edited 1 time in total.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
JeremyB
Level 21
Level 21
Posts: 13880
Joined: Fri Feb 21, 2014 8:17 am

Re: How to use GRUB to boot from USB to Install LMDE2

Post by JeremyB »

How did you put the ISO on the USB drive? With the USB drive in, what is the result of

Code: Select all

sudo blkid
jmkegley

Re: How to use GRUB to boot from USB to Install LMDE2

Post by jmkegley »

I put the iso on the drive using unetbootin on my windows 7 pc. I downloaded the lmde2 iso using the mint main page. I didn't set up any persistent space on the usb drive at all i just put the iso on there.

this is what I get from the blkid command:
/dev/mmcblk0p1: UUID="6FFA-0689" TYPE="vfat" PARTLABEL="EFI System Partition" PARTUUID="2ae93c95-4918-40fb-a58a-6eaa431c9d60"
/dev/mmcblk0p2: UUID="8f94a3c6-62da-4e6f-abb9-fad07856860f" TYPE="ext4" PARTUUID="c06a5561-183a-4070-b854-4b4ddf2cd083"
/dev/mmcblk0p3: UUID="9c5b7c11-5539-4c98-a938-7548a479a0dc" TYPE="swap" PARTUUID="dfd42b4c-a810-4ff1-a288-b3290dad4377"
/dev/mmcblk0: PTUUID="7bf2d5b6-694a-4a03-b732-d120bd67b020" PTTYPE="gpt"
/dev/sda1: UUID="1CAE-1FFB" TYPE="vfat" PARTUUID="52bb5046-01"

sda1 is the usb drive
JeremyB
Level 21
Level 21
Posts: 13880
Joined: Fri Feb 21, 2014 8:17 am

Re: How to use GRUB to boot from USB to Install LMDE2

Post by JeremyB »

Something went wrong when you put the ISO on the USB as my LM 18 ISO shows as

Code: Select all

/dev/sdb1: UUID="2016-06-28-12-50-06-00" LABEL="Linux Mint 18 Cinnamon 64-bit" TYPE="iso9660" PTUUID="43694d2e" PTTYPE="dos" PARTUUID="43694d2e-01"
It might be easier to use the Linux Mint USB writer program to put the ISO on the USB drive, just search your program menu for USB and you should find it
jmkegley

Re: How to use GRUB to boot from USB to Install LMDE2

Post by jmkegley »

Ok I used the USB image writer program (wasn't aware of this program but it is nice) and now the blkid gave this:
/dev/sde1: UUID="2017-01-16-17-33-23-00" LABEL="LMDE 2 Cinnamon 64-bit" TYPE="iso9660" PTUUID="01f2af83" PTTYPE="dos" PARTUUID="01f2af83-01"

I tried booting up the laptop with the usb in there and it boots into mint 18.2 instead of booting from the usb. Mint is recognizing the drive and it is mounted but it is not booting from it.
JeremyB
Level 21
Level 21
Posts: 13880
Joined: Fri Feb 21, 2014 8:17 am

Re: How to use GRUB to boot from USB to Install LMDE2

Post by JeremyB »

Can you access a boot menu from BIOS to see if the USB is being detected as a bootable device now, you might be able to boot the ISO from Grub now
jmkegley

Re: How to use GRUB to boot from USB to Install LMDE2

Post by jmkegley »

I have the bios boot priority set to boot from usb first. However, it is skipping it and booting into 18.2.

When I check in grub now, I go to command line, do an ls command and it lists these:
(memdisk) (hd0) (hd0,apple2) (hd0,apple1) (hd0,msdos2) (hd1) (hd1,gpt3) (hd1,gpt2) (hd1,gpt1)...the apple2 and apple1 are new but I guess it is a partition of the usb that the writer program wrote onto it.

While still in the command line is grub I do a ls -al command and it says:
Device hd0: Filesystem type iso9660 - Label 'LMDE 2 Cinnamon 64-bit' - Last modification time 2017-01-16 17:33:23 Monday, UUID ....etc
Device hd0, apple1: error: file '/boot/grub/x86_64-efi/tar.mod' not found.
" " /nilfs2.mod' not found.
" " /minix.mod' not found......afs.mod' not found.....affs.mod' not found.
Device hd0,apple2: Filesystem type fat, UUID B1f5-0A13 - Partition start at ....etc

When I try the root command like this root(hd0) and root(hd0,apple2) and root(hd0,apple1) all I get is "error: can't find command 'root(hd0***'
JeremyB
Level 21
Level 21
Posts: 13880
Joined: Fri Feb 21, 2014 8:17 am

Re: How to use GRUB to boot from USB to Install LMDE2

Post by JeremyB »

I think you have to use

Code: Select all

set root=(
jmkegley

Re: How to use GRUB to boot from USB to Install LMDE2

Post by jmkegley »

Yes you are right I just found this page which was helpfull:
https://dev.gentoo.org/~floppym/grub.html#GNU_002fLinux

I went into grub command line and entered this command:
linux /live/vmlinuz root=(hd0)
boot

it went to a boot screen but it got hung up. The error is:
[ 1.417473] --- [end Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(0,0)
it has that error in a couple places but it looks like it is trying to boot it is just froze now
JeremyB
Level 21
Level 21
Posts: 13880
Joined: Fri Feb 21, 2014 8:17 am

Re: How to use GRUB to boot from USB to Install LMDE2

Post by JeremyB »

jmkegley

Re: How to use GRUB to boot from USB to Install LMDE2

Post by jmkegley »

Ok I will try that later have to go to work now.
jmkegley

Re: How to use GRUB to boot from USB to Install LMDE2

Post by jmkegley »

Ok after some tweeking it is trying to boot now. I got the new entry in grub finally. This is what I did:

in terminal:
sudo gedit /etc/grub.d/40_custom


menuentry "LMDE2" {
set isofile="/home/justin/Downloads/lmde-2-201701-cinnamon-64bit.iso"
loopback loop (hd0,gpt2)$isofile
linux (loop)/live/vmlinuz.efi boot=live iso-scan/filename=${isofile}
quiet splash
initrd (loop)/live/initrd.lz
}

in terminal:
sudo update-grub

After doing this, it tries to boot but then stops. Here are some pics of what the screen shows...
JeremyB
Level 21
Level 21
Posts: 13880
Joined: Fri Feb 21, 2014 8:17 am

Re: How to use GRUB to boot from USB to Install LMDE2

Post by JeremyB »

Are you booting using UEFI or CSM/Legacy? I don't know if LMDE can be booted using UEFI
jmkegley

Re: How to use GRUB to boot from USB to Install LMDE2

Post by jmkegley »

I'm not sure if this tells me it is UEFI or not, but I ran this command after googleing it:

$ sudo efibootmgr
[sudo] password for justin:
BootCurrent: 0000
Timeout: 2 seconds
BootOrder: 0000,0002,2001
Boot0000* ubuntu
Boot0003* \EFI\Ubuntu\grubx64.efi
Boot2001* EFI USB Device
User avatar
austin.texas
Level 20
Level 20
Posts: 12003
Joined: Tue Nov 17, 2009 3:57 pm
Location: at /home

Re: How to use GRUB to boot from USB to Install LMDE2

Post by austin.texas »

jmkegley wrote:Ok after some tweeking it is trying to boot now. I got the new entry in grub finally. This is what I did:

in terminal:
sudo gedit /etc/grub.d/40_custom

menuentry "LMDE2" {
set isofile="/home/justin/Downloads/lmde-2-201701-cinnamon-64bit.iso"
loopback loop (hd0,gpt2)$isofile
linux (loop)/live/vmlinuz.efi boot=live iso-scan/filename=${isofile}
quiet splash
initrd (loop)/live/initrd.lz
}

in terminal:
sudo update-grub

After doing this, it tries to boot but then stops. Here are some pics of what the screen shows...
If you want to boot the .iso from your hard drive, the easiest way is to use grml-rescueboot
See: http://forums.linuxmint.com/viewtopic.p ... 89#p889397
One problem can be if your /home/Downloads folder is on a separate /home partition - you get the best results when the .iso file is on the root partition. grml avoids that problem.
Mint 18.2 Cinnamon, Quad core AMD A8-3870 with Radeon HD Graphics 6550D, 8GB DDR3, Ralink RT2561/RT61 802.11g PCI
Linux Linx 2018
jmkegley

Re: How to use GRUB to boot from USB to Install LMDE2

Post by jmkegley »

Ok austin I will give that a try and see if it will boot.

I think I only have 16gb of free space on the linux partition. I should shrink that and make a new root partition to put the grml on?

If that works would I be able to wipe the mint 18.2 that is already on there off the hard drive completely? I tried to create a bootable usb using gparted live and dban and it would not boot that either from the usb. My goal there was to wipe 18.2 off completely and try a fresh install of LMDE2.
From my post earlier using the efibootmgr command I seen the boot order was 0000,0002,2001... 2001 is the EFI usb device. Is there a way to change that order to put the usb first?
User avatar
austin.texas
Level 20
Level 20
Posts: 12003
Joined: Tue Nov 17, 2009 3:57 pm
Location: at /home

Re: How to use GRUB to boot from USB to Install LMDE2

Post by austin.texas »

jmkegley wrote:I think I only have 16gb of free space on the linux partition. I should shrink that and make a new root partition to put the grml on?
Why? 16GB is plenty of room to store a .iso file.
jmkegley wrote:If that works would I be able to wipe the mint 18.2 that is already on there off the hard drive completely?
You originally said your purpose was to take a look at it. Installing it in that manner creates a more complicated process. You have your .iso on the partition where you want to install, and you can't install to a mounted partition. What you have to do is alter the grml menuentry in your /boot/grub/grub.cfg to add the toram option. That will load the entire .iso into ram, and then you can unmount all your partitions and proceed with the installation.
The details on adding toram are here :arrow: https://community.linuxmint.com/tutorial/view/1849
jmkegley wrote:From my post earlier using the efibootmgr command I seen the boot order was 0000,0002,2001... 2001 is the EFI usb device. Is there a way to change that order to put the usb first?
I don't have any UEFI computers, so I can't help with that.
Mint 18.2 Cinnamon, Quad core AMD A8-3870 with Radeon HD Graphics 6550D, 8GB DDR3, Ralink RT2561/RT61 802.11g PCI
Linux Linx 2018
jmkegley

Re: How to use GRUB to boot from USB to Install LMDE2

Post by jmkegley »

I got it to boot from USB to LMDE2 finally. I have just been trying different linux distros from usb and discovered that while in grub if I go to command line and then use the exit command a couple times the grub menu from the usb drive will show up and it will boot. I also changed the boot order in efibootmgr to put usb as booting first. Thanks for all the help :)
jmkegley

Re: How to use GRUB to boot from USB to Install LMDE2

Post by jmkegley »

I used unetbootin running on windows 7 to create the LMDE2 bootable usb and it worked fine.
Locked

Return to “Installation & Boot”