Booting from USB at GRUB command line

Help with issues regarding installation of Debian

Booting from USB at GRUB command line

Postby Persona » 2018-04-24 03:38

I have Debian on my Samsung laptop and want to reinstall (in order to get the names of the wifi drivers and to change su). My laptop will no longer boot from USB like it did with Windows.

I've reformatted the USB drive to make sure it's FAT32 and then reinstalled the iso file with unetbootin. I have also gone into BIOS and changed the boot order, putting all the USB options before the hard drive. No change.

There's an option for a command line at GRUB but I'm too new to Linux to know what to do with it. Can I get some guidance on booting the USB from the command line?

Some webpage said to put in,

root (hd1,0)

but that returned an error message, "root command not recognized".
Persona
 
Posts: 2
Joined: 2018-04-24 02:59

Re: Booting from USB at GRUB command line

Postby sunrat » 2018-04-24 04:29

Unetbootin will probably not work for Debian. Read https://www.debian.org/CD/faq/#write-usb
“ computer users can be divided into 2 categories:
Those who have lost data
...and those who have not lost data YET ”
Remember to BACKUP!
User avatar
sunrat
 
Posts: 2263
Joined: 2006-08-29 09:12
Location: Melbourne, Australia

Re: Booting from USB at GRUB command line

Postby p.H » 2018-04-24 11:26

Persona wrote:I have also gone into BIOS and changed the boot order, putting all the USB options before the hard drive.

Did you manage to display the runtime boot menu ?

Persona wrote:Some webpage said to put in
root (hd1,0)

I guess this instruction is intended for the old GRUB legacy (GRUB 1). Debian uses GRUB 2 by default.
The equivalent command for GRUB 2 would be
Code: Select all
set root=hd1,1

(GRUB 2 numbers partitions from 1 like Linux, whereas GRUB legacy numbers partitions from 0).

However, not every BIOS will expose a USB drive when booting from another drive. Check first with "ls" that the USB drive is exposed as (hd1) or so.
If the USB drive is not exposed, you must extract the files vmlinuz and initrd.gz from the installer filesystem (or download them from the installer section of a Debian mirror e.g. http://ftp.nl.debian.org/debian/dists/s ... ges/cdrom/) and store them on a drive which is exposed by the BIOS so that GRUB can read them. I suggest to put them in the /boot directory.

After setting the root location, you'll have to issue commands to load the files and boot :
Code: Select all
linux /boot/vmlinuz
initrd /boot/initrd.gz
boot

(you may need to adjust the path)
p.H
 
Posts: 372
Joined: 2017-09-17 07:12

Re: Booting from USB at GRUB command line

Postby Persona » 2018-04-24 19:28

@ sunrat

I followed the advice at the link and used Win 32 Disk Imager to create a bootable USB drive. It wasn't recognized during boot.

@ p.H

Did you manage to display the runtime boot menu ?


Not sure, I'm a bit hazy on what that is. If we're talking about something beyond a list showing the supposed order of devices checked at boot, then no.

However, not every BIOS will expose a USB drive when booting from another drive. Check first with "ls" that the USB drive is exposed as (hd1) or so.


The command ls at the GRUB command line shows an (hd1) and (hd1,msdos1) which I assume is the USB drive as this laptop has only one hard drive.

When I type

Code: Select all
set root=(hd

and then press the tab key, it lists the device (hd1) and the partition (hd1,msdos1) and for both of them it says "No known file system detected..."

Completing the command to set root=(hd1), followed by

Code: Select all
linux /boot/vmlinux

returns error: unknown file system. I get the same response if I set the root to the hd1,msdos1 partition.

On another site, I saw the following advice:

Code: Select all
set root=(hd1,1)
chainloader +1
boot


This returned a black screen with a flashing cursor at the top left.
Persona
 
Posts: 2
Joined: 2018-04-24 02:59

Re: Booting from USB at GRUB command line

Postby Wheelerof4te » 2018-04-24 20:04

1. Make sure DVD image is legit and fully downloaded. Incomplete image will be corrupted.
2. If on Windows, use Rufus to make a bootable image.

You can also use netinstall if you have spare smaller USB drives and good connection. Note that you will need either ethernet cable, or use non-free netinstall image for no nonsense wi-fi connection.
Why Debian isn't user-friendly?
HOWTO: Install ES3 Morrowind on Debian Sid and Stable
"My computer is a few electrical transistors I flip manually with registers made out of salt water and lemon juice in some cups." - some guy on Reddit
User avatar
Wheelerof4te
 
Posts: 882
Joined: 2015-08-30 20:14

Re: Booting from USB at GRUB command line

Postby p.H » 2018-04-24 20:59

Persona wrote:If we're talking about something beyond a list showing the supposed order of devices checked at boot,

I am talking about a menu which appears at boot time when pressing a given key, showing all available boot devices.
Persona wrote:No known file system detected

If you installed the raw ISO image on the USB drive using cp, dd or win32diskimager, then the filesystem type is iso9660. Maybe you need to load the filesystem module first :
Code: Select all
insmod iso9660

If you prepared the USB drive with unetbootin, it may be different. Try
Code: Select all
insmod fat


Note : the kernel image file name is "vmlinuz", not "vmlinux".

Debian installer ISO images are "hybrid" and contain a bootable MBR, so the chainloader option may work, but you might need to swap hd0 and hd1 first.
p.H
 
Posts: 372
Joined: 2017-09-17 07:12


Return to Installation

Who is online

Users browsing this forum: No registered users and 3 guests

fashionable