PDA

View Full Version : auto bind folders



agoela
26th May 2008, 04:56 PM
I have installed a 2nd hard drive on my server that keeps all my data (pictures, videos, music, etc). Is there a way to bind these folders to everyone on the fedora server without having to keep modifying fstab everytime i create a new account. If i had to modify fstab it could potentially grow rather large since I would be binding each folder (4 folders total) for every account on the server.

Any help would be greatly appreciated. :)

stevea
26th May 2008, 05:34 PM
Just create soft links "ln -s" from each user's desktop to the appropriate folder.
Perhaps if you put the links in /etc/skel then adduser would automatically.

Creating many binds is an odd approach.


More to the point - why do you need to put these in each home account in the first place ?
A not mount the fs at /home/common and give everyone group permissions to the contents ?
A user could make a soft lin kto it if that's what they wanted. No need to admin at that level.

agoela
26th May 2008, 05:55 PM
I want to do it for everyone because I want everything that is saved to go to the bigger hard drive

stevea
26th May 2008, 06:24 PM
I think you mean the ~/Music ~/Video directories. Those are normally made by the gnome login I think, not by useradd.

Still you can just do this:
ln -s /home/common/Music /etc/skel/Music
...
then useradd would create a link to a *common* directory (here I assume that /home/common/Music is on your large disk). Of course this assumes a shared directory for Music, Vids downloads etc.

--
Have you considered putting /home on the other disk ?
Alternatively make a script to make personal directories on the large disk, and soft links to them.

agoela
27th May 2008, 01:11 AM
The link idea is good, but when you use FTP, the linked folder looks like a file which may be confusing for some of my friends who I want to add. I did not think about putting home on the 2nd HDD, the hard drive is used more for storing music/pictures/videos/etc

Is there a way to create a generic entry in fstab/mtab. For example I do a bind to ~user/picture and everytime i reboot the the machine it remounts all of them without having to put in an entry for each user?

agoela
27th May 2008, 01:26 AM
Another thing is that it will take the people to the /storage/pictures folder and I want it to act like it is in their local location. It is especially bad when using FTP, because to get back to their home drive they would have to either use the back button, or if they use the "up" button to go 1 folder level up, they would pass through / which is very unsafe.

stevea
27th May 2008, 07:54 PM
ftp is very unsafe and personally I would never run it on a public system. I don't even like it on a firewalled LAN.
Try ssh/putty. If your ftp doesn't handle links then pitch it, it's broken.


No - mount wasn't meant to be used that way (hundreders of binds on a per user basis) so there is no feature tu help you.. You may have issues with that approach.

Why not just make the entire user "~" (home) on the large drive and avoid this. You are going to extreme to avoid the simple solution.

agoela
31st May 2008, 08:57 PM
Thanks for your help, i went with the symbolic link method