Page 1 of 1

Create symbolic link in a mounted Nas

Posted: Wed Aug 07, 2019 9:09 am
by jax7121
I hope you can help me solve my problem. My Raspberry mounts a NAS in the path /home/pi/NAS at startup. The /etc/fstab file is configured as follows:

Code: Select all

//192.168.1.2/share /home/pi/NAS cifs username=user,password=password,vers=1.0,sec=ntlm,file_mode=0777,dir_mode=0777,uid=pi,gid=pi,forceuid,forcegid,_netdev,x-systemd.automount 0 0
To avoid duplicating files, I decided to create symbolic links with the command:

Code: Select all

ln -s /home/pi/NAS/Folder1/file.mp4 /home/pi/NAS/Folder2/file.mp4
but I get the error message:

Code: Select all

ln: creation of the symbolic link '/home/pi/NAS/Folder2/file.mp4' failed: It is not a directory
However, the same command works locally by running:

Code: Select all

ln -s /home/pi/Folder1/file.mp4 /home/pi/Folder2/file.mp4
work perfectly!

Where am I wrong? Can there be an error in the /etc/fstab file?
Thanks in advance

Re: Create symbolic link in a mounted Nas

Posted: Wed Aug 07, 2019 1:08 pm
by topguy
Symbolic links are kinda special feature and does not automatically work across mounted filesystems, I was surprised it could be made to work at all..

https://superuser.com/questions/1337257 ... amba-share

Re: Create symbolic link in a mounted Nas

Posted: Fri Aug 09, 2019 8:50 pm
by thagrol
The underlying filesystem has to support symlinks for them to work.

Linux/Unix files systems do (ext ... ext4, etc) windows file systems don't. Samba shares will complicate things and may not allow them to be created on remote shares (but may handle them correctly if created directly on the server). Given that samba/cifs originated in the windows world I'd not expect the smb layer to support symlinks.

@topguy: symlinks will work across mount points and/or file systems but the filesystem they're being created on must support them. The filesystem containing the target of the link doesn't have to.