<?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 reduce directory size ? in Operating System - OpenVMS</title>
    <link>https://community.hpe.com/t5/operating-system-openvms/how-to-reduce-directory-size/m-p/3121890#M61348</link>
    <description>What I've learned (by study and experience - see an earlier thread) is that directory requires contiguous space.&lt;BR /&gt;I deduct from observations that the file system (XQP, to be exact) will locate new files based on a kind of hashing mechanism (correct me if I'm wrong). This _might_ mean that when a calculated slot within the directory-file is already occupied, it's very well possible that the new slot will be at the end of the directroy file - expanding it into the next cluster if needed. &lt;BR /&gt;For that reason, I doubt that limiting a directory's size is actullay useful, except you do not create any more files within it.&lt;BR /&gt;&lt;BR /&gt;If you are so short of room on a disk, you definitely will run into trouble. Suppose you create a new file, and it will be placed at the end of the directory, it's possible the directory needs to be expanded into the next cluster. If no room is available at the curent disk-location, the file will have to be moved to a place on that disk that holds the whole allocated size as contiguous space. If that fails, you'll end up in an error. Or, expansion of the directory succeeds but there is too little room for the file to be allocated.&lt;BR /&gt;</description>
    <pubDate>Tue, 18 Nov 2003 06:49:16 GMT</pubDate>
    <dc:creator>Willem Grooters</dc:creator>
    <dc:date>2003-11-18T06:49:16Z</dc:date>
    <item>
      <title>how to reduce directory size ?</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/how-to-reduce-directory-size/m-p/3121888#M61346</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;I want to reduce directoy size . I do NOT want to use backup/restore option. Here is an illustration for my problem:&lt;BR /&gt;&lt;BR /&gt;1. I creat a directory testlj.dir whose initial size 1/4 (actual : 1 block, allocation: 4 blocks)&lt;BR /&gt;******************************************&lt;BR /&gt;DCCDT2&amp;gt; set def dsa2:[000000]&lt;BR /&gt;DCCDT2&amp;gt; creat/dir [testlj]&lt;BR /&gt;DCCDT2&amp;gt; dir/size=all testlj.dir&lt;BR /&gt;&lt;BR /&gt;Directory DSA2:[000000]&lt;BR /&gt;&lt;BR /&gt;TESTLJ.DIR;1               1/4&lt;BR /&gt;&lt;BR /&gt;Total of 1 file, 1/4 blocks.&lt;BR /&gt;*****************************************&lt;BR /&gt;&lt;BR /&gt;2. Now I increase the the directory size by running the following command procedure. &lt;BR /&gt;&lt;BR /&gt;DCCDT2&amp;gt; set def [testlj]&lt;BR /&gt;DCCDT2&amp;gt; creat file.com&lt;BR /&gt;$loop:&lt;BR /&gt;$creat a.b&lt;BR /&gt;$creat b.c&lt;BR /&gt;$crea e.f&lt;BR /&gt;$creat c.d&lt;BR /&gt;$goto loop&lt;BR /&gt;$exit&lt;BR /&gt; Exit&lt;BR /&gt;DCCDT2&amp;gt; set noverify&lt;BR /&gt;DCCDT2&amp;gt; @file&lt;BR /&gt; Interrupt&lt;BR /&gt;&lt;BR /&gt;DCCDT2&amp;gt; stop&lt;BR /&gt;DCCDT2&amp;gt; dir/size=all [-]testlj.dir&lt;BR /&gt;&lt;BR /&gt;Directory DSA2:[000000]&lt;BR /&gt;&lt;BR /&gt;TESTLJ.DIR;1               5/8&lt;BR /&gt;&lt;BR /&gt;Total of 1 file, 5/8 blocks.&lt;BR /&gt;DCCDT2&amp;gt; dir&lt;BR /&gt;&lt;BR /&gt;Directory DSA2:[TESTLJ]&lt;BR /&gt;&lt;BR /&gt;A.B;49              B.C;49              C.D;48              E.F;49&lt;BR /&gt;FILE.COM;1&lt;BR /&gt;&lt;BR /&gt;Total of 5 files.&lt;BR /&gt;DCCDT2&amp;gt; @file&lt;BR /&gt; Interrupt&lt;BR /&gt;&lt;BR /&gt;DCCDT2&amp;gt; stop&lt;BR /&gt;DCCDT2&amp;gt; dir/size=all [-]testlj.dir&lt;BR /&gt;&lt;BR /&gt;Directory DSA2:[000000]&lt;BR /&gt;&lt;BR /&gt;TESTLJ.DIR;1               9/12&lt;BR /&gt;&lt;BR /&gt;Total of 1 file, 9/12 blocks.&lt;BR /&gt;DCCDT2&amp;gt; purge&lt;BR /&gt;DCCDT2&amp;gt; dir/size=all [-]testlj.dir&lt;BR /&gt;&lt;BR /&gt;Directory DSA2:[000000]&lt;BR /&gt;&lt;BR /&gt;TESTLJ.DIR;1               5/12&lt;BR /&gt;&lt;BR /&gt;Total of 1 file, 5/12 blocks.&lt;BR /&gt;DCCDT2&amp;gt;&lt;BR /&gt;**************************************&lt;BR /&gt;&lt;BR /&gt;In the above example, now the directory size is :- 5 blocks actual &amp;amp; 12 blocks allocation size. &lt;BR /&gt;&lt;BR /&gt;I want to reduce this allocation size back to 8 block ( cluster factor is 4 blocks)&lt;BR /&gt;&lt;BR /&gt;Thanks &amp;amp; regards,&lt;BR /&gt;Lokesh</description>
      <pubDate>Tue, 18 Nov 2003 05:19:58 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/how-to-reduce-directory-size/m-p/3121888#M61346</guid>
      <dc:creator>Lokesh_2</dc:creator>
      <dc:date>2003-11-18T05:19:58Z</dc:date>
    </item>
    <item>
      <title>Re: how to reduce directory size ?</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/how-to-reduce-directory-size/m-p/3121889#M61347</link>
      <description>Hi Lokesh,&lt;BR /&gt;&lt;BR /&gt;One way to accomplish this is to issue the following command (using your example above):&lt;BR /&gt;&lt;BR /&gt;set file/truncate DSA2:[000000]TESTLJ.DIR&lt;BR /&gt;&lt;BR /&gt;This should reduce file allocation size back to 8 blocks.&lt;BR /&gt;&lt;BR /&gt;--Brad</description>
      <pubDate>Tue, 18 Nov 2003 05:48:12 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/how-to-reduce-directory-size/m-p/3121889#M61347</guid>
      <dc:creator>Bradford Hamilton_1</dc:creator>
      <dc:date>2003-11-18T05:48:12Z</dc:date>
    </item>
    <item>
      <title>Re: how to reduce directory size ?</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/how-to-reduce-directory-size/m-p/3121890#M61348</link>
      <description>What I've learned (by study and experience - see an earlier thread) is that directory requires contiguous space.&lt;BR /&gt;I deduct from observations that the file system (XQP, to be exact) will locate new files based on a kind of hashing mechanism (correct me if I'm wrong). This _might_ mean that when a calculated slot within the directory-file is already occupied, it's very well possible that the new slot will be at the end of the directroy file - expanding it into the next cluster if needed. &lt;BR /&gt;For that reason, I doubt that limiting a directory's size is actullay useful, except you do not create any more files within it.&lt;BR /&gt;&lt;BR /&gt;If you are so short of room on a disk, you definitely will run into trouble. Suppose you create a new file, and it will be placed at the end of the directory, it's possible the directory needs to be expanded into the next cluster. If no room is available at the curent disk-location, the file will have to be moved to a place on that disk that holds the whole allocated size as contiguous space. If that fails, you'll end up in an error. Or, expansion of the directory succeeds but there is too little room for the file to be allocated.&lt;BR /&gt;</description>
      <pubDate>Tue, 18 Nov 2003 06:49:16 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/how-to-reduce-directory-size/m-p/3121890#M61348</guid>
      <dc:creator>Willem Grooters</dc:creator>
      <dc:date>2003-11-18T06:49:16Z</dc:date>
    </item>
    <item>
      <title>Re: how to reduce directory size ?</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/how-to-reduce-directory-size/m-p/3121891#M61349</link>
      <description>See also DFU DIRECTORY COMPRESS command. The DFU program is available on VMS freeware CD and also at &lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://h71000.www7.hp.com/freeware/freeware50/dfu027a/" target="_blank"&gt;http://h71000.www7.hp.com/freeware/freeware50/dfu027a/&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;(NB DFU V3.0s due out RSN)&lt;BR /&gt;&lt;BR /&gt;Note that directories should be kept below 127 blocks in size as there is a severe performance degradation above this size.</description>
      <pubDate>Tue, 18 Nov 2003 08:54:29 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/how-to-reduce-directory-size/m-p/3121891#M61349</guid>
      <dc:creator>Ian Miller.</dc:creator>
      <dc:date>2003-11-18T08:54:29Z</dc:date>
    </item>
    <item>
      <title>Re: how to reduce directory size ?</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/how-to-reduce-directory-size/m-p/3121892#M61350</link>
      <description>Lokesh&amp;gt;  want to reduce directoy size . &lt;BR /&gt;&lt;BR /&gt;Why? Nothing better to do? What is the real problem you are trying to solve? What is the magnitude of the real directory (over) allocation you are addressing? You do knwo XQP/RMS will use the pre-allocated space for quicker future additions right? So shrinking is good for read-only directories, but the price to get is wrong is high!&lt;BR /&gt;&lt;BR /&gt;Lokesh&amp;gt; I do NOT want to use backup/restore option. &lt;BR /&gt;&lt;BR /&gt;Right. You don't want to because it is very wastefull, and potentially slow.&lt;BR /&gt;The VMS native sollution for this is RENAME.&lt;BR /&gt;This will NOT move the DATA, it WILL not create new files, it will just shuffle directory entries and tightly pack them as you go.&lt;BR /&gt;&lt;BR /&gt;$CRE/DIR [.NEW]&lt;BR /&gt;$SET PROT NEW.DIR, DATA.DIR   ! Allow delete access&lt;BR /&gt;$RENAME [.DATA]*.*;* [.NEW]&lt;BR /&gt;$RENAME DATA.DIR OLD.DIR  ! Or delete&lt;BR /&gt;$RENAME NEW.DIR DATA.DIR&lt;BR /&gt;&lt;BR /&gt;Lokesh&amp;gt; I increase the the directory size by running the following command&lt;BR /&gt;Lokesh&amp;gt; Loop: create a.b...&lt;BR /&gt;&lt;BR /&gt;Creating mutliple versions of the same file is actually the most efficient, least space occupying method to store a file. It just adds a files-id and a little overhead to an array, based of the same name.&lt;BR /&gt;Next time, if you really want to explode a directory in a hurry make a loop with fresh, &lt;BR /&gt;It if you like creating work for the system, create them in  reverse or random order.&lt;BR /&gt;long, filenames:&lt;BR /&gt;$loop:&lt;BR /&gt;$x = x=f$cvtime("",,"hundredth") + f$cvtime("",,"second")&lt;BR /&gt;$create 'x-get-creative-here.and-here&lt;BR /&gt;$if not-done then goto loop&lt;BR /&gt;&lt;BR /&gt;Lokesh&amp;gt; &lt;BR /&gt;&lt;BR /&gt;bradford&amp;gt; set file/truncate DSA2:[000000]TESTLJ.DIR&lt;BR /&gt;&lt;BR /&gt;NO, IMHO it is NOT a good idea to truncate Directory files.&lt;BR /&gt;Use DFU, as Ian points out. Its great. best thing since sliced bread and all. Check out it's other functions (fragmentation report, quick file searched). It will soon ship with VMS.&lt;BR /&gt;&lt;BR /&gt;Willem&amp;gt; _might_ mean that when a calculated slot within the directory-file is already occupied, it's very well possible that the new slot will be at the end of the directroy file &lt;BR /&gt;&lt;BR /&gt;Close, but no cigar. Directory records are in strict sequential order. Use DUMP/RECO or DUMP/DIRECTORY to visualize. There is NO hashing on disk, but the XQP builds a little in memory table based on the first few characters (so don't pre-pend fluff!).&lt;BR /&gt;There is indeed a notion of name ranges for a BLOCK in a directory, trying to fit a new name in a logical spot. If that block is full, the whole directory will be re-copied opening up a block. This USED to be done with single block IOs as an easy way to garantuee recoverability.! (pre 7.2).&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Ian&amp;gt; Note that directories should be kept below 127 blocks in size as there is a severe performance degradation above this size. &lt;BR /&gt;&lt;BR /&gt;This is still agood guideline, but it never really was a hard and fast rule. It was there because RMS had a 127 block max size for (repeated)  WILDCARD lookup ( mail$*.mai). Individual file lookup, without wildcard were/are done by the XQP with a modified binary search algoritme. RMS can now (7.2+?) deal with larger directories, making the performance 'knee' much softer. But exsessive directory sizes still hurt some.&lt;BR /&gt;&lt;BR /&gt;hth,&lt;BR /&gt;Hein.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Tue, 18 Nov 2003 10:40:23 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/how-to-reduce-directory-size/m-p/3121892#M61350</guid>
      <dc:creator>Hein van den Heuvel</dc:creator>
      <dc:date>2003-11-18T10:40:23Z</dc:date>
    </item>
    <item>
      <title>Re: how to reduce directory size ?</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/how-to-reduce-directory-size/m-p/3121893#M61351</link>
      <description>Thanks to all for great suggestions. I am a happy now. &lt;BR /&gt;&lt;BR /&gt;Regards,&lt;BR /&gt;Lokesh</description>
      <pubDate>Thu, 20 Nov 2003 05:24:52 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/how-to-reduce-directory-size/m-p/3121893#M61351</guid>
      <dc:creator>Lokesh_2</dc:creator>
      <dc:date>2003-11-20T05:24:52Z</dc:date>
    </item>
  </channel>
</rss>

