[Libguestfs] missing btrfs subvol support

Olaf Hering olaf at aepfle.de
Fri Oct 17 10:03:59 UTC 2014


On Fri, Oct 17, Pino Toscano wrote:

> On Friday 17 October 2014 11:25:03 Olaf Hering wrote:
> > On Thu, Oct 16, Olaf Hering wrote:
> > > I can probably add a check somewhere to catch the whatever=="@". A
> > > better fix would be to check if a given subvolume is for the entire
> > > partition.
> > 
> > So after talking to David Sterba there is no way to tell if a given
> > subvolume is for the entire partition.
> > Also my attempt to "fix" it by using the -o option is unreliable.
> > 
> > Richard, so what should be done with the root-partition-listed-twice
> > issue mentioned in the URL above? Just check for a plain '@', assume
> > thats the entire thing, and skip it to not set is_root=1?
> 
> Is '@' a particular marker for this situation? Or, from what I get, 
> there can be any label for this?

Its my understanding that the subvolume name can be everything.

> > The other bug is that mounting subvolumes in such setup fails anyway
> > because the subvol= argument lacks the absolute path. It was suggested
> > to use the "subvolume list" option -a and tweak the resulting list.
> > There is a <FS_TREE> prefix, which shouldnt be there according to
> > David.
> 
> Do you have a way to reproduce the above situation (and possibly the 
> root-partition-listed-twice situation too)? I'm not too familiar with 
> btrfs yet, and my couple of simple installation of the latest beta of 
> openSUSE 13.2 didn't get me that.

Right, because there is no subvolume for /. Only SLE12 is using that,
and appearently Ubuntu if I understand the conversion back in April
correctly.

I was told that it should be possible to have subvolumes named like
"os1", "os2", "osN" where each one would be a root filesystem. Now the
interesting case is what happens with the entire partition. Does it get
its own subvolume or will each of those installations go into their own
subvolume right away? If they do the partition will have no files that
would trigger is_root=1. I guess all these subvolumes will be discovered
anyway and each one will get the is_root flag set, leading to the
mutli-boot case. Thats fine because the given disk/partition is indeed
multi-boot on purpose.

So the bottom line is that there is room for improvement if a given
btrfs partition has indeed multiple root subvolumes. I think to cover
these cases the list command has to be called with -a. And there has to
be a way to specify which subvolume to work with. Maybe guestfish can
already do that, no idea.

However, it would be nice if the common case of single subvolume "@"
would be handled out of the box, so that virt-ls and others work out of
the box.

Olaf




More information about the Libguestfs mailing list