Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Mute
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Dear all,
Customer is reporting an issue with PowerShell Toolkit when trying to create a new symlink.
Actually, he is stuck on a big project so any fast help would be very appreciated.
Target File « test.txt »
- The target file is seen by powershell
- Exécution on the command New-NcSymLink with issue
- You have executed this command without « /vol » on traget or symlink but without success.
- The symlink file « test2.txt » is created but symlink is not functional.
<contact info removed by moderator>
Solved! See The Solution
1 ACCEPTED SOLUTION
Quang-Chinh has accepted the solution
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
I followed this KB article, and it worked perfectly in my lab. Screenshot attached.
How to create a symbolic link in clustered Data ONTAP without the need for NFS:
https://kb.netapp.com/app/answers/answer_view/a_id/1029854
Lab:
simulator:ONTAP 9.6
PSversion:4
Note: Original & symlink file need not exist prior, first will be created during command-line execution, and test_copy will be created automatically.
symlink: test_copy
original: test
7 REPLIES 7
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Please look at the example given in this blog: [Very well written]
I think the order and syntax needs correction.
Go to this section:
How we create some Symlinks with PowerShell
https://community.netapp.com/t5/Network-Storage-Protocols-Articles-and-Resources/How-Symlinks-boost-productivity/ta-p/126258
Hope this helps, if not then one of our powershell expert will come back to you.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
We saw this article.
But that does not correspond to the need. We try to create a symlink to a file by mounting a CIFS folder.
The New-NcSymlink command only needs two parameters: Symlink and Path.
when we return this command we have an error "No such file or Directory". This creates a file but does not point to anything.
Is it a problem configuring the netAPP cluster or the Powershell version 9.6 toolkit?
Can you give an example of a command to test?
Thank
Quang-Chinh has accepted the solution
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
I followed this KB article, and it worked perfectly in my lab. Screenshot attached.
How to create a symbolic link in clustered Data ONTAP without the need for NFS:
https://kb.netapp.com/app/answers/answer_view/a_id/1029854
Lab:
simulator:ONTAP 9.6
PSversion:4
Note: Original & symlink file need not exist prior, first will be created during command-line execution, and test_copy will be created automatically.
symlink: test_copy
original: test
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thank you for your time.
I do not understand. If Original and symlink file does not exist how can you create a symlink to an existing file?
I also tested :
- My vServer : BISPNASN4003
- My ShareName: VDISK1
I try to create a symlink file "Symlink.txt" that point to "Target.txt" :
- First command
Add-NcCifsSymlink –unixpath /Target.txt/ -cifspath /Symlink.txt/ -locality local –sharename VDISK1
- Second command
New-NcSymlink –target /Target.txt –linkname /vol/BISPNASN4003_01/VDISK1/Symlink.txt
II do not see a file "Target.txt"
II do not see a file "Target.txt"
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
My wording may have confused you. But, what I'm trying to say is, I created a file 'test' and sym linked to 'test_copy' which is actually a symlink created by the first command. Target is simply does not have to exist.
Its mentioned in the article : The '-target is a path or location that does not have to exist. The target path is not checked for validity.
'Test' will create a symlink that points to a non-existent path of /somewhere
and the symbolic link itself will be created in the shared folder, in my case qtree_cifs.
and the symbolic link itself will be created in the shared folder, in my case qtree_cifs.
I have tried it 3 times, and it worked for me.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
OK, thanks. I understood. The first command creates a symlink object that points to the target. The second command creates the file that points to the created symlink.
Super.
thank for your time and your Help
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Yes, you worded perfectly. Thanks!
