help-grub
[Top][All Lists]
Advanced

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

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


From: Jordan Uggla
Subject: Re: 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 02:02:00 -0800

On Mon, Mar 5, 2012 at 12:48 AM, Jake Thomas <address@hidden> wrote:
> 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".

 It sounds like you didn't actually have anything mounted to
/media/SPAACE/ when you ran grub-install. This is consistent with all
of your symptoms.
>
> 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?

It enables building and installing of the grub-mount utility, which
allows the use of grub's filesystem (and partitioning and other
abstraction) code for mounting filesystems (read only) via FUSE. This
is useful for instance if you want to read files from filesystems
which your main system doesn't support (say, ZFS) or if you want to
test grub's filesystem code, and is also used by Ubuntu's os-prober
for safe and simple read-only mounts.

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

Don't forget to mount /media/SPAACE/ :)

>
> Cheers,
> Jake
>
>
>
>
>
> _______________________________________________
> Help-grub mailing list
> address@hidden
> https://lists.gnu.org/mailman/listinfo/help-grub
>

-- 
Jordan Uggla (Jordan_U on irc.freenode.net)



reply via email to

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