Mounting disk drives among different users
Solution 1:
- Will it work? The answer depends on how the permissions are set on the folder. No matter if it's linked or not, if the user is not privileged to access the directory, the user will not be able to.
- Is this safe? It's safe if it does work, but you probably want to do this the correct way.......
How to mount a device so that other users have access to it:
First, with the device unmounted, make an entry for the device on a new line in /etc/fstab
, making sure that there is still a final new line at the end of the file. It should look something like:
UUID=<uuid> /media/<mountpoint> ext4 user,defaults 0 1
Or:
/dev/XYZ /media/<mountpoint> ext4 user,defaults 0 1
Replace <uuid>
with the UUID of the drive, <mountpoint>
with the directory under /media
that you want it to mount in, and /dev/XYZ
to the device's name.
Second, make a new group and add the two users to it with:
sudo groupadd <group name>
sudo adduser <user1> <group name>
sudo adduser <user2> <group name>
Then make sure the mountpoint is owned by the group:
sudo chgrp -hR /media/<mountpoint> <group name>
Mount the drive with sudo mount /dev/XYZ
or reboot.
This method will avoid messing around with symbolic links!