<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Help With Removing Stubs That Were symlinks in ONTAP Discussions</title>
    <link>https://community.netapp.com/t5/ONTAP-Discussions/Help-With-Removing-Stubs-That-Were-symlinks/m-p/154837#M34780</link>
    <description>&lt;P&gt;PS Toolkit - 9.7.1&lt;/P&gt;
&lt;P&gt;PS - 5.1&lt;/P&gt;
&lt;P&gt;ONTAP 9.6&lt;/P&gt;
&lt;P&gt;The G is uppercase in the name Groups.&lt;/P&gt;</description>
    <pubDate>Mon, 09 Mar 2020 17:51:33 GMT</pubDate>
    <dc:creator>EdS</dc:creator>
    <dc:date>2020-03-09T17:51:33Z</dc:date>
    <item>
      <title>Help With Removing Stubs That Were symlinks</title>
      <link>https://community.netapp.com/t5/ONTAP-Discussions/Help-With-Removing-Stubs-That-Were-symlinks/m-p/154739#M34736</link>
      <description>&lt;P&gt;We are running ONTAP 9.6P2.&amp;nbsp; We have a volume that houses symlinks to various CIFS shares.&amp;nbsp; The symlinks are created with:&lt;/P&gt;
&lt;P&gt;New-NcSymlink -target /linkname&amp;nbsp; -linkname /vol/Groups/linkname&lt;/P&gt;
&lt;P&gt;Add-NcCifsSymlink -unixpath /linkname/ -cifspath / -locality widelink -sharename linkname$&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;All is working well until we try and delete one of these.&amp;nbsp; We first delete the symlink:&lt;/P&gt;
&lt;P&gt;RemoveNcCifsSymlink -Unixpath /linkname/&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;That works well, but when we try and delete the remaining stub file we get a No such file or directory error.&lt;/P&gt;
&lt;P&gt;Remove-NcFile -Path "/vol/Groups/linkname"&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;We get the same errors if we remove all the symlinks and then try to remove all the remaining stubs in bulk using:&lt;/P&gt;
&lt;P&gt;Read-NcDirectory -Path /vol/Groups | ?{ $_.Type -eq "symlink" } | %{ Remove-NcFile&amp;nbsp; -Path "/vol/Groups/$($_.Name)/"}&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Also, if we try and delete the stubs via Windows command line del the response is that the object is not empty.&amp;nbsp; So how can we delete these stubs and why does the stub still function after the symlink is deleted?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 04 Jun 2025 11:17:24 GMT</pubDate>
      <guid>https://community.netapp.com/t5/ONTAP-Discussions/Help-With-Removing-Stubs-That-Were-symlinks/m-p/154739#M34736</guid>
      <dc:creator>EdS</dc:creator>
      <dc:date>2025-06-04T11:17:24Z</dc:date>
    </item>
    <item>
      <title>Re: Help With Removing Stubs That Were symlinks</title>
      <link>https://community.netapp.com/t5/ONTAP-Discussions/Help-With-Removing-Stubs-That-Were-symlinks/m-p/154785#M34758</link>
      <description>&lt;P&gt;What version of the PSTK and PowerShell are you running? I labbed your commands in the following environment:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;PowerShell Version: 5.1&lt;/P&gt;
&lt;P&gt;PSTK Version: 9.7.1&lt;/P&gt;
&lt;P&gt;ONTAP version: 9.6&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;PS H:\&amp;gt; New-NcSymlink -target /linkname -LinkName /vol/groups/linkname -VserverContext lab-svm-1000

Name                                     Type            Size      Created     Modified Owner Group   Perm Empty
----                                     ----            ----      -------     -------- ----- -----   ---- -----
linkname                                 symlink         9 B     2/24/2020    2/24/2020     0     0    755

PS H:\&amp;gt; Read-NcDirectory -VserverContext lab-svm-1000 -Path /vol/groups | ?{$_.Type -eq "symlink"}

Name                                     Type            Size      Created     Modified Owner Group   Perm Empty
----                                     ----            ----      -------     -------- ----- -----   ---- -----
linkname                                 symlink         9 B     2/24/2020    2/24/2020     0     0    755


PS H:\&amp;gt; Read-NcDirectory -VserverContext lab-svm-1000 -Path /vol/groups | ?{$_.Type -eq "symlink"} | Remove-NcFile

Delete file
Are you sure you want to delete file /vol/groups/linkname?
[Y] Yes  [A] Yes to All  [N] No  [L] No to All  [S] Suspend  [?] Help (default is "Y"): y
PS H:\&amp;gt;&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Unfortunately, I was not able to replicate your issue. Does your "Groups" volume contain a capital "G" like in your code examples? I assume so because it's referenced in that way in your "New-NcSymlink" command, but I wanted to double-check. Wouldn't be the first time I got burned by case-sensitivity. &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 05 Mar 2020 22:30:31 GMT</pubDate>
      <guid>https://community.netapp.com/t5/ONTAP-Discussions/Help-With-Removing-Stubs-That-Were-symlinks/m-p/154785#M34758</guid>
      <dc:creator>donny_lang</dc:creator>
      <dc:date>2020-03-05T22:30:31Z</dc:date>
    </item>
    <item>
      <title>Re: Help With Removing Stubs That Were symlinks</title>
      <link>https://community.netapp.com/t5/ONTAP-Discussions/Help-With-Removing-Stubs-That-Were-symlinks/m-p/154837#M34780</link>
      <description>&lt;P&gt;PS Toolkit - 9.7.1&lt;/P&gt;
&lt;P&gt;PS - 5.1&lt;/P&gt;
&lt;P&gt;ONTAP 9.6&lt;/P&gt;
&lt;P&gt;The G is uppercase in the name Groups.&lt;/P&gt;</description>
      <pubDate>Mon, 09 Mar 2020 17:51:33 GMT</pubDate>
      <guid>https://community.netapp.com/t5/ONTAP-Discussions/Help-With-Removing-Stubs-That-Were-symlinks/m-p/154837#M34780</guid>
      <dc:creator>EdS</dc:creator>
      <dc:date>2020-03-09T17:51:33Z</dc:date>
    </item>
    <item>
      <title>Re: Help With Removing Stubs That Were symlinks</title>
      <link>https://community.netapp.com/t5/ONTAP-Discussions/Help-With-Removing-Stubs-That-Were-symlinks/m-p/155085#M34869</link>
      <description>&lt;P&gt;If we also remove the corresponding CIFS share then the stub may be deleted.&lt;/P&gt;</description>
      <pubDate>Tue, 24 Mar 2020 13:49:03 GMT</pubDate>
      <guid>https://community.netapp.com/t5/ONTAP-Discussions/Help-With-Removing-Stubs-That-Were-symlinks/m-p/155085#M34869</guid>
      <dc:creator>EdS</dc:creator>
      <dc:date>2020-03-24T13:49:03Z</dc:date>
    </item>
  </channel>
</rss>

