Open ygerlach opened 2 months ago
Would be great to have this!
Also keep in mind that to remove the read only subvolumes they cannot be deleted as regular directories but with the btrfs command:
btrfs subvolume delete ...
you are right. But instead of relying on the btrfs
command i would rather just use the systemcalls if it is possible without much hassle. But many of them are quite easy. Just have a dirfd to the subvolume and call a specific ioctl to do an operation. Nothing to crazy.
Here an excerpt from the strace of a btrfs subvolume delete asd
:
openat(AT_FDCWD, "/media/root", O_RDONLY|O_NONBLOCK|O_CLOEXEC|O_DIRECTORY) = 3
[...]
ioctl(3, BTRFS_IOC_SNAP_DESTROY, {fd=0, name="asd"}) = 0
So there is no magic happening.
Not using the btrfs command removes the requirement to check for existence of that command or its version. Also the interface is more straight forward. (No parsing the output just getting a specific errno
if something is wrong) And it should also be slightly faster ;)
Describe the bug All btrfs snapshots created by timeshift are writeable. I believe they should be read-only by default (and maybe have a button to make them writeable). So you cant accidentally mess up your only way back out of a broken system.
To Reproduce
Expected behavior
btrfs subvolume snapshot -r ...
should be used to create a read-only snapshot and avoid users messing up their backup. A Option could be provided to toggle the snapshot between read/write and read-only. A Option to set the default value for new snapshots might also be useful (should be read-only by default).