Skip to content
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

Feature request: storage volume permissions #14507

Open
jonathan-conder opened this issue Nov 21, 2024 · 4 comments
Open

Feature request: storage volume permissions #14507

jonathan-conder opened this issue Nov 21, 2024 · 4 comments
Labels
Feature New feature, not a bug Improvement Improve to current situation

Comments

@jonathan-conder
Copy link

When creating a dir volume:

$ lxc storage volume create default foo

The mounted directory has permissions drwx--x--x (0711). It would be nice to have a config setting to control this. I'd be happy with just the dir driver for now, but we may want zfs as well in future.

It might be possible to work around this using something like:

$ mkdir -p backup/volume
$ $EDITOR backup/index.yaml
$ tar zcf foo.tar.gz backup
$ lxc storage volume import default foo.tar.gz foo

But generating index.yaml is a bit complex and I'm not sure if it's a stable format. Just saying I'd also be happy with an approach along these lines if it's easier to implement.

At the moment our use cache is to mount /var/cache/apt/archives as a volume. Normally this would have 0755 permissions, but as far as I can tell that doesn't really matter because apt runs as root. So I wouldn't treat this request as high priority, at least until we find a use case where the permissions really do matter.

@kadinsayani kadinsayani added Improvement Improve to current situation Feature New feature, not a bug labels Nov 21, 2024
@tomponline
Copy link
Member

I'd be tempted to make this a property of the disk device that attaches the volume to an instance, rather than a property of the volume itself, as that then offers the option of having the same volume mounted to multiple instances using different mount perms.

@jonathan-conder
Copy link
Author

That's interesting, I didn't even know that was a possibility. Might be worth checking if this is already doable with raw.mount.options or something

@tomponline
Copy link
Member

Something related recently landed in Incus lxc/incus#1415

Thinking about this more the uid/gid maybe able to be device specific (if we consider idmapped mounts) however the permission of the volume directory itself would need to be on the volume indeed.

@jonathan-conder
Copy link
Author

What a coincidence! That feature looks like it would work for us

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature New feature, not a bug Improvement Improve to current situation
Projects
None yet
Development

No branches or pull requests

3 participants