Scheduled Maintenance: We are aware of an issue with Google, AOL, and Yahoo services as email providers which are blocking new registrations. We are trying to fix the issue and we have several internal and external support tickets in process to resolve the issue. Please see: viewtopic.php?t=158230

 

 

 

Booting from USB at GRUB command line

Ask for help with issues regarding the Installations of the Debian O/S.
Post Reply
Message
Author
Persona
Posts: 2
Joined: 2018-04-24 02:59

Booting from USB at GRUB command line

#1 Post by Persona »

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".

User avatar
sunrat
Administrator
Administrator
Posts: 6412
Joined: 2006-08-29 09:12
Location: Melbourne, Australia
Has thanked: 116 times
Been thanked: 461 times

Re: Booting from USB at GRUB command line

#2 Post by sunrat »

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!

p.H
Global Moderator
Global Moderator
Posts: 3049
Joined: 2017-09-17 07:12
Has thanked: 5 times
Been thanked: 132 times

Re: Booting from USB at GRUB command line

#3 Post by p.H »

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)

Persona
Posts: 2
Joined: 2018-04-24 02:59

Re: Booting from USB at GRUB command line

#4 Post by Persona »

@ 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.

Wheelerof4te
Posts: 1454
Joined: 2015-08-30 20:14

Re: Booting from USB at GRUB command line

#5 Post by Wheelerof4te »

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.

p.H
Global Moderator
Global Moderator
Posts: 3049
Joined: 2017-09-17 07:12
Has thanked: 5 times
Been thanked: 132 times

Re: Booting from USB at GRUB command line

#6 Post by p.H »

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.

Post Reply