Do you need write permission to mount a volume?
A volume intended for use by my user was created at OS installation with root ownership and my user lacks write permissions. adding user or users mount option in /etc/fstab.
Which is the best command to mount a partition?
You can go ahead and add the user option so that a regular user without sudo can mount it should it be unmounted. For practicality, the best option here is chown as it gives the user the needed permissions instantly. The chmod command can be used afterwards if the permissions need to be modified for others.
How to Mount USB drive with write permissions?
It mounts but the /home/storage receives root as owner and group and doesn’t allow media user to write there. If i use mount command without sudo as the user media – i’m not allowed. Says only root can use mount. If I use mount with options: server# sudo mount /dev/sdb2 /home/storage -o umask=000 I get what I need.
Is there a way to mount a partition without Sudo?
You can go ahead and add the user option so that a regular user without sudo can mount it should it be unmounted. For practicality, the best option here is chown as it gives the user the needed permissions instantly.
How to set volumemount user group and file?
Any files created under it will be having permission of nonrootgroup:nonrootgroup. For k8s version 1.10+, runAsGroup has been added, it’s similar to fsGroup but works differently. Implementation can be tracked here: https://github.com/kubernetes/features/issues/213
How to set volumemount in pod security context?
The Pod Security Context supports setting an fsGroup, which allows you to set the group ID that owns the volume, and thus who can write to it. The example in the docs: I ended up with an initContainer with the same volumeMount as the main container to set proper permissions, in my case, for a custom Grafana image.
Is it possible to give a non-root user access to the hosted volume?
Is it possible to give a nonroot user in a docker container access to the hosted volume? If not, is my only option to run the process in docker container as root? There’s no magic solution here: permissions inside docker are managed the same as permissions without docker.