On Tue, 2014-03-11 at 00:45 +0100, Lennart Poettering wrote: > On Mon, 10.03.14 23:39, Goffredo Baroncelli (kreij...@libero.it) wrote: > > > > Well, the name is property of the admin really. There needs to be a way > > > how the admin can label his subvolumes, with a potentially localized > > > name. This makes it unsuitable for our purpose, we cannot just take > > > possession of this and leave the admin with nothing. > > > > Instead of the name we can use the xattr to store these information. > > Ah, using xattrs for this is indeed an option. That way we should be able > attach any kind of information we like to a subvolume. > > Hmm, I figure though that there is no way currently to read xattrs off a > subvolume without first mounting them individually? Having to mount all > subvolumes before we can make sense of them and mount them to the right > place certainly sounds less than ideal...
One thing to remember about the way btrfs snapshots/subvolumes work is that they simply show up as directories within the filesystem tree. There is no separate namespace for storing subvolumes; they all end up in a single unified filesystem tree along with regular files and directories. As a result, you can simply mount the root of the filesystem, and then read xattrs off any and all of the subvolumes. In fact, mounting a the subvolume "/@home" to "/home" in btrfs is effectively equivalent to mount -t btrfs -o subvolid=0 /dev/sda1 /home mount --bind /home/@home /home except done as a single step in one mount command. -- Calvin Walton <calvin.wal...@kepstin.ca> -- To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html