From: Edward Shishkin <edward.shishkin@gmail.com>
To: The development of BTRFS <linux-btrfs@vger.kernel.org>
Subject: [patch 0/2] grub-0.97: btrfs support
Date: Fri, 25 Sep 2009 00:06:23 +0200 [thread overview]
Message-ID: <4ABBED5F.6000008@gmail.com> (raw)
Hello everyone.
The following patches are for Fedora 10(**).
The distro-independent package will be put to kernel.org a bit later.
I. Loading kernels from btrfs volumes
Now you can load kernels and initrds from btrfs volumes composed of
many devices.
WARNING!!!
Make sure that all components of your loading btrfs volume(*) are
visible to grub. Otherwise, you'll end with unbootable system.
The list of available grub devices can be obtained, for example,
using tab completion in grub shell.
Number of components of a loading volume is not restricted, however
if it is larger then 128, then the boot process will be slowed down
because of expensive translations (btrfs-device-id -> grub-device-id)
which issue a large number of IOs. We cache only 128 such translations
in grub-0.97 because of high memory pressure.
II. Installing grub from btrfs volumes
You can install grub from a btrfs image volume(*) composed of many
devices (see above about restrictions). Also you can setup any
component of a btrfs boot(*) volume as grub root device.
NOTE!!! Make sure that all components of image and boot volumes(*)
are visible to grub, otherwise grub installer will return error.
TECHNICAL NOTE (for grub developers):
The unpleasant surprise was that grub installer overwrites
(by default!) the file (stage2), bypassing the file system driver.
I can not understand this: it looks like stepping to the clean water
with dirty shoe. Hope that grub2 won't afford such things.
In order to install grub from a btrfs image volume use special
option (--stage2). This option makes grub installer to rewrite
the file with a help of the OS's file system (i.e, via write (2)).
Any attempts to install without this option will fail with an error
(wrong argument).
The example of possible installation scenario.
Suppose image volume = root volume = loading volume is composed
of devices (hd0,4), (hd0,5), (hd1,5), (hd1,7) and is not an OS's
root. We want to setup (hd0,4) as grub root device and install
grub to the mbr of (hd0).
. build and install grub with btrfs support;
. mount your the "3 in 1" btrfs volume to /mnt;
. create a directory /mnt/grub;
. put the built files stage1, stage2, btrfs_stage1_5, grub.conf,
etc. to /mnt/grub;
. run grub shell;
. grub> root (hd0,4)
. grub> setup --stage2=/mnt/grub/stage2 (hd0)
. have a fun.
Use info(1) grub for more details.
(*) Glossary:
. loading volume:
a btrfs volume that contains kernel image and initrd;
. image volume:
a btrfs volume that contains stage1, stage2, btrfs_stage_1_5,
and grub.conf files needed for grub installer;
. boot volume:
a btrfs volume where grub will look for stage2 and grub.conf
files in boot time.
(**) Link to the Fedora's grub package:
http://ucho.ignum.cz/fedora/linux/releases/10/Fedora/source/SRPMS/grub-0.97-38.fc10.src.rpm
All comments, bugreports, etc. are welcome as usual.
Thanks,
Edward.
next reply other threads:[~2009-09-24 22:06 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-09-24 22:06 Edward Shishkin [this message]
2009-12-10 23:15 ` [patch 0/2] grub-0.97: btrfs support Johannes Hirte
2009-12-11 0:04 ` Johannes Hirte
2009-12-11 11:17 ` Edward Shishkin
2009-12-11 14:04 ` Johannes Hirte
2009-12-11 15:27 ` Edward Shishkin
2009-12-11 17:25 ` Johannes Hirte
2009-12-11 19:15 ` Edward Shishkin
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=4ABBED5F.6000008@gmail.com \
--to=edward.shishkin@gmail.com \
--cc=linux-btrfs@vger.kernel.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