Contents
How do you give someone a mount point in Linux?
If a Linux filesystem (not e.g. FAT32, NTFS) is mounted then the directory permissions for the root directory are taken from the filesystem. root must either change the owner ( chown ) or permissions ( chmod , setfacl ) of the root directory or has to create subdirectories which are writable by the users.
What is the purpose of the mount point?
The mount point is used as the root directory of the filesystem, and that filesystem is accessible from that directory. The previous content of that particular directory become invisible and cannot be accessed until the filesystem is unmounted (detached).
How to change ownership of a mount point?
After the mounting the uid:gid and permissions of the mount point are set to ones from the root directory of the mounted partition. So to change the owner/permissions mount the partition as root, chdir to the mount point and set them as you want using # chmod 777 .
Is the mount point still owned by root?
/media/hrmount is still owned by root when i remount “irrelevant” . And if i delete the directory in hope that “mount” will create it automatically and make it owned the user that issued the mount command I’ll just get an error message saying the directory does not exist.
How to take permissions from a mount point?
The ideal behaviour would be to just issue the mount device command either by sudoing or normally and the partition is mounted and also the folder is automatically created. If a Linux filesystem (not e.g. FAT32, NTFS) is mounted then the directory permissions for the root directory are taken from the filesystem.
How can I change the mount point to user Foo?
If you want to only do it as part of the mount command line, you can use the -o switch and do: mount device mount-point -o uid=foo That will change the owner of the mount point to user foo instead of root.