help-grub
[Top][All Lists]
Advanced

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

How Do I Install Grub 2.00~beta0 To A Flash Drive And Have The Root And


From: Jake Thomas
Subject: How Do I Install Grub 2.00~beta0 To A Flash Drive And Have The Root And Prefix Correct Upon Boot?
Date: Mon, 5 Mar 2012 00:48:01 -0800 (PST)

Hello again. It seems to me that Grub 2.00~beta0 is not installing the same way Grub 1.99 did to thumb drives.

With Grub 1.99, all I did was something like:

sudo grub-install --root-directory=/media/SPAACE /dev/sdd

And if need be, replacing "/media/SPAACE" with wherever my thumb drive's partition that I wanted /boot/grub on was mounted, and/or
replacing /dev/sdd with whatever the abstraction file path was for the entirety of my thumb drive (not a single partition).

And it worked! Provided I made my grub.cfg right and had the needed files on the thumb drive.

My thumb drive booted just fine to a menu with Grub 1.99.

Now after obtaining and compiling Grub 2.00~beta0 from the bzr (I did do "sudo make install" at the end), I ran the above command
on my thumb drive to install the new Grub to the thumb drive.

With the same grub.cfg file, and not changing anything else, when I boot to the thumb drive, I now get to a command line,
where before I successfully got to a menu and my grub.cfg was loaded properly.

When I type "set" at Grub 2.00~beta0's command line, for prefix I get "(hd1,msdos5)/media/SPAACE/boot/grub", and for root I get "hd1,msdos".

This is terribly messed up because my thumb drive is hd0 and is gpt-structured.
The root should be "(hd0,gpt1)" and the prefix should be "(hd0,gpt1)/boot/grub".
    For some reason it is remembering the path the thumb drive was mounted to in Linux at time of Grub installation and making that path
be the root. Linux is installed on my internal hard drive's fifth partition (goes into an extended partition) and the internal hard drive is
MBR-structured (called "msdos").

And it gets weirder. When I type ls at the Grub 2.00~beta0 command line, it does not show the partitions of my thumb drive. I had a hunch
that part_gpt was not loaded. I do "insmod part_gpt", and then an "ls", and then it does show the partitions of my thumb drive.

Why didn't grub-install see that the destination drive is gpt-structured and thus conclude it would be important to include the part_gpt module
already compiled into the second-stage bootloader?

Furthermore, "--root-directory" doesn't even show up in "grub-install --help". It appears to be replaced with "--boot-directory",
it's just that "--root-directory" appends "/boot/grub" to the supplied path and "--boot-directory" doesn't?

I tried again with:
sudo grub-install --boot-directory=/media/SPAACE/boot/grub /dev/sdd

When I booted my thumb drive I still got to a command line, and the output of set showed no improvement.
Root was still set to "hd1,mdos5", but this time the prefix was "(hd1,msdos5)/media/SPAACE/boot/grub/grub".

I did compile grub with "--enable-device-mapper", could this have thrown it off?

And of of couriosity, what does "--enable-grub-mount" do?

How do I get the newest Grub properly installed to my thumb drive?

Cheers,
Jake





reply via email to

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