Hi All, the following patches implement the recursively snapshotting and deleting of a subvolume. To snapshot recursively you must pass the -R switch: # btrfs subvolume create sub1 Create subvolume './sub1' # btrfs subvolume create sub1/sub2 Create subvolume 'sub1/sub2' # btrfs subvolume snapshot -R sub1 sub1-snap Create a snapshot of 'sub1' in './sub1-snap' Create a snapshot of 'sub1/sub2' in './sub1-snap/sub2' To recursively delete subvolumes, you must pass the switch '-R': # btrfs subvolume create sub1 Create subvolume './sub1' # btrfs subvolume create sub1/sub2 Create subvolume 'sub1/sub2' # btrfs subvolume delete -R sub1 Delete subvolume '/root/sub1/sub2' Delete subvolume '/root/sub1' Some caveats: 1) the recursively behaviour need the root capability This because how the subvolume are discovered 2) it is not possible to recursively snapshot a subvolume in read-only mode This because when a subvolume is snapshotted, its nested subvolumes appear as directory in the snapshot. These directories are removed before snapshotting the nested subvolumes. This is incompatible with a read only subvolume. BR G.Baroncelli -- To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html
