How can I share mounted disk between users?

Forum rules
Before you post read how to get help. Topics in this forum are automatically closed 6 months after creation.
Locked
User avatar
mbnoimi
Level 4
Level 4
Posts: 206
Joined: Sat Dec 04, 2010 7:45 pm
Contact:

How can I share mounted disk between users?

Post by mbnoimi »

Hi,

Thunar mounts my external disk correctly but it works for root and current user (the user who mounted the disk) while other users unable to read/write to the mounted disk.

How can I share mounted disk between users?

NOTE:
Thunar sets mount point to /media/[user]/[disk name] when I tried to change the owner of /media folder to 777 all users could see the mounted folder but can't read/wrte because Thunar sets the permissions to 644
Last edited by LockBot on Wed Dec 28, 2022 7:16 am, edited 1 time in total.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
MtnDewManiac
Level 6
Level 6
Posts: 1491
Joined: Fri Feb 22, 2013 5:18 pm
Location: United States

Re: How can I share mounted disk between users?

Post by MtnDewManiac »

WARNING: I don't have a clue, lol. But I just did some searching. It looks like Thunar uses other things to do the actual mounting. In the event that someone who has some intelligence/experience doesn't post a simple answer for you, maybe some of the information in these links will help:

Code: Select all

http://superuser.com/questions/874171/mounting-usb-sticks-with-thunar-wrong-user-and-gruop
http://ubuntuforums.org/showthread.php?t=2273085
https://bbs.archlinux.org/viewtopic.php?id=194755
https://wiki.archlinux.org/index.php/Thunar
Regards,
MDM
Mint 18 Xfce 4.12.

If guns kill people, then pencils misspell words, cars make people drive drunk, and spoons made Rosie O'Donnell fat.
User avatar
mbnoimi
Level 4
Level 4
Posts: 206
Joined: Sat Dec 04, 2010 7:45 pm
Contact:

Re: How can I share mounted disk between users?

Post by mbnoimi »

MtnDewManiac wrote:WARNING: I don't have a clue, lol. But I just did some searching. It looks like Thunar uses other things to do the actual mounting. In the event that someone who has some intelligence/experience doesn't post a simple answer for you, maybe some of the information in these links will help:

Code: Select all

http://superuser.com/questions/874171/mounting-usb-sticks-with-thunar-wrong-user-and-gruop
http://ubuntuforums.org/showthread.php?t=2273085
https://bbs.archlinux.org/viewtopic.php?id=194755
https://wiki.archlinux.org/index.php/Thunar
Regards,
MDM
Thanks a lot.

Most of links above aren't relative to my issue except Thunar wiki page which maybe has a lead to the solution because it mention that Thunar uses gvfs so the user can customize mounting rules using ~/.gvfs/mounts. For that I wonder Am I on the right path or not? If yes; Is there any GUI solution for it (Thunar mounts the disks within single click / automatically which make life easier)?
altair4
Level 20
Level 20
Posts: 11426
Joined: Tue Feb 03, 2009 10:27 am

Re: How can I share mounted disk between users?

Post by altair4 »

Any external disk or a specific one?

You could specify explicit instructions in fstab so that when this device is attached it mounts to a specific place. How you specify that depends on how you formatted the device and you didn't specify. This is device specific though so you would have to add a line for each different device.

If you want to make it so any device attached is accessible by everyone then you could use bindfs. Play with this method for a while and see if it does what you want - it's easy enough to undo:

Install bindfs:

Code: Select all

sudo apt-get install bindfs
Create another mount point:

Code: Select all

sudo mkdir /mnt/ExtDisks
Then run this command to bindfs-mount /media to /mnt/ExtDisks with a different set of permissions:

Code: Select all

sudo bindfs -o perms=0666:+X /media /mnt/ExtDisks
To undo the mount:

Code: Select all

sudo umount /mnt/ExtDisks
What will happen is when you attach a USB disk it will mount in two different places simultaneously:

One in the normal place at /media/$USER/LABEL where the only user who will gain access is the user who attached the device ( i.e., $USER )
And again at /mnt/ExtDisks/$USER/LABEL where it will have permissions of 777 for folders and 666 for files.

Please note: Bindfs is a powerful thing but you need to keep in mind that using it with /media in this way will enable everyone to access anything under it.

Also note: This method makes your usb disk look a lot like an NTFS formatted device in that the permissions of 777/666 will be persistent throughout the disk. Not something you want to do if you are doing a system backup where you need to maintain the original permissions and ownership.

If it does what you want you can make the bindfs permanent with each boot by placing the line ( without sudo ) above the "exit 0" line in /etc/rc.local
Please add a [SOLVED] at the end of your original subject header if your question has been answered and solved.
MtnDewManiac
Level 6
Level 6
Posts: 1491
Joined: Fri Feb 22, 2013 5:18 pm
Location: United States

Re: How can I share mounted disk between users?

Post by MtnDewManiac »

mbnoimi wrote:Thanks a lot.

Most of links above aren't relative to my issue
Sorry about that. I did warn you that I was clueless :lol: .

IIRC, this issue has been discussed at the Xfce community web forum

Code: Select all

https://forum.xfce.org/
You might do a site-search of it using your favorite web search engine or go visit the website. I think the solutions discussed may have been affected by the question of whether the external drive(s) in question would always be connected, or this would vary. But I cannot swear to it, because I just skimmed over the threads out of curiosity and not out of a need (IOW, the issue in question does not affect me as a single-user).

Arch's Wiki has all kinds of jewels in it, BtW. (Don't get me wrong, the Mint folks are real helpful, too.)

Regards,
MDM
Mint 18 Xfce 4.12.

If guns kill people, then pencils misspell words, cars make people drive drunk, and spoons made Rosie O'Donnell fat.
Locked

Return to “Xfce”