linux-btrfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Michael Göhler" <visit@myjm.de>
To: Linux Btrfs <linux-btrfs@vger.kernel.org>
Subject: Question about btrfs as root filesystem
Date: Fri, 08 Nov 2013 00:45:32 +0100	[thread overview]
Message-ID: <5eb6a9cbd3a163b70c9cfe4a1b46a1fa@myjm.de> (raw)

Hi,

I'm a contributor of the Arch Linux package mkinitcpio-btrfs [1]. The 
goal of this hook is to provide Btrfs rollback support for root 
filesystems directly from initrd.

Technically we are using a subvolume to store the root filesystem. The 
user can snapshot it entirely and boot from this snapshot. In case of 
rollback our hook snapshots the snapshot again, to keep its original 
unchanged. The boot subvolume is then set with 'btrfs subvolume 
set-default' and mounted without subvol/subvolid option by Arch's 
default mount handler. That way, we ensure the best compatibility and 
lowest maintenance, as we don't overwrite default init functions.

Assuming we have the following setup:

# btrfs su li -p /
ID 256 gen 86 parent 5 top level 5 path root
ID 259 gen 86 parent 256 top level 256 path var
ID 260 gen 86 parent 256 top level 256 path usr

The use case for that is to set quotas for the child subvolumes.

Now, if we snapshots the root subvolume, the child subvolumes are not 
snapshoted with it. There is no back reference which would allow Btrfs 
to auto-mount the original child subvolumes when we mount the snapshot 
as new root filesystem. Of cause we could snapshot the childs separately 
into their desired directories. But this would not help, because our 
hook snapshots the snapshot again, to keep it's original untouched while 
rolling back. And we don't have fstab to find out the correct mount 
points at this early boot stage.

Atm. all scenarios results in /usr/bin/init not found.

So here comes my question:
Wouldn't it be helpful to add a --recursive option to 'btrfs subvolume 
snapshot' to snapshot child subvolumes together with their parent?
Or maybe it is possible to add some functionality to reference the child 
subvolumes on the snapshots fs-tree to allow auto-mounting?

I appreciate other ideas or opinions too.

Thanks,
Michael

[1] https://aur.archlinux.org/packages/mkinitcpio-btrfs/

             reply	other threads:[~2013-11-07 23:45 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-11-07 23:45 Michael Göhler [this message]
2013-11-08  1:33 ` Question about btrfs as root filesystem Chris Murphy
2013-11-08 13:41   ` Michael Göhler
2013-11-08 19:30     ` Chris Murphy
2013-11-08  9:39 ` Duncan
2013-11-08 12:55 ` R: " Goffredo Baroncelli <kreijack@libero.it>
2013-11-08 17:44   ` Chris Murphy
2013-11-08 17:59     ` Goffredo Baroncelli
2013-11-08 19:43       ` Chris Murphy

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=5eb6a9cbd3a163b70c9cfe4a1b46a1fa@myjm.de \
    --to=visit@myjm.de \
    --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;
as well as URLs for NNTP newsgroup(s).