linux-btrfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Question about btrfs as root filesystem
@ 2013-11-07 23:45 Michael Göhler
  2013-11-08  1:33 ` Chris Murphy
                   ` (2 more replies)
  0 siblings, 3 replies; 9+ messages in thread
From: Michael Göhler @ 2013-11-07 23:45 UTC (permalink / raw)
  To: Linux Btrfs

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/

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2013-11-08 19:44 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-11-07 23:45 Question about btrfs as root filesystem Michael Göhler
2013-11-08  1:33 ` 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

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).