[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [grub] Experiencing difficulties to access USB key files

From: Arbiel (gmx)
Subject: Re: [grub] Experiencing difficulties to access USB key files
Date: Fri, 22 Jan 2016 13:56:32 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.3.0

Hi Andrei

Thank you for your help.
I first answer your question in the body of the message and then I give
you additionnal information at the end of it.

Le 21/01/2016 19:27, Andrei Borzenkov a écrit :
> 21.01.2016 14:52, Arbiel (gmx) пишет:
>> Hi
>> I have written a grub file for booting from PCs which do not provide a
>> "from USB key" booting.
>> The USB keys to be used are supposed to be msdos compatible (not GPT),
>> grub has to have been installed in their first sectors as usual, and the
>> USB keys are supposed to contain a grub configuration file (a
>> traditional grub.cfg file) and an additional file of which the relative
>> path (the result of grub-mkrelpath) is unique in the configuration.
>> My grub file searches for the unique relative path to set the target
>> device where the to-be-configfiled file lies and I "configfile" it. I've
>> released my file to a community forum. I instructed the potential users
>> to source my file in their booting grub.cfg file. It works for several
>> members of the forum, who are happy with it.
>> However, it does not work for a user. We have investigated the situation
>> and got some results :
> Unfortunately you forgot to describe what happens in case it does not work.
Sorry. The result of the search command is
no such device: <relative path of the searched for file>
even if the file actually exists.
>> 1) his USB key is seen by grub as a floppy disk ; the ls command lists
>> it as (fd1) ; so I suppressed --no-floppy from the search command
>> parameters. To no avail.
> How do you know it is this USB stick? What "ls -l" shows? Can you read
> something from it (hexdump command)? Can you read enough to identify it?
The PC has got, beside the hard disk, only a floppy reader and a USB
port. The floppy reader is listed as fd0, the hard disk as hd1. So the
fd1 device only can be the USB port.
the ls command applied to fd1 answers 2 lines
Device fd1: filesystem cannot be accessed
error: no such disk
So "ls -l" would not provide additional information.
>> 2) as I was not sure of the contains of the original grub.cfg file (the
>> one which sources my file), I added a "insmod fat" command, as the
>> partition of the key is FAT32. Still to no avail.
> Not sure I got it. So GRUB is installed somewhere else? So may be it is
> simply too old GRUB version?
There are two grub instances in the configuration. One instance is on
the hard disk. It is GNU GRUB version 1.99-21ubuntu3.19. The other one
is on the USB stick. It is GNU GRUB version 2.02~beta2-9ubuntu1.6
>> 3) supposing the BIOS was lacking USB drivers,
> This directly contradicts 1.
As I'm not specialist, I may misunderstand what a driver is. I don't
know whether or not grub uses the basic input/output services embedded
in the PC's ROM to acces the hardware. I'm confronted with the fact that
grub cannot find an existing file of which it knows the relative path
inside the partition where the file lies, and I know the PC cannot boot
from a USB stick. So I made the following assumptions
1) in the present context, grub uses the BIOS to access the USB stick
2) BIOS does not contain the software to access the USB port (that I
named the driver)
so I tried to provide grub with the modules I hoped would allow it to
access the USB stick by itself, and so, be able to find the searched for
file and "configfile" it.
>> I inserted five
>> additional modules : usb, ahci, ehci, ohci and uhci. No avail.
> This just makes things worse by cutting off access to $prefix.
$prefix is still pointing to the boot directory on the hard disk.
>> I am now short of any additional idea to make it work.
>> Thanks to any of you who will provide me with advice.
>> Arbiel
>> _______________________________________________
>> Help-grub mailing list
>> address@hidden
Now, let me explain the context some more.
The issue is to provide a PC which cannot boot from USB with sort of a
"live USB stick". This stick is fitted with a regular grub and grub
configuration file and the iso image of a GNU/Linux distribution. In the
present situation, the version of the stick grub is GNU GRUB version
The hard disk is fitted with a regular grub configuration of which
version is GNU GRUB version 1.99-21ubuntu3.19.
My idea is to insert a configfile in the hard disk grub.cfg file to have
grub skip to the stick's grub.cfg file where a loopback command allows
for booting the iso image.

And there exists of so called "Plop Boot Manager" which aims also at
booting from USB sticks on PC whose BIOS cannot do it. I discovered this
program only recently and the user whom I am working with to solve the
present issue tested it. To my opinion, this Plop Boot Manager does sort
of a chainloader command.

The user has exported two screen snapshots of interactive grub commands,
the first one under control of the hard disk GNU GRUB version
( the second
one, when Plop Boot Manager has been used to boot the USB stick
Plop Boot Manager is launched from the hard disk grub.cfg file. The
image shows the control to have been shifted to GNU GRUB version
The images also show the modification in the way those two grubs report
the list of devices. At that point, I have to add that Plop Boot Manager
uses its own drivers to access the devices. But I obviously understand
how a fd drive can become a hd drive.

Attachment: signature.asc
Description: OpenPGP digital signature

reply via email to

[Prev in Thread] Current Thread [Next in Thread]