-
Notifications
You must be signed in to change notification settings - Fork 243
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
btrfs-progs: add option for recursive subvol snapshots #886
base: devel
Are you sure you want to change the base?
Changes from all commits
0e11b21
082ce75
3ca473e
2b204e1
2688073
91a4311
2c8dc94
50f408d
a9416ed
261f25b
f396c03
af0e8be
c72719b
184eddc
2afdbd7
b1ccd69
c75b2f2
180d79f
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -112,6 +112,15 @@ delete [options] [<subvolume> [<subvolume>...]], delete -i|--subvolid <subvolid> | |
-i|--subvolid <subvolid> | ||
subvolume id to be removed instead of the <path> that should point to the | ||
filesystem with the subvolume | ||
|
||
-R|--recursive | ||
delete subvolumes beneath each subvolume recursively | ||
|
||
This requires either `CAP_SYS_ADMIN` or the filesystem must be | ||
mounted with `user_subvol_rm_allowed` mount option. | ||
In the unprivileged case, subvolumes which cannot be accessed | ||
are skipped. The deletion is not atomic. | ||
|
||
-v|--verbose | ||
(deprecated) alias for global *-v* option | ||
|
||
|
@@ -243,17 +252,23 @@ show [options] <path> | |
-u|--uuid UUID | ||
show details about subvolume with the given *UUID*, looked up in *path* | ||
|
||
snapshot [-r] [-i <qgroupid>] <source> <dest>|[<dest>/]<name> | ||
snapshot [-r|-R|--recursive] [-i <qgroupid>] <source> <dest>|[<dest>/]<name> | ||
Create a snapshot of the subvolume *source* with the | ||
name *name* in the *dest* directory. | ||
|
||
If only *dest* is given, the subvolume will be named the basename of *source*. | ||
If *source* is not a subvolume, btrfs returns an error. | ||
|
||
If you wish to recursively create a readonly snapshot, you can run | ||
:command:`btrfs property set <path> ro true` on each subvolume after this command completes. | ||
|
||
``Options`` | ||
|
||
-r | ||
Make the new snapshot read only. | ||
-R|--recursive | ||
Recursively snapshot subvolumes beneath the source. This option cannot be | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This sounds like limitation but we can't do better in user space. This is possible in kernel but is quite complicated so we must exclude -r and -R for now. As a suggestion to documenation, the subvolume can be mad read-only afterwards by changing the property to And as this is using libbtrfsutil the same limitations apply (and need to be documented): it's not atomic and depends on the capabilities to enumerate the subvolumes. Similar to what the recursive deletion has, we might need a special section in documentation for that so we can refer to it instead of repeating the whole text. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Thanks, I've added a bit to the man page. I might also look into fixing the kernel so that this can be done properly. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This still does not mention the limitations, nor referes to a section where it would be explained. |
||
combined with -r. | ||
-i <qgroupid> | ||
Add the newly created subvolume to a qgroup. This option can be given multiple | ||
times. | ||
|
Large diffs are not rendered by default.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For clarity I'd suggest to mention that it has to be done from the leaves up in the tree consisting of subvolumes. Which may not be that easy to find out manually, so this could be a separate command for
subvolume
(in a separate patch). For parity an option to the snapshot command can be added that should read like it's doing the read-only change after the snapshots. This can be also added separatelly, we need to define the use cases first.