I have an external hard drive mounted in arch-linux using /etc/fstab:
dev/sda1 /mnt/share ntfs-3g user,users,gid=users,fmask=113,dmask=002,locale=en_US.UTF-8 0 0
charles@arch ~ $ ls -l /mnt/share
total 13
drwxrwxr-x 1 root users 4096 Jan 5 03:20 Audio
drwxrwxr-x 1 root users 4096 Jan 5 09:07 Photos
drwxrwxr-x 1 root users 0 Jan 4 10:58 $RECYCLE.BIN
drwxrwxr-x 1 root users 4096 Jan 5 09:21 Videos
All directores are owned by root:users
and I can't change ownership, nor create a subdirectory with different ownership (as it's ntfs).
Let's suppuse the hard disk has subdirectories hdd_subdir_1
and hdd_subdir_2
, both top-level. In addition, I have root
user and unpriv
, a completely unproviliged user on linux.
I wish to mount the device with 2 mountpoints:
- /mnt/share/subdir_1 as mount point as above, pointing to
hdd_subdir_1
on device; - /mnt/share/subdir_2 as mount point, where
/mnt/share/subdir2
is owned byunpriv:unpriv
, pointing tohdd_subdir_2
on device.
So 2 different default privileges, 2 mount points, 1 device. How do I do this? If not for the different privileges, I'd just set up symlinks or use mount -bind
. But I can't make it work for the use case above. Thanks!
Best Answer
I am able to accomplish the setup above now, by a combination of local settings and
/etc/fstab
settings.