From: Andrey Borzenkov <arvidjaar@gmail.com>
To: grub-devel@gnu.org
Subject: Re: booting btrfs
Date: Mon, 14 Oct 2013 09:28:07 +0400 [thread overview]
Message-ID: <20131014092807.6917958c@opensuse.site> (raw)
In-Reply-To: <339EF7EB-F50A-47F6-99BA-F46ABFECCF74@colorremedies.com>
В Sun, 13 Oct 2013 17:58:41 -0600
Chris Murphy <lists@colorremedies.com> пишет:
>
> On Oct 13, 2013, at 5:31 PM, Vladimir 'φ-coder/phcoder' Serbinenko <phcoder@gmail.com> wrote:
>
> > On 13.10.2013 22:59, Chris Murphy wrote:
> >>
> >> How does one create a subvolume without a name? All subvolumes have had ID's since at least 2008, and it's been possible to mount by name or ID for quite a few years at least as well.
> >>
> > Then this illusion was created by the /proc/mountinfo listing mounted
> > subdirectory as "/" when mounted by id (or something like that).
>
> The top level subvolume (id 5) is likely reported as "/" just like is the case when mounting any file system.
>
> It's possible that changing the default subvolume causes this same behavior rather than mount reporting the full path. I haven't tested this.
>
No, it is inconsistent behavior for named subvolume and subvolume ids
mounts.
For named subvolume btrfs internally mounts top level directory
(actually using subvolid=0 for this internal mount) and then performs
equivalent of bind mount on subvolume. For subvolid it actually
sets root of filesystem to subvolume during mount. As mountinfo
displays path relative to filesystem root, it is always "/" if subvolid
was used. I do not know if there are practical differences between the
two.
> >
> >> and some behaviors like entirely unique file systems volumes.
> > I feel like subvolumes are glorified folders and would have prefered
> > directories becoming more powerful rather than having a completely new
> > concept.
>
> That's not possible. It had to be this way to support snapshotting. A snapshot is a subvolume. The subvolume only appears as a directory, in reality the directory links to the subvolume which are a completely separate btree and analogous to a whole separate file system. And since its a separate file system, the inode numbers start over. Conversely a directory is just an item like a file in the tree, it's not a tree in its own right, which a subvolume is.
>
> > On both ZFS and btrfs as far as GRUB is concerned are directories with
> > just slightly different structure.
>
> Understood, but I think this is less ideal. It offers less leverage and usage of the file system as a boot, even as rootfs, file system.
>
> > Why would numbers be preferable to names?
>
> Without the use of subvolid= we either have to always use full paths for subvolumes (instead of relative), or we can't use btrfs set-default to change the default subvolume. If the paths to subvolumes are relative to the default subvolume, then changing the default subvolume breaks booting. And full paths could become rather cumbersome, since the hierarchy is effectively unlimited.
>
Why full paths are cumbersome? The
mount -o subvol=path/to/boot /dev/sdX /mnt
vi /mnt/grub/boot.cfg
is 100% equivalent to
mount -o subvolid=0 /dev/sdX /mnt
vi /mnt/path/to/boot/grub/boot.cfg
And GRUB is concerned only with value of $prefix. So as long as
grub-install can resolve path name of /boot/grub to full path from
btrfs root including subvolumes it is OK. And to use subvolume ID you
will need to detect that path is on subvolume anyway.
> Today, maybe it's not the best scenario to have two or three OS's installed on one btrfs volume, in separate subvolumes, each with hundreds of snapshots. But it's designed to enable such a workflow once it's stable. I think using full paths (always relative to the top level subvolume which never changes even if the default subvolume is changed) is fine in the near term. And it may be some workflows simply prefer the (human user) transparency that comes with full paths. But from my perspective, a fixed number means I can completely reorganize a hierarchy with no other changes.
>
Could you please provide example of what you mean here?
> > The rename may very well be
> > intentional in order to make other OS and/or version to boot.
>
> Yes, and I'm not suggesting the end to supporting either full path, or relative path referencing of subvolumes. Just that it's also possible to use subvolid.
>
What about grub-mkconfig? It does not pass explicit subvolume if it is
not present in mountinfo, which means a) if someone changes default
subvolume it will end up mounting wrong root and b) it breaks if mount
by subvolid is used.
next prev parent reply other threads:[~2013-10-14 5:28 UTC|newest]
Thread overview: 73+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-10-13 18:04 booting btrfs Chris Murphy
2013-10-13 19:47 ` Vladimir 'φ-coder/phcoder' Serbinenko
2013-10-13 20:59 ` Chris Murphy
2013-10-13 23:31 ` Vladimir 'φ-coder/phcoder' Serbinenko
2013-10-13 23:58 ` Chris Murphy
2013-10-14 5:28 ` Andrey Borzenkov [this message]
2013-10-14 18:39 ` Chris Murphy
2013-10-14 19:29 ` Vladimir 'φ-coder/phcoder' Serbinenko
2013-10-14 20:20 ` Chris Murphy
2013-10-16 2:50 ` Andrey Borzenkov
2013-10-16 3:37 ` Chris Murphy
2013-10-28 0:44 ` Vladimir 'φ-coder/phcoder' Serbinenko
2013-12-19 16:13 ` Andrey Borzenkov
2013-12-19 18:14 ` Vladimir 'φ-coder/phcoder' Serbinenko
2013-12-20 3:24 ` Chris Murphy
2013-12-20 9:46 ` Michael Chang
2013-12-20 12:21 ` Vladimir 'φ-coder/phcoder' Serbinenko
2013-12-20 14:54 ` Michael Chang
2013-12-20 15:10 ` Vladimir 'φ-coder/phcoder' Serbinenko
2013-12-24 2:26 ` Michael Chang
2013-12-21 4:38 ` Chris Murphy
2013-12-21 7:18 ` Andrey Borzenkov
2013-12-23 4:45 ` Chris Murphy
2013-12-23 4:52 ` Vladimir 'φ-coder/phcoder' Serbinenko
2013-12-23 5:32 ` Chris Murphy
2013-12-24 3:16 ` Chris Murphy
2013-12-24 2:29 ` Michael Chang
2013-12-24 2:26 ` Michael Chang
2013-12-24 3:43 ` Chris Murphy
2013-12-24 3:46 ` Vladimir 'φ-coder/phcoder' Serbinenko
2013-12-24 3:57 ` Chris Murphy
2013-12-24 4:20 ` Vladimir 'φ-coder/phcoder' Serbinenko
2013-12-24 6:12 ` Chris Murphy
2013-12-24 6:25 ` Vladimir 'φ-coder/phcoder' Serbinenko
2013-12-24 7:28 ` Michael Chang
2013-12-24 7:46 ` Andrey Borzenkov
2013-12-31 4:10 ` Michael Chang
2014-01-10 18:23 ` Andrey Borzenkov
2014-01-13 5:05 ` Michael Chang
2014-01-13 5:34 ` Andrey Borzenkov
2014-01-13 9:12 ` Michael Chang
2014-01-13 13:08 ` Andrey Borzenkov
2014-01-14 4:16 ` Michael Chang
2014-01-21 8:09 ` Vladimir 'φ-coder/phcoder' Serbinenko
2014-01-21 9:08 ` Michael Chang
2013-12-30 10:18 ` Michael Chang
2013-12-30 11:28 ` Vladimir 'φ-coder/phcoder' Serbinenko
2013-12-30 11:52 ` Andrey Borzenkov
2013-12-31 7:50 ` Michael Chang
2013-12-31 21:20 ` Chris Murphy
2014-01-02 5:17 ` Michael Chang
2014-01-07 17:55 ` Chris Murphy
2014-01-08 20:57 ` Chris Murphy
2014-01-09 10:03 ` Michael Chang
2014-01-09 19:29 ` Chris Murphy
2014-01-13 5:13 ` Michael Chang
2014-01-13 5:53 ` Chris Murphy
2013-12-31 4:02 ` Michael Chang
2013-10-14 20:45 ` Chris Murphy
2013-10-14 20:50 ` Vladimir 'φ-coder/phcoder' Serbinenko
2013-10-15 2:33 ` Andrey Borzenkov
2013-10-15 3:12 ` Chris Murphy
2013-10-15 16:58 ` Andrey Borzenkov
2013-10-15 19:47 ` Chris Murphy
2013-10-15 20:02 ` Vladimir 'φ-coder/phcoder' Serbinenko
2013-10-15 20:27 ` Chris Murphy
2013-10-16 2:45 ` Andrey Borzenkov
2013-10-16 3:30 ` Chris Murphy
2013-10-15 21:55 ` Chris Murphy
2013-10-14 21:01 ` Vladimir 'φ-coder/phcoder' Serbinenko
2013-10-14 23:09 ` Chris Murphy
2013-10-14 23:44 ` Chris Murphy
2013-10-15 2:44 ` Andrey Borzenkov
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=20131014092807.6917958c@opensuse.site \
--to=arvidjaar@gmail.com \
--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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.