On Sun, Jan 9, 2011 at 6:46 PM, Alan Chandler <a...@chandlerfamily.org.uk> wrote: >> then create snapshots of these directories: >> >> /mnt/btrfs/ >> |- server-a >> |- server-b >> |- server-c >> |- snapshots-server-a >> |- @GMT-2010.12.21-16.48.09 >> \- @GMT-2010.12.22-16.45.14 >> |- snapshots-server-b >> \- snapshots-server-c
> For instance, if I create the initial file system using mkfs.btrfs and then > mount it on /mnt/btrfs is there already a default subvolume? or do I have > to make one? from btrfs FAQ: "A subvolume is like a directory - it has a name, there's nothing on it when it is created, and it can hold files and other directories. There's at least one subvolume in every Btrfs filesystem, the "default" subvolume. The equivalent in Ext4 would be a filesystem. Each subvolume behaves as a individual filesystem. " > What happens when you unmount the whole filesystem and then > come back whatever subvolume and snapshot you already have will still be there. > > The wiki also makes the following statement > > *"Note:* to be mounted the subvolume or snapshot have to be in the root of > the btrfs filesystem." > > > but you seems to have snapshots at one layer down from the root. By default, when you do something like mount /dev/sdb1 /mnt/btrfs the default subvolume will be mounted under /mnt/btrfs. Snapshots and subvolumes will be visible as subdirectories under it, regardless whether it's in the root or several directories under it. Most likely this is enough for what you need, no need to mess with mounting subvolumes. Mounting subvolumes allows you to see a particular subvolume directly WITHOUT having to see the default subvolume or other subvolumes. This is particularly useful when you use btrfs as "/" or "/home" and want to "rollback" to a previous snapshot. So assuming "snapshots-server-b" above is a snapshot, you can run mount /dev/sdb1 /mnt/btrfs -o subvol=snapshots-server-b and what previously was in /mnt/btrfs/snapshots-server-b will now be accessible under /mnt/btrfs directly, and you can NOT see what was previously under /mnt/btrfs/snapshots-server-c. Also on a side note, you CAN mount subvolumes not located in the root of btrfs filesystem using "subvolid" instead of "subvol". It might require a newer kernel/btrfs-progs version though (works fine in Ubuntu maverick.) -- Fajar -- 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