[SOLVED] Automount user filesystem on console login only
Linux - DesktopThis forum is for the discussion of all Linux Software used in a desktop context.
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.
Introduction to Linux - A Hands on Guide
This guide was created as an overview of the Linux Operating System, geared toward new users as an exploration tour and getting started guide, with exercises at the end of each chapter.
For more advanced trainees it can be a desktop reference, and a collection of the base knowledge needed to proceed with system and network administration. This book contains many real life examples derived from the author's experience as a Linux system and network administrator, trainer and consultant. They hope these examples will help you to get a better understanding of the Linux system and that you feel encouraged to try out things on your own.
Click Here to receive this Complete Guide absolutely free.
At my work I'm faced with a challenge. It has been decided that we're moving to a Linux desktop environment. Basically it's a cluster of RedHat Enterprise Virtualisation (RHEV) servers running VDI's for all our users. They can then connect to the console of a running VDI and start working.
Now all that is working fine, but there is still one challenge left. I'm asked to configure the systems that a user specific directory is mounted when the user logs in to the console. (So, that's logs in to Gnome in practice). The problem is that if, for example, I use ssh to connect to the machine, the directory should not be mounted. Hence I can't use .profile or automount to perform the mount.
Then I tried running a script on gnome login to perform the mount, using udisks, but since the filesystem to mount is an NFS share, udisks is not of much help.
I could of course add all these user specific entries to fstab and make them user mountable, but since we have about 1000 users (with several 10s changing every week) that's not really a workable solution.
Unfortunately this is not what I'm looking for. As mentioned, I only want to mount this directory if the user logs in from the console. If I use automount, it will also be mounted if a user uses something like ssh to login to the system.
Maybe it was not clear from my first post, but it's not the home directory I need to mount. This is some extra space we want to give to our users on so called "cheap" storage. It will always be mounted using the exact same location, /scratch; no subdirectories like /scratch/<userid>. That's why I only want it at console login. Ohterwise I don't know what will happen, but I assume in that case what's mounted in /scratch will be of the last user logged into the system.