First off, I'm not a huge Linux person. I can get around, I'm familiar with some Linux structuring, and barely anything with the CLI. So please bear with me while I stumble around like a drunk fool at Mardi Gras.

I have 3 folders in 4 different user accounts.

  • User1 has Archives, Documentation, Sources
  • User2 has Archives, Documentation, Sources
  • User3 has Archives, Documentation, Sources
  • User4 has Archives, Documentation, Sources

I need to link these 3 directories to NFS Mounts under /mnt/storage01, /mnt/storage01a, and /mnt/storage02/

I haven't tested it yet, but I haven't heard any complaints from them yet. When I went to do the second account, I got this error;

jumpbox@us01-jumpbox:/home/User1$ sudo mkdir Archives
jumpbox@us01-jumpbox:/home/User1$ sudo mkdir Documentation
jumpbox@us01-jumpbox:/home/User1$ sudo mkdir Sources
jumpbox@us01-jumpbox:/home/User1$ ln -s /home/User2/Archives /mnt/storage01
jumpbox@us01-jumpbox:/home/User1$ ln -s /home/User2/Documentation /mnt/storage01a
jumpbox@us01-jumpbox:/home/User1$ ln -s /home/User2/Sources /mnt/storage02
jumpbox@us01-jumpbox:/home/User1$ ln -s /home/User1/Archives /mnt/storage01    
ln: failed to create symbolic link '/mnt/storage01/Archives': File exists

Is what I'm trying to do even possible? Any solid suggestions on how I can get this done?

  • You probably want mount --bind . – Panther Jan 2 '18 at 15:45
  • Are you trying to link user folders to the storage? or vise versa ln -s /full/path/of/original/folder /full/path/of/soft/link/file – ravery Jan 2 '18 at 15:51
  • I want to link the folder in /home/user1/Archives to /mnt/storage01, and so on, however I want to do it for any number of users I have, without changing the folders in the User Directory. – BinaryData Jan 2 '18 at 16:00
  • yes but which direction? if you want to give all users access to storage, then John Oriion's answer is correct. you have your link syntax backwards. – ravery Jan 2 '18 at 16:17
  • What do you expect when you do cd /mnt/storage01; ls -l? All files from /home/User1/Archives? Or all files from /home/User1/Archives plus all files from /home/User2/Archives plus all files from /home/User3/Archives? – PerlDuck Jan 2 '18 at 16:28

dont make the directories in the users folder .. if the folders already exist it wont be able to create the link ... also you probably need to use the sudo

so delete the folders you made in User1 and User2

and create the following links

sudo ln -s /mnt/storage01 /home/User2/Archives
sudo ln -s /mnt/storage01a /home/User2/Documentation
sudo ln -s /mnt/storage02 /home/User2/Sources

and so on

link works as ln (link) -s (softlink/symbolic link) (this folder or file) to (this area/ folder) or

ln -s /FolderYouWantToHaveLinkedTo /FolderWhereYouWantTheLinkToGo
| improve this answer | |
  • sudo isn't necessary if he is the owner of the folder the link is placed in. – ravery Jan 2 '18 at 16:04
  • yeah but he is in user 1 and trying to make links to User 2 so that is why i suggest sudo .. also I tried without sudo to make a folder link to the /tmp directory from my home directory .. without sudo it made the link but not a folder and not accessible .. I had to use sudo to have it show up as a clickable folder link. – John Orion Jan 2 '18 at 16:08
  • yes and he is trying to link a root owned folder to user folders ... he is using NTFS so its root with all read/write access since NTFS doesnt deal with linux permissions. I think he will still be needing sudo but .. maybe not maybe he can sign in as each user and not use sudo – John Orion Jan 2 '18 at 16:17
  • which would be preferable, if he uses sudo then the link will be owned by root .... a possible source of some issues. – ravery Jan 2 '18 at 16:18
  • 1
    @PerlDuck ahh my eyes are seeing things lol .. i saw ntfs :D lol... I still feel my solution would work for him ... but he may have to play with permissions – John Orion Jan 2 '18 at 16:23

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.