From: Sebastian Pipping <sebastian@pipping.org>
To: The development of GNU GRUB <grub-devel@gnu.org>
Subject: Re: Future of installing GRUB to LVM volumes (and loop devices)
Date: Sat, 16 May 2015 16:10:21 +0200 [thread overview]
Message-ID: <55574FCD.4090004@pipping.org> (raw)
In-Reply-To: <CAHh2SORRFjzWmVK5UkbPz0YtkmfbKNvwo6vYz26YkK2vYKQosQ@mail.gmail.com>
On 16.05.2015 05:47, Jordan Uggla wrote:
>> The setup is a single plain partition in an LVM volume.
>>
>> The following commands reproduce the setup (in RAM if /tmp is tmpfs).
>> With a plain LVM volume, the error is the same tough.
>>
>> # tmpfile="$(mktemp)"
>> # echo "${tmpfile}"
>> # truncate --size=$((100*1024**2)) "${tmpfile}"
>> # loop_device_2="$(losetup --show -f "${tmpfile}")"
>> # echo "${loop_device_2}"
>> # vgcreate vg "${loop_device_2}"
>> # lvcreate --name lv -l 100%free vg
>> # sleep 1
>>
>> # parted /dev/vg/lv --script mklabel msdos
>> # parted /dev/vg/lv --script mkpart primary ext4 4m 100%
>> # sleep 1
>> # mkfs.ext4 /dev/mapper/vg-lv1
>> # mkdir /mnt/lv-root
>> # mount /dev/mapper/vg-lv1 /mnt/lv-root
>> # mkdir /mnt/lv-root/boot
>> # grub-install --boot-directory=/mnt/lv-root/boot /dev/mapper/vg-lv ;
>
> That is a nonsensical grub-install command.
I do not approve of calling nonsense on me. Don't do that. Thanks.
> You're telling grub-install that you want grub's boot sector and
> core.img to be installed to a device that cannot possibly be accessed
> by your BIOS (unless you have a BIOS that understands LVM). It may be
> that it should be failing with a better error message, or that there
> is a better example of what should be working that isn't, but I would
> never expect this command to work. I'm not even sure what semantics
> you would expect from this command, and if it happened to do what you
> wanted it to do in the past I can only imagine that that was a "lucky"
> quirk of the implementation.
The tempfile and loop device are for (1) not messing with any
producution LVM volume group of the host system and (2) for being able
to write to work with RAM rather than wasting disk cycles.
If that looks wierd to you: it's for reproduction purposes.
As I wrote above "With a plain LVM volume, the error is the same".
For the second half, the host BIOS does not have to be able to boot from
that GRUB since I'm creating a virtual machine image here. In the mail
starting this thread I explained:
"I have a case where grub-install is asked to install to an
LVM volume [1] that is later passed to Xen to boot a Xen guest.
Inside the Xen guest the LVM volume is seen as a regular hard disk.
[1] from inside a tool called grmldeboostrap [2], a wrapper around
deboostrap installing Debian to a given block device"
Best,
Sebastian
next prev parent reply other threads:[~2015-05-16 14:10 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-05-05 16:54 Future of installing GRUB to LVM volumes (and loop devices) Sebastian Pipping
2015-05-05 17:38 ` Andrei Borzenkov
2015-05-06 12:30 ` Sebastian Pipping
2015-05-06 17:16 ` Andrei Borzenkov
2015-05-12 10:41 ` Sebastian Pipping
2015-05-12 11:41 ` Andrei Borzenkov
2015-05-15 9:28 ` Sebastian Pipping
2015-05-15 9:34 ` Andrei Borzenkov
2015-05-15 10:42 ` Sebastian Pipping
2015-05-16 3:47 ` Jordan Uggla
2015-05-16 14:10 ` Sebastian Pipping [this message]
2015-05-16 23:33 ` Jordan Uggla
2015-05-17 8:14 ` Andrei Borzenkov
2015-05-21 21:41 ` Sebastian Pipping
2015-05-21 21:44 ` Vladimir 'phcoder' Serbinenko
2015-05-21 21:48 ` Sebastian Pipping
2015-05-21 22:17 ` Vladimir 'phcoder' Serbinenko
2015-05-21 22:20 ` Sebastian Pipping
2015-05-22 2:25 ` Andrei Borzenkov
2015-05-07 9:35 ` Vladimir 'φ-coder/phcoder' Serbinenko
2015-05-12 9:16 ` Sebastian Pipping
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=55574FCD.4090004@pipping.org \
--to=sebastian@pipping.org \
--cc=grub-devel@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).