title: are files divided into blocks for storing in HDFS?
body: <p>I understand that the block system in HDFS is a logical partition on top of underlying file system.
  But how is the file retrieved when I issue a <code>cat</code> command.</p>
  
  <p>Let say I have a 1 GB file. My default <code>HDFS</code> block size is 64 MB.</p>
  
  <p>I issue the following the command:</p>
  
  <pre><code>hadoop -fs copyFromLocal my1GBfile.db input/data/
  </code></pre>
  
  <p>The above command copies the file <code>my1GBfile.db</code> from my local machine to input/data directory in <code>HDFS:</code></p>
  
  <p>I have 16 blocks to be copied and replicated ( 1 GB / 64 MB ~ 16 ).</p>
  
  <p>If I have 8 <code>datanodes</code>, a single datanode might not have all blocks to reconsitute the file.</p>
  
  <p>when I issue the following command</p>
  
  <pre><code>hadoop -fs cat input/data/my1GBfile.db | head 
  </code></pre>
  
  <p>what happens now?</p>
  
  <p>How is the file reconstituted? Although blocks are just logical partitions, how is the 1 GB file physically stored. It is stored on HDFS. does each datanode get some physical portion of the file.
  so by breaking input 1GB file into 64 MB chunks, we might break something at record level (say in between the line). How is this handled?</p>
  
  <p>I checked  in my datanode and I do see a <code>blk_1073741825</code>, which when opened in editor actually displays contents of the file.</p>
  
  <p>so is the chunks of files that is made is not logical but real <code>partition</code> of data happens?</p>
  
  <p>kindly help clarify this</p>