<?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: How to Get a Empty Volume List via SQL Query or PowerShell in ONTAP Discussions</title>
    <link>https://community.netapp.com/t5/ONTAP-Discussions/How-to-Get-a-Empty-Volume-List-via-SQL-Query-or-PowerShell/m-p/115966#M24734</link>
    <description>&lt;P&gt;Thanks Guys.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Actually i m working on a workflow which can give me a list of completely empty volumes.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Used % will not give me the exact list.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am also trying to look into Read-NaDirectory where i can do LS on each volume and see if there is any content and return one which does not have any content.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;BR&lt;/P&gt;&lt;P&gt;Raj&lt;/P&gt;</description>
    <pubDate>Thu, 18 Feb 2016 14:03:09 GMT</pubDate>
    <dc:creator>raj_shrivastava11</dc:creator>
    <dc:date>2016-02-18T14:03:09Z</dc:date>
    <item>
      <title>How to Get a Empty Volume List via SQL Query or PowerShell</title>
      <link>https://community.netapp.com/t5/ONTAP-Discussions/How-to-Get-a-Empty-Volume-List-via-SQL-Query-or-PowerShell/m-p/115917#M24711</link>
      <description>&lt;P&gt;Hi Team,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Need help in Getting a Empty Volume List either via MySQL Query or PowerShell.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have checked the MySQL database side but does not get any option to get this.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Also tried via PowerShell, by getting "Used %" but that is not&amp;nbsp;correct info.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks and Regars&lt;/P&gt;&lt;P&gt;Raj&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 04 Jun 2025 22:02:08 GMT</pubDate>
      <guid>https://community.netapp.com/t5/ONTAP-Discussions/How-to-Get-a-Empty-Volume-List-via-SQL-Query-or-PowerShell/m-p/115917#M24711</guid>
      <dc:creator>raj_shrivastava11</dc:creator>
      <dc:date>2025-06-04T22:02:08Z</dc:date>
    </item>
    <item>
      <title>Re: How to Get a Empty Volume List via SQL Query or PowerShell</title>
      <link>https://community.netapp.com/t5/ONTAP-Discussions/How-to-Get-a-Empty-Volume-List-via-SQL-Query-or-PowerShell/m-p/115926#M24715</link>
      <description>&lt;P&gt;Anything can be done in powershell. &amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The issue is that there is truly no ZERO volume b/c when you create a volume there is a small amount of data on the volume.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;You can query for all volumes with size less than x and then go from there.&lt;/P&gt;</description>
      <pubDate>Wed, 17 Feb 2016 21:00:32 GMT</pubDate>
      <guid>https://community.netapp.com/t5/ONTAP-Discussions/How-to-Get-a-Empty-Volume-List-via-SQL-Query-or-PowerShell/m-p/115926#M24715</guid>
      <dc:creator>JGPSHNTAP</dc:creator>
      <dc:date>2016-02-17T21:00:32Z</dc:date>
    </item>
    <item>
      <title>Re: How to Get a Empty Volume List via SQL Query or PowerShell</title>
      <link>https://community.netapp.com/t5/ONTAP-Discussions/How-to-Get-a-Empty-Volume-List-via-SQL-Query-or-PowerShell/m-p/115936#M24716</link>
      <description>&lt;P&gt;What was incorrect about used %? &amp;nbsp;Aside from it's not very accurate (1% of 1GB = 10MB, 1% of 1TB = 10GB...that's a big difference).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;As&amp;nbsp;&lt;a href="https://community.netapp.com/t5/user/viewprofilepage/user-id/11560"&gt;@JGPSHNTAP﻿&lt;/a&gt;&amp;nbsp;mentioned, it's difficult to find a truly empty volume because the system has a few KB for metadata, etc. &amp;nbsp;I think the closest thing would be to look for a volume with used space of less than 512KB:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;Get-NcVol -Query @{VolumeSpaceAttributes=@{SizeUsed='&amp;lt;512KB'};VolumeStateAttributes=@{IsNodeRoot=$false;IsVserverRoot=$false}}&lt;/PRE&gt;&lt;P&gt;That should narrow the returned volumes back significantly. &amp;nbsp;Theoretically it might still be possible to have a volume with something in it, for example and thin provisioned LUN which hasn't had any data written to it, or a share/export which has empty files/folders. &amp;nbsp;If you want to be 100% safe, you'll want to mount the volume (NFS/CIFS) and check the contents.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Hope that helps.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Andrew&lt;/P&gt;</description>
      <pubDate>Thu, 18 Feb 2016 01:55:40 GMT</pubDate>
      <guid>https://community.netapp.com/t5/ONTAP-Discussions/How-to-Get-a-Empty-Volume-List-via-SQL-Query-or-PowerShell/m-p/115936#M24716</guid>
      <dc:creator>asulliva</dc:creator>
      <dc:date>2016-02-18T01:55:40Z</dc:date>
    </item>
    <item>
      <title>Re: How to Get a Empty Volume List via SQL Query or PowerShell</title>
      <link>https://community.netapp.com/t5/ONTAP-Discussions/How-to-Get-a-Empty-Volume-List-via-SQL-Query-or-PowerShell/m-p/115937#M24717</link>
      <description>&lt;P&gt;I assume from his tag, this is for 7-mode so it's easier..&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;get-navol | ? {$_.sizeused &amp;lt; xxxx}&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 18 Feb 2016 01:58:11 GMT</pubDate>
      <guid>https://community.netapp.com/t5/ONTAP-Discussions/How-to-Get-a-Empty-Volume-List-via-SQL-Query-or-PowerShell/m-p/115937#M24717</guid>
      <dc:creator>JGPSHNTAP</dc:creator>
      <dc:date>2016-02-18T01:58:11Z</dc:date>
    </item>
    <item>
      <title>Re: How to Get a Empty Volume List via SQL Query or PowerShell</title>
      <link>https://community.netapp.com/t5/ONTAP-Discussions/How-to-Get-a-Empty-Volume-List-via-SQL-Query-or-PowerShell/m-p/115938#M24718</link>
      <description>&lt;P&gt;Hi Raj,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;What are you ultimately trying to achieve or automate once you have this information?&lt;/P&gt;&lt;P&gt;As you've mentioned MySQL as an option are you using WFA as the source for your query?&lt;/P&gt;&lt;P&gt;If so you could use something like:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;For 7-Mode:&lt;BR /&gt;&lt;BR /&gt;#'---------------------------------------&lt;BR /&gt;#'Select the empty data volumes.&lt;BR /&gt;#'---------------------------------------&lt;BR /&gt;SELECT&lt;BR /&gt;&amp;nbsp;&amp;nbsp; volume.name AS 'volume_name',&lt;BR /&gt;&amp;nbsp;&amp;nbsp; aggregate.name AS 'aggregate_name',&lt;BR /&gt;&amp;nbsp;&amp;nbsp; vfiler.name AS 'vfiler_name',&lt;BR /&gt;&amp;nbsp;&amp;nbsp; array.name AS 'controller_name',&lt;BR /&gt;&amp;nbsp;&amp;nbsp; array.ip AS 'controller_address'&lt;BR /&gt;FROM&lt;BR /&gt;&amp;nbsp;&amp;nbsp; storage.volume,&lt;BR /&gt;&amp;nbsp;&amp;nbsp; storage.aggregate,&lt;BR /&gt;&amp;nbsp;&amp;nbsp; storage.vfiler,&lt;BR /&gt;&amp;nbsp;&amp;nbsp; storage.array&lt;BR /&gt;WHERE&lt;BR /&gt;&amp;nbsp;&amp;nbsp; volume.vfiler_id = vfiler.id&lt;BR /&gt;AND&lt;BR /&gt;&amp;nbsp;&amp;nbsp; vfiler.array_id = array.id&lt;BR /&gt;AND&lt;BR /&gt;&amp;nbsp;&amp;nbsp; volume.aggregate_id = aggregate.id&lt;BR /&gt;AND&lt;BR /&gt;&amp;nbsp;&amp;nbsp; volume.used_size_mb = 0;&lt;BR /&gt;#'---------------------------------------&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;For cDOT&lt;BR /&gt;&lt;BR /&gt;#'---------------------------------------&lt;BR /&gt;#'Select the empty data volumes.&lt;BR /&gt;#'---------------------------------------&lt;BR /&gt;SELECT&lt;BR /&gt;&amp;nbsp;&amp;nbsp; volume.name AS 'volume_name',&lt;BR /&gt;&amp;nbsp;&amp;nbsp; aggregate.name AS 'aggregate_name',&lt;BR /&gt;&amp;nbsp;&amp;nbsp; vserver.name AS 'vserver_name',&lt;BR /&gt;&amp;nbsp;&amp;nbsp; node.name AS 'node_name',&lt;BR /&gt;&amp;nbsp;&amp;nbsp; cluster.name AS 'cluster_name',&lt;BR /&gt;&amp;nbsp;&amp;nbsp; cluster.primary_address&lt;BR /&gt;FROM&lt;BR /&gt;&amp;nbsp;&amp;nbsp; cm_storage.volume,&lt;BR /&gt;&amp;nbsp;&amp;nbsp; cm_storage.aggregate,&lt;BR /&gt;&amp;nbsp;&amp;nbsp; cm_storage.vserver,&lt;BR /&gt;&amp;nbsp;&amp;nbsp; cm_storage.node,&lt;BR /&gt;&amp;nbsp;&amp;nbsp; cm_storage.cluster&lt;BR /&gt;WHERE&lt;BR /&gt;&amp;nbsp;&amp;nbsp; volume.vserver_id = vserver.id&lt;BR /&gt;AND&lt;BR /&gt;&amp;nbsp;&amp;nbsp; vserver.cluster_id = cluster.id&lt;BR /&gt;AND&lt;BR /&gt;&amp;nbsp;&amp;nbsp; volume.aggregate_id = aggregate.id&lt;BR /&gt;AND&lt;BR /&gt;&amp;nbsp;&amp;nbsp; aggregate.node_id = node.id&lt;BR /&gt;AND&lt;BR /&gt;&amp;nbsp;&amp;nbsp; volume.junction_path &amp;lt;&amp;gt; '/'&lt;BR /&gt;AND&lt;BR /&gt;&amp;nbsp;&amp;nbsp; volume.used_size_mb = 0;&lt;BR /&gt;#'---------------------------------------&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;Note: or change 'volume.used_size_mb &amp;lt;= {$VolumeSizeMB}' assuming you want to enumerate volumes of a small (but not totally empty) size.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;/matt&lt;/P&gt;</description>
      <pubDate>Thu, 18 Feb 2016 03:29:29 GMT</pubDate>
      <guid>https://community.netapp.com/t5/ONTAP-Discussions/How-to-Get-a-Empty-Volume-List-via-SQL-Query-or-PowerShell/m-p/115938#M24718</guid>
      <dc:creator>mbeattie</dc:creator>
      <dc:date>2016-02-18T03:29:29Z</dc:date>
    </item>
    <item>
      <title>Re: How to Get a Empty Volume List via SQL Query or PowerShell</title>
      <link>https://community.netapp.com/t5/ONTAP-Discussions/How-to-Get-a-Empty-Volume-List-via-SQL-Query-or-PowerShell/m-p/115966#M24734</link>
      <description>&lt;P&gt;Thanks Guys.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Actually i m working on a workflow which can give me a list of completely empty volumes.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Used % will not give me the exact list.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am also trying to look into Read-NaDirectory where i can do LS on each volume and see if there is any content and return one which does not have any content.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;BR&lt;/P&gt;&lt;P&gt;Raj&lt;/P&gt;</description>
      <pubDate>Thu, 18 Feb 2016 14:03:09 GMT</pubDate>
      <guid>https://community.netapp.com/t5/ONTAP-Discussions/How-to-Get-a-Empty-Volume-List-via-SQL-Query-or-PowerShell/m-p/115966#M24734</guid>
      <dc:creator>raj_shrivastava11</dc:creator>
      <dc:date>2016-02-18T14:03:09Z</dc:date>
    </item>
  </channel>
</rss>

