Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

help with grub command sought

10 views
Skip to first unread message

Charles T. Smith

unread,
Jun 21, 2014, 7:03:59 AM6/21/14
to
I'm looking for the proper grub command to write a boot sector to a
removable USB drive.

After installation, the disk won't normally boot.

I am creating a portable SuSE 13.1 system on a removable usb drive. I
choose minimal X desktop to avoid Gnome and Kde. I also chose to install
the boot sector in the partition where I was installing linux.

I can boot the system via the installation system. I can boot it and run
grub and could write a boot sector from there, but I'm worried that I
might blow away my main system if I enter the wrong command.

Any help is appreciated.
cts

Charles T. Smith

unread,
Jun 21, 2014, 4:11:25 PM6/21/14
to
Okay, I may have found it: http://lwn.net/Articles/253587/

But I haven't had a chance to test it yet.

Stef

unread,
Jun 21, 2014, 9:39:38 PM6/21/14
to
I use the little utility UNetbootin.

However, if you want to do it the hard way via the command line, just do
a search for making a USB thumbdrive bootable. You'll get tens of
thousands of "hits."

Stef

Charles T. Smith

unread,
Jun 22, 2014, 6:20:36 AM6/22/14
to
Well, I wasn't able to make progress with that. But I noticed something
interesting...

My drive is mounted from /dev/disk/by-id. Every time this event happens,
the device, /dev/sd?3, changes - first, it's at /dev/sdb3, then after
remount it's at /dev/sdc3, and then, the next time it happens, it goes
back to /dev/sdb3 again.

Pascal Hambourg

unread,
Jun 22, 2014, 7:14:29 AM6/22/14
to
Charles T. Smith a ᅵcrit :
>
> My drive is mounted from /dev/disk/by-id.

It is rather common these days to use persistent names based on volume
UUID or label, device ID or path in /dev/disk/ instead of the moving
device names /dev/sd*.

> Every time this event happens,

What event ?

> the device, /dev/sd?3, changes - first, it's at /dev/sdb3, then after
> remount it's at /dev/sdc3, and then, the next time it happens, it goes
> back to /dev/sdb3 again.

That's what persistent names in /dev/disk/ are for : do not rely on
device names.

Charles T. Smith

unread,
Jun 22, 2014, 8:19:42 AM6/22/14
to
On Sun, 22 Jun 2014 13:14:29 +0200, Pascal Hambourg wrote:

> Charles T. Smith a écrit :
The thing is, I *am* using persistent names - that's what I meant with /
dev/disk/by-id. But if you look at those, e.g. with ls -l, you'll see
they're just symlinks to the /dev/sd* devices, which I guess are
determined by the kernel - then something else maps them to the /dev/disk/
by-id names at a later time in the boot process...

What I'm observing is apparently that the *underlying* device special
file mapped to the usb controller is being re-established - but not the
persistent link.

The event I'm talking about is this power-down event or whatever it is.
I haven't pinned down exactly what it is. I just went to lunch for 45
minutes or so, and the mapping stayed unchanged. But sometimes, it
happens quickly... I'm pretty sure it happens immediately if I close the
cover to my laptop.

Pascal Hambourg

unread,
Jun 22, 2014, 9:00:21 AM6/22/14
to
Charles T. Smith a ᅵcrit :
>
> The thing is, I *am* using persistent names - that's what I meant with /
> dev/disk/by-id. But if you look at those, e.g. with ls -l, you'll see
> they're just symlinks to the /dev/sd* devices, which I guess are
> determined by the kernel - then something else maps them to the /dev/disk/
> by-id names at a later time in the boot process...

The something is udev.

> What I'm observing is apparently that the *underlying* device special
> file mapped to the usb controller is being re-established - but not the
> persistent link.
>
> The event I'm talking about is this power-down event or whatever it is.
> I haven't pinned down exactly what it is. I just went to lunch for 45
> minutes or so, and the mapping stayed unchanged. But sometimes, it
> happens quickly... I'm pretty sure it happens immediately if I close the
> cover to my laptop.

This usually triggers some form of system suspend, and resume when you
open the cover again.

However what you describe here is rather different from what you wrote
in your initial post ("the disk won't normally boot") and does not seem
to have anything to do with grub.

Charles T. Smith

unread,
Jun 22, 2014, 9:38:53 AM6/22/14
to
On Sun, 22 Jun 2014 15:00:21 +0200, Pascal Hambourg wrote:

> Charles T. Smith a écrit :
>>
Yikes! You're right!

I had two queries pending - one to comp.os.linux.hardware ("usb external
drives not reliable for linux?"). I updated the wrong one with new
information :(

Sorry for the confusion. And thanks for the point about udev updating
the by-id links.

Doug Laidlaw

unread,
Jun 22, 2014, 9:27:57 AM6/22/14
to
GRUB doesn't create a boot sector; it writes to an existing one. I seem
to remember hearing that a USB key can't be partitioned like a HD. What
seem to be partitions are really something else. This was raised on the
alt.os.linux.mageia group a while back. If what you have is an external
SD disk, that might be different. The only way I have done it is to
install a distro complete with GRUB and boot it alone.

Another thing I found was that my BIOS would see the key ONLY if every other
USB device was removed. If there was more than one, the BIOS would skip to
the second choice. As an afterthought, this would not apply if the key
is called by GRUB, not by the BIOS. And make sure that it mounts when
attached. It can start a file manager without being mounted.

Hoping this is of some help.

Doug Laidlaw

unread,
Jun 23, 2014, 1:58:10 AM6/23/14
to
Charles T. Smith wrote:

> On Sun, 22 Jun 2014 15:00:21 +0200, Pascal Hambourg wrote:
>
>> Charles T. Smith a écrit :
>
> Yikes! You're right!
>
> I had two queries pending - one to comp.os.linux.hardware ("usb external
> drives not reliable for linux?"). I updated the wrong one with new
> information :(
>
> Sorry for the confusion. And thanks for the point about udev updating
> the by-id links.

Linux Magazine atmy newsagents has an article right on this topic. I didn't
look inside. The issue number is 156, or perhaps 152.
0 new messages