2

My backup user should be able to create a btrfs snapshot of the system subvolume (mounted at /). But this doesent work.

Setup: subvol=/rootfs is mounted on / and subvol=/ is mounted on /btrfs

First:

root# mkdir /btrfs/backup && chown backup:backup /btrfs/backup

then as backup user:

backup$ btrfs subvol snapshot / /btrfs/backup/rootfs
Create a snapshot of '/' in '/btrfs/backup/rootfs'
ERROR: cannot snapshot '/': Operation not permitted

If I change the owner of / to be the backup user, it works, but is this the right way?

Ubuntu 16.04 / Linux 4.4.0-59-generic / btrfs-progs v4.4

0

Firstly, I see that you make a directory, not a subvolume.

btrfs subvolume create /path/to/the/location/…/subvolume-name

Secondly, the owner of a directory is different from a simple dir than a mount pont directory. In the second case, it's owned by root. So you must mount it and then, chown the directory mountpoint.

| improve this answer | |
  • Thanks, but this does not really help me. I try to make a snapshot as user (not as root), which is not permitted even if the destination directory is owned by said user. – jonas Mar 21 '17 at 9:07

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.