How to set up symbolic link folder in NFS share from Samba share on NSA325?
First, my goal: to access media files on my NSA325 through NFS. Rather than moving my content from my existing Samba shares on NSA325 (video, photo & music) I would like to create symbolic link folders in an NFS share leading to these.
I set up an NFS share called Media (using Network\NFS\Add NFS Share in the NSA325 GUI), under which I would like the symlink folders for video, photo & music.
Next, I SSH'd into the NSA325 and entered (taking the video share as an example):
ln -s /i-data/c92fee57/video /i-data/c92fee57/nfs/Media
This sets up a symlink folder called video as expected which I can access in SSH and put files in... so good so far. However, whilst I can see the new symlink folder in both the NSA325 share browser and Windows File Explorer, I cannot open it in either (NSA325 says "Access denied.", Windows says "Windows cannot access [path]..."). I tried setting up the links in SSH as both root and admin, but that made no difference.
I would be grateful for any tips please - as you might be able to tell I'm am a bit of a toddler in SSH in this land.
NSA325 Firmware version : NSA325_4.81(AAAJ.1)
That ain't gonna work. A symlink is basically a textfile containing a path. The filesystem layer recognizes it as a link, and does the redirection.So now you created a symlink containing '/i-data/c92fee57/video', and that symlink is shared over NFS. The client doesn't know about '/i-data/c92fee57', and can't follow that link anyway, as it points outside the shared path.The other way around might work, samba doesn't share a filesystem, but shares files. So the interpretation of a symlink for samba is done serverside. Yet I don't know if following symlinks is enabled in the firmware samba.You could use a bindmount. When Media is a directory, and not a symlink, you can mount another directory on it:mount --bind /i-data/c92fee57/video /i-data/c92fee57/nfs/MediaYou'll have to repeat that after each reboot.The most simple solution is to edit /etc/exports, and create your own nfs exports. Be careful, /etc/exports is a symlink to another file in a non-volatile filesystem, so if you accidentally overwrite the symlink instead of the file it points to, the change won't survive a reboot.
Many thanks @Mijzelf for your full and clear response, it is much appreciated. Why it didn't work now makes perfect sense to me. I think, however, I have misunderstood your suggested solution, as what I tried doesn't work.The first step is fine: i.e. pasting 'mount --bind /i-data/c92fee57/JunkMedia /i-data/c92fee57/nfs/Media' in SSH works perfectly (nfs/Media is populated as expected and then empties after reboot, as you suggested it would).I then tried adding the line to exports. My '/etc/exports' links to '/usr/local/zy-pkgs/etc/exports' so I edited that. Originally it just had the one line:/i-data/c92fee57/nfs/Media *(rw,sync,no_subtree_check,wdelay,no_root_squash) #After my edit it has two lines, thus:/i-data/c92fee57/nfs/Media *(rw,sync,no_subtree_check,wdelay,no_root_squash) #
mount --bind /i-data/c92fee57/video /i-data/c92fee57/nfs/Media #The changes to exports are still there after reboot, however nfs/Media remains empty. I tried with and without the final '#'.I would be very grateful for another nudge in the right direction, I feel I am very close!0
Brilliant, thanks @Mijzelf, perfect! I never for a minute thought it would be that simple.It's great that this helped you too, @katesmith1304
- 8.1K All Categories
- 1.6K Nebula
- 60 Nebula Ideas
- 54 Nebula Status and Incidents
- 4.4K Security
- 224 Security Ideas
- 965 Switch
- 45 Switch Ideas
- 868 WirelessLAN
- 20 WLAN Ideas
- 5.2K Consumer Product
- 139 Service & License
- 268 News and Release
- 95 Success Stories
- 53 Security Advisories
- 12 Education Center
- 573 FAQ
- 273 Nebula FAQ
- 132 Security FAQ
- 73 Switch FAQ
- 72 WirelessLAN FAQ
- 7 Consumer Product FAQ
- 34 Nebula Monthly Express
- 71 About Community
- 44 Security Highlight