<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://blogs.technet.com/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Guillaume Bordier's blog : XDIR long directories folder size</title><link>http://blogs.technet.com/gbordier/archive/tags/XDIR+long+directories+folder+size/default.aspx</link><description>Tags: XDIR long directories folder size</description><dc:language>en-US</dc:language><generator>CommunityServer 2.1 SP1 (Build: 61025.2)</generator><item><title>Where did my disk space go ? [very long directory names, system directories, symbolink and other hard links ...], meet xdir.exe</title><link>http://blogs.technet.com/gbordier/archive/2009/02/03/where-did-my-disk-space-go-very-long-directory-names-system-directories-symbolink-and-other-hard-links-meet-xdir-exe.aspx</link><pubDate>Tue, 03 Feb 2009 23:00:00 GMT</pubDate><guid isPermaLink="false">d5e57398-b9ef-4490-9955-07cbb4e4a80d:3196563</guid><dc:creator>gbordier</dc:creator><slash:comments>1</slash:comments><comments>http://blogs.technet.com/gbordier/comments/3196563.aspx</comments><wfw:commentRss>http://blogs.technet.com/gbordier/commentrss.aspx?PostID=3196563</wfw:commentRss><description>&lt;UL&gt;
&lt;P mce_keep="true"&gt;&lt;STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;[EDIT : posted a statically linked version to remove dependency over VCRT 9.0]&lt;/STRONG&gt;&lt;/P&gt;&lt;/STRONG&gt;
&lt;P mce_keep="true"&gt;Hi geeks, &lt;/P&gt;&lt;/UL&gt;
&lt;P&gt;The first thing I do when I receive a new Microsoft-issued laptop is : buy the largest hard disk I can find to replace the one that shipped with it.&lt;/P&gt;
&lt;P&gt;But time goes ... and soon I wonder where all that disk space went.&lt;/P&gt;
&lt;P&gt;The other day one of my customers called me with that stance : "Guillaume, I've got a LUN on my SAN with 350GB I cannot account for".&lt;/P&gt;
&lt;P&gt;Where can there be content that is hidden from the system administrator himself ? &lt;/P&gt;
&lt;OL&gt;
&lt;LI&gt;&lt;STRONG&gt;System Volume Information&lt;/STRONG&gt; is a folder with SYSTEM only&amp;nbsp; permissions (so administrators do not have access) that can contains many things from Single Instance storage data, recovery points, snapshots ... &lt;/LI&gt;
&lt;LI&gt;very long (&amp;gt; 256 chars) directories are not displayed by either explorer&amp;nbsp; or the command line because one needs to use the Unicode syntax when accessing those and for some reason our developpers did not. &lt;/LI&gt;&lt;/OL&gt;
&lt;P&gt;To make the story short my customer had VSS shadow storage defined on that LUN for snapshot of a different LUN, so using vssadmin delete shadows or vssadmin delete shadowstorage got his content back.&lt;/P&gt;
&lt;P&gt;But this incident convinced me to launch my could old C++ compiler to build a tool that deals with those kind of nightmares: meet XDIR.EXE&lt;/P&gt;
&lt;P&gt;XDIR is a combination of DIRUSE.EXE (the close parent of DU from Windows 2000 resource kit), RD (remove directory from the nt shell), and dir.&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;BUT &lt;/STRONG&gt;XDIR.EXE handles directories of any length, or permissions , it does try to follow symbolink links and you can use it to:&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;reclaim disk space : calculate the size of that particular directory and any subdirectory : &lt;BR&gt;try &lt;STRONG&gt;&lt;FONT color=#ff0000&gt;XDIR c:\&lt;/FONT&gt;&lt;/STRONG&gt; &lt;/LI&gt;
&lt;LI&gt;read a very long (or any) directory : &lt;BR&gt;try &lt;FONT color=#ff0000&gt;&lt;STRONG&gt;XDIR &amp;lt;your long directory&amp;gt; /DIR&lt;/STRONG&gt;&lt;/FONT&gt; &lt;/LI&gt;
&lt;LI&gt;delete a very long directory : &lt;BR&gt;try &lt;STRONG&gt;&lt;FONT color=#ff0000&gt;XDIR &amp;lt;your long directory&amp;gt; /RMDIR&lt;/FONT&gt;&lt;/STRONG&gt; &lt;/LI&gt;&lt;/UL&gt;
&lt;P&gt;Options are :&lt;/P&gt;
&lt;TABLE class="" cellSpacing=0 cellPadding=2 width=593 border=1&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TD class="" vAlign=top width=158&gt;/MIN:xxx[GB|MB|KB|B]&lt;/TD&gt;
&lt;TD class="" vAlign=top width=433&gt;Minimum size to report (default is 500 MB)&lt;/TD&gt;&lt;/TR&gt;
&lt;TR&gt;
&lt;TD class="" vAlign=top width=158&gt;/LEV:nn&lt;/TD&gt;
&lt;TD class="" vAlign=top width=433&gt;Number of directory levels to display, default is 2, 0 will display all directories&lt;/TD&gt;&lt;/TR&gt;
&lt;TR&gt;
&lt;TD class="" vAlign=top width=158&gt;/FORCE&lt;/TD&gt;
&lt;TD class="" vAlign=top width=433&gt;known to the user of &lt;A href="http://www.gbordier.com/gbtools/fileacl.asp" mce_href="http://www.gbordier.com/gbtools/fileacl.asp"&gt;FILEACL&lt;/A&gt;, this will let you use your&amp;nbsp; SeBackupPrivilege and&amp;nbsp; SeRestorePrivilege to bypass the NTDS permissions (you need to be backup operator obviously)&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;
&lt;P&gt;There are also a few other options that let you create an ANSI or UNICODE output file that came directly from FILEACL.&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Let’s try this: where is there content that weight more than 500MB on my C drive ?&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;A href="http://blogs.technet.com/blogfiles/gbordier/WindowsLiveWriter/Wheredidmydiskspacegoverylongdirecto.exe_870C/image_2.png" mce_href="http://blogs.technet.com/blogfiles/gbordier/WindowsLiveWriter/Wheredidmydiskspacegoverylongdirecto.exe_870C/image_2.png"&gt;&lt;IMG title=image style="BORDER-TOP-WIDTH: 0px; DISPLAY: inline; BORDER-LEFT-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; BORDER-RIGHT-WIDTH: 0px" height=217 alt=image src="http://blogs.technet.com/blogfiles/gbordier/WindowsLiveWriter/Wheredidmydiskspacegoverylongdirecto.exe_870C/image_thumb.png" width=644 border=0 mce_src="http://blogs.technet.com/blogfiles/gbordier/WindowsLiveWriter/Wheredidmydiskspacegoverylongdirecto.exe_870C/image_thumb.png"&gt;&lt;/A&gt; &lt;/P&gt;
&lt;P&gt;What are those 2 GB in my System Volume Information ? &lt;/P&gt;
&lt;P&gt;&lt;A href="http://blogs.technet.com/blogfiles/gbordier/WindowsLiveWriter/Wheredidmydiskspacegoverylongdirecto.exe_870C/image_4.png" mce_href="http://blogs.technet.com/blogfiles/gbordier/WindowsLiveWriter/Wheredidmydiskspacegoverylongdirecto.exe_870C/image_4.png"&gt;&lt;IMG title=image style="BORDER-TOP-WIDTH: 0px; DISPLAY: inline; BORDER-LEFT-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; BORDER-RIGHT-WIDTH: 0px" height=90 alt=image src="http://blogs.technet.com/blogfiles/gbordier/WindowsLiveWriter/Wheredidmydiskspacegoverylongdirecto.exe_870C/image_thumb_1.png" width=644 border=0 mce_src="http://blogs.technet.com/blogfiles/gbordier/WindowsLiveWriter/Wheredidmydiskspacegoverylongdirecto.exe_870C/image_thumb_1.png"&gt;&lt;/A&gt; &lt;/P&gt;
&lt;P&gt;Well, that seems like a bunch of restore points to me. Wait, I’m running Windows Server 2008 and restore points are not a server feature ! Where are those kids from ? ohh, maybe from my old Windows XP dual boot ! &lt;/P&gt;
&lt;P&gt;Let’s see&lt;/P&gt;
&lt;P&gt;&lt;A href="http://blogs.technet.com/blogfiles/gbordier/WindowsLiveWriter/Wheredidmydiskspacegoverylongdirecto.exe_870C/image_6.png" mce_href="http://blogs.technet.com/blogfiles/gbordier/WindowsLiveWriter/Wheredidmydiskspacegoverylongdirecto.exe_870C/image_6.png"&gt;&lt;IMG title=image style="BORDER-TOP-WIDTH: 0px; DISPLAY: inline; BORDER-LEFT-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; BORDER-RIGHT-WIDTH: 0px" height=165 alt=image src="http://blogs.technet.com/blogfiles/gbordier/WindowsLiveWriter/Wheredidmydiskspacegoverylongdirecto.exe_870C/image_thumb_2.png" width=644 border=0 mce_src="http://blogs.technet.com/blogfiles/gbordier/WindowsLiveWriter/Wheredidmydiskspacegoverylongdirecto.exe_870C/image_thumb_2.png"&gt;&lt;/A&gt; &lt;/P&gt;
&lt;P&gt;Files from last november? sounds like it’s the last time I booted my XP boot to flash my Windows Mobile, ok, let’s get rid of those (I’ll use the supported method of rebooting to XP and ask nicely that it delete those useless recovery points)&lt;/P&gt;
&lt;P&gt;let’s use another example:&lt;/P&gt;
&lt;P&gt;See that dir ? &lt;/P&gt;
&lt;P&gt;&lt;A href="http://blogs.technet.com/blogfiles/gbordier/WindowsLiveWriter/Wheredidmydiskspacegoverylongdirecto.exe_870C/image_8.png" mce_href="http://blogs.technet.com/blogfiles/gbordier/WindowsLiveWriter/Wheredidmydiskspacegoverylongdirecto.exe_870C/image_8.png"&gt;&lt;IMG title=image style="BORDER-TOP-WIDTH: 0px; DISPLAY: block; BORDER-LEFT-WIDTH: 0px; FLOAT: none; BORDER-BOTTOM-WIDTH: 0px; MARGIN-LEFT: auto; MARGIN-RIGHT: auto; BORDER-RIGHT-WIDTH: 0px" height=210 alt=image src="http://blogs.technet.com/blogfiles/gbordier/WindowsLiveWriter/Wheredidmydiskspacegoverylongdirecto.exe_870C/image_thumb_3.png" width=401 border=0 mce_src="http://blogs.technet.com/blogfiles/gbordier/WindowsLiveWriter/Wheredidmydiskspacegoverylongdirecto.exe_870C/image_thumb_3.png"&gt;&lt;/A&gt;&lt;A href="http://blogs.technet.com/blogfiles/gbordier/WindowsLiveWriter/Wheredidmydiskspacegoverylongdirecto.exe_870C/image_10.png" mce_href="http://blogs.technet.com/blogfiles/gbordier/WindowsLiveWriter/Wheredidmydiskspacegoverylongdirecto.exe_870C/image_10.png"&gt;&lt;IMG title=image style="BORDER-TOP-WIDTH: 0px; DISPLAY: block; BORDER-LEFT-WIDTH: 0px; FLOAT: none; BORDER-BOTTOM-WIDTH: 0px; MARGIN-LEFT: auto; MARGIN-RIGHT: auto; BORDER-RIGHT-WIDTH: 0px" height=285 alt=image src="http://blogs.technet.com/blogfiles/gbordier/WindowsLiveWriter/Wheredidmydiskspacegoverylongdirecto.exe_870C/image_thumb_4.png" width=404 border=0 mce_src="http://blogs.technet.com/blogfiles/gbordier/WindowsLiveWriter/Wheredidmydiskspacegoverylongdirecto.exe_870C/image_thumb_4.png"&gt;&lt;/A&gt;&amp;nbsp; &lt;/P&gt;
&lt;P&gt;Empty folder, big deal ? &lt;/P&gt;
&lt;P&gt;&lt;A href="http://blogs.technet.com/blogfiles/gbordier/WindowsLiveWriter/Wheredidmydiskspacegoverylongdirecto.exe_870C/image_12.png" mce_href="http://blogs.technet.com/blogfiles/gbordier/WindowsLiveWriter/Wheredidmydiskspacegoverylongdirecto.exe_870C/image_12.png"&gt;&lt;IMG title=image style="BORDER-TOP-WIDTH: 0px; DISPLAY: inline; BORDER-LEFT-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; BORDER-RIGHT-WIDTH: 0px" height=47 alt=image src="http://blogs.technet.com/blogfiles/gbordier/WindowsLiveWriter/Wheredidmydiskspacegoverylongdirecto.exe_870C/image_thumb_5.png" width=644 border=0 mce_src="http://blogs.technet.com/blogfiles/gbordier/WindowsLiveWriter/Wheredidmydiskspacegoverylongdirecto.exe_870C/image_thumb_5.png"&gt;&lt;/A&gt; &lt;/P&gt;
&lt;P mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;why the heck, does xdir.exe think there is 1.167 GB in that dir ? &lt;/P&gt;
&lt;P&gt;&lt;A href="http://blogs.technet.com/blogfiles/gbordier/WindowsLiveWriter/Wheredidmydiskspacegoverylongdirecto.exe_870C/image_14.png" mce_href="http://blogs.technet.com/blogfiles/gbordier/WindowsLiveWriter/Wheredidmydiskspacegoverylongdirecto.exe_870C/image_14.png"&gt;&lt;IMG title=image style="BORDER-TOP-WIDTH: 0px; DISPLAY: inline; BORDER-LEFT-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; BORDER-RIGHT-WIDTH: 0px" height=127 alt=image src="http://blogs.technet.com/blogfiles/gbordier/WindowsLiveWriter/Wheredidmydiskspacegoverylongdirecto.exe_870C/image_thumb_6.png" width=644 border=0 mce_src="http://blogs.technet.com/blogfiles/gbordier/WindowsLiveWriter/Wheredidmydiskspacegoverylongdirecto.exe_870C/image_thumb_6.png"&gt;&lt;/A&gt; &lt;/P&gt;
&lt;P&gt;Well somebody twisted (me) has put 1 Gig into this stupidly long directory.&lt;/P&gt;
&lt;TABLE class="" cellSpacing=0 cellPadding=2 width=662 border=1&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TD class="" vAlign=top width=660&gt;
&lt;P&gt;&lt;FONT face="Courier New" color=#800000 size=2&gt;&lt;EM&gt;Side Note : it is just impossible to go there with explorer so what can I do ? :&lt;/EM&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;
&lt;DIV align=left&gt;&lt;FONT face="Courier New" color=#800000 size=2&gt;&lt;EM&gt;Create a JUNCTION point &lt;BR&gt;mklink&amp;nbsp; /J e:\temp\mount "e:\temp\01234567890123456789012345678901234567890123456789\01234567890123456789012345678901234567890123456789\01234567890123456789……&lt;/EM&gt;&lt;/FONT&gt;&lt;/DIV&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;FONT face="Courier New" color=#800000 size=2&gt;&lt;EM&gt;Create a DIRECTORY SYMBOLIC LINK &lt;BR&gt;mklink&amp;nbsp; /D e:\temp\mount "e:\temp\01234567890123456789012345678901234567890123456789\01234567890123456789012345678901234567890123456789\01234567890123456789…… &lt;/EM&gt;&lt;/FONT&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;FONT face="Courier New" color=#800000 size=2&gt;&lt;EM&gt;use the good old SUBST from DOS :) &lt;/EM&gt;&lt;/FONT&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;
&lt;P&gt;if you just want to get rid of it use :&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;&lt;FONT color=#ff0000&gt;XDIR &amp;lt;your long directory&amp;gt; /RMDIR&lt;/FONT&gt;&lt;/STRONG&gt; &lt;/P&gt;
&lt;P&gt;like this:&lt;/P&gt;
&lt;P&gt;&lt;A href="http://blogs.technet.com/blogfiles/gbordier/WindowsLiveWriter/Wheredidmydiskspacegoverylongdirecto.exe_870C/image_16.png" mce_href="http://blogs.technet.com/blogfiles/gbordier/WindowsLiveWriter/Wheredidmydiskspacegoverylongdirecto.exe_870C/image_16.png"&gt;&lt;IMG title=image style="BORDER-RIGHT: 0px; BORDER-TOP: 0px; DISPLAY: inline; BORDER-LEFT: 0px; BORDER-BOTTOM: 0px" height=47 alt=image src="http://blogs.technet.com/blogfiles/gbordier/WindowsLiveWriter/Wheredidmydiskspacegoverylongdirecto.exe_870C/image_thumb_7.png" width=687 border=0 mce_src="http://blogs.technet.com/blogfiles/gbordier/WindowsLiveWriter/Wheredidmydiskspacegoverylongdirecto.exe_870C/image_thumb_7.png"&gt;&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;add the /FORCE option if you do not have the rights on all folders (like with System Volume Information)&lt;/P&gt;
&lt;P&gt;Guillaume&lt;/P&gt;&lt;img src="http://blogs.technet.com/aggbug.aspx?PostID=3196563" width="1" height="1"&gt;</description><enclosure url="http://blogs.technet.com/gbordier/attachment/3196563.ashx" length="120832" type="application/octet-stream" /><category domain="http://blogs.technet.com/gbordier/archive/tags/XDIR+long+directories+folder+size/default.aspx">XDIR long directories folder size</category></item></channel></rss>