Linux - SoftwareThis forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I have a problem that I hope you guys can help by giving some suggestions.
I have a machine that is shared among several people. And I have setup a directory in there that is shared among all the users. This directory because of some reasons has to be also viewable from window OS that is dual booted off the same machine.
So I have that directory actually a mount directory of a vfat partition.
On the fstab I have put the entry of that partition (/dev/sda5) to be like this:
/dev/sda5 /mnt/data vfat noauto,user,rw 1 0
so any user that login to the machine then can mount the partition and have the /mnt/data under his/her name and have full read/write access to it.
But problem is sometimes these people forget to unmount the directory after they have finished and logout of the system. And the next guy wouldn't be able to umount or mount the directory again or to write to it.
So one of the solution I can think of is to have a simple script to automatically unmount the partition everytime the user logout. So something like a logout or exit script (a counterpart of the profile script).
Is there such a thing as a logout script in linux ? Or do you have some other solutions for my problems ?
Easier might be to have that partition mounted at boot time, in such a way that all the files are owned by root, but have permissions of 777 (ie anyone can read/write these files).
So try this as your fstab line:
/dev/sda5 /mnt/data vfat iocharset=iso8859-15,codepage=850,umask=0 0 0
then either reboot or do mount -a as root
Why don't you mount it automatically at startup and just keep it mounted? If you specify the options gid (to give all files on the mounted partition your users group) and a corresponding umask, it should work for everybody. Here's mine:
You know what.... I learned something new today...
Thanks guys... both suggestions obviously work, but I will stick to one given by uselpa, since it is more secure by not giving the world access to the mounted directory.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.