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

Mount with specific owner #150

Closed
BigmenPixel0 opened this issue Jan 23, 2022 · 1 comment
Closed

Mount with specific owner #150

BigmenPixel0 opened this issue Jan 23, 2022 · 1 comment
Labels
question Further information is requested

Comments

@BigmenPixel0
Copy link

Can I mount /var/cache/my_folder with specific uid and gid?

[zram5]
zram-size = ram
compression-algorithm = zstd
options = nosuid,nodev
fs-type = ext4
mount-point = /var/cache/my_folder
@nabijaczleweli nabijaczleweli added the question Further information is requested label Jan 23, 2022
@nabijaczleweli
Copy link
Collaborator

The hack described in the README https://github.com/systemd/zram-generator#mount-points applies, just do chown instead of/in addition to chmod (I think that's what you're asking, per analogiam w/tmpfs).

Closing as duplicate of #146. I should really polish the half of a systemd patch I have for this.

karelzak pushed a commit to util-linux/util-linux that referenced this issue Apr 21, 2022
Which take a user, group, and mode, respectively, and set them on the
target after mounting

This is vaguely similar to tmpfs(5)'s [ug]id= and mode= options,
but we POSIX-parse the user- and group names

Oft requested in systemd/zram-generator, since a common use-case
is to use it to create /tmp or an equivalent directory that needs
to be a=rwx,o+t (or a user's private temp that needs to be owned
by them) ‒ this is impossible without terrible hacks, cf.
systemd/zram-generator#150,
systemd/zram-generator#146, &c.

This started off as a Set{User,Group,Mode}= systemd mount unit,
but was poetterung into libmount options:
systemd/systemd#22889

Signed-off-by: Ahelenia Ziemiańska <nabijaczleweli@nabijaczleweli.xyz>
Signed-off-by: Karel Zak <kzak@redhat.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Development

No branches or pull requests

2 participants