<?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: blocks count in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/blocks-count/m-p/3263916#M177435</link>
    <description>I have to explain what I'd like to do...&lt;BR /&gt;I'd like to make a script usig awk (for exemple) thath identifies "sparse" files doing a check between blocks and bytes occupied.</description>
    <pubDate>Fri, 30 Apr 2004 07:07:25 GMT</pubDate>
    <dc:creator>Mauro Gatti</dc:creator>
    <dc:date>2004-04-30T07:07:25Z</dc:date>
    <item>
      <title>blocks count</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/blocks-count/m-p/3263911#M177430</link>
      <description>Hi all, let me show a strange thing:&lt;BR /&gt;&lt;BR /&gt;virgo# ls -lsgo SysInfo204.shar&lt;BR /&gt; 392 -rw-r--r--   1  199907 Jan 28 09:55 SysInfo204.shar&lt;BR /&gt;virgo# du SysInfo204.shar&lt;BR /&gt;392     SysInfo204.shar&lt;BR /&gt;virgo# sum SysInfo204.shar&lt;BR /&gt;45707 391 SysInfo204.shar&lt;BR /&gt;&lt;BR /&gt;Why does sum report a different blocks number?&lt;BR /&gt;If a block is 512 byte long...&lt;BR /&gt;199907/512=390,44 so it should be 391 blocks.&lt;BR /&gt;&lt;BR /&gt;Could You explain how block count works?&lt;BR /&gt;</description>
      <pubDate>Fri, 30 Apr 2004 05:11:29 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/blocks-count/m-p/3263911#M177430</guid>
      <dc:creator>Mauro Gatti</dc:creator>
      <dc:date>2004-04-30T05:11:29Z</dc:date>
    </item>
    <item>
      <title>Re: blocks count</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/blocks-count/m-p/3263912#M177431</link>
      <description>Mauro,&lt;BR /&gt;&lt;BR /&gt;That's interesting!  Reading the man page for sum, it says it's obsolescent and cksum should be used instead.  What does cksum report?  Maybe that's why sum is obsolescent?&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Pete</description>
      <pubDate>Fri, 30 Apr 2004 05:14:25 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/blocks-count/m-p/3263912#M177431</guid>
      <dc:creator>Pete Randall</dc:creator>
      <dc:date>2004-04-30T05:14:25Z</dc:date>
    </item>
    <item>
      <title>Re: blocks count</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/blocks-count/m-p/3263913#M177432</link>
      <description>I should have checked first - cksum just gives you the byte count, nothing about blocks.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Pete</description>
      <pubDate>Fri, 30 Apr 2004 05:15:59 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/blocks-count/m-p/3263913#M177432</guid>
      <dc:creator>Pete Randall</dc:creator>
      <dc:date>2004-04-30T05:15:59Z</dc:date>
    </item>
    <item>
      <title>Re: blocks count</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/blocks-count/m-p/3263914#M177433</link>
      <description>It seems sum checks the right size and the other calculate one more block... Isn't it?</description>
      <pubDate>Fri, 30 Apr 2004 06:11:36 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/blocks-count/m-p/3263914#M177433</guid>
      <dc:creator>Mauro Gatti</dc:creator>
      <dc:date>2004-04-30T06:11:36Z</dc:date>
    </item>
    <item>
      <title>Re: blocks count</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/blocks-count/m-p/3263915#M177434</link>
      <description>That's certainly the way it seems.  I have to wonder if du isn't correct, though with 392 blocks.  That would allow one extra for header info or whatever.  It's a guess, but it makes sense to me.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Pete</description>
      <pubDate>Fri, 30 Apr 2004 06:24:37 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/blocks-count/m-p/3263915#M177434</guid>
      <dc:creator>Pete Randall</dc:creator>
      <dc:date>2004-04-30T06:24:37Z</dc:date>
    </item>
    <item>
      <title>Re: blocks count</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/blocks-count/m-p/3263916#M177435</link>
      <description>I have to explain what I'd like to do...&lt;BR /&gt;I'd like to make a script usig awk (for exemple) thath identifies "sparse" files doing a check between blocks and bytes occupied.</description>
      <pubDate>Fri, 30 Apr 2004 07:07:25 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/blocks-count/m-p/3263916#M177435</guid>
      <dc:creator>Mauro Gatti</dc:creator>
      <dc:date>2004-04-30T07:07:25Z</dc:date>
    </item>
    <item>
      <title>Re: blocks count</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/blocks-count/m-p/3263917#M177436</link>
      <description>The man page for du warns that "Block counts are incorrect for files that contain holes".  You would need to do some testing to see if your calculated block size is consistently one less than what du reports.  If that is true, then it should be valid to calculate a block size, add one to it, and then compare that to the value reported by du.  If different, the file must be sparse.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Pete</description>
      <pubDate>Fri, 30 Apr 2004 07:20:09 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/blocks-count/m-p/3263917#M177436</guid>
      <dc:creator>Pete Randall</dc:creator>
      <dc:date>2004-04-30T07:20:09Z</dc:date>
    </item>
    <item>
      <title>Re: blocks count</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/blocks-count/m-p/3263918#M177437</link>
      <description>For some file this works fine:&lt;BR /&gt;blocks reported by ls -s = bytes reportes by ls -l /512 + 1&lt;BR /&gt;But for others there is a difference of 1 block. (ls -ls reports one bloc more then ls -l/5121 +1)&lt;BR /&gt;For well known sparse file this difference is greter.&lt;BR /&gt;&lt;BR /&gt;I don't think in block count HP-UX calculate also inode block.&lt;BR /&gt;</description>
      <pubDate>Mon, 03 May 2004 08:52:58 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/blocks-count/m-p/3263918#M177437</guid>
      <dc:creator>Mauro Gatti</dc:creator>
      <dc:date>2004-05-03T08:52:58Z</dc:date>
    </item>
    <item>
      <title>Re: blocks count</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/blocks-count/m-p/3263919#M177438</link>
      <description>Is this a rounding issue ?&lt;BR /&gt;&lt;BR /&gt;If you don't come out exactly at a block marker, I would think you would need a partial extra block.&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Mon, 03 May 2004 09:22:47 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/blocks-count/m-p/3263919#M177438</guid>
      <dc:creator>Kent Ostby</dc:creator>
      <dc:date>2004-05-03T09:22:47Z</dc:date>
    </item>
    <item>
      <title>Re: blocks count</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/blocks-count/m-p/3263920#M177439</link>
      <description>Now that I know what you are trying to do, I think the correct answer is to forget about it. The whole point about sparse files is that they are completely invisible to the application. "Missing" characters are simply filled in with ASCII NUL by the read() system call. Consider an actual file with "X" written at offset 1 and offset 1000000 and no data in between. This would be a classic sparse file. Now consider exactly the same file except that NUL's were physically written to fill in the holes. No command could distinguish these two files even though internally they are quite different. Even commands like fbackup -- which support restoration of sparse files -- don't have a clue. The read() system calls fills in the holes with NUL's just as it would with any application. So how are sparse files able to be restored? The restore program (frecover) in this example, looks at the input stream, if it detects long sequences of ASCII NUL's, it can then issue an lseek to write data at the next non-NUL offset.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Mon, 03 May 2004 09:35:20 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/blocks-count/m-p/3263920#M177439</guid>
      <dc:creator>A. Clay Stephenson</dc:creator>
      <dc:date>2004-05-03T09:35:20Z</dc:date>
    </item>
  </channel>
</rss>

