<?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>question Re: How to change the block size of existing files in HDFS? in Support Questions</title>
    <link>https://community.cloudera.com/t5/Support-Questions/How-to-change-the-block-size-of-existing-files-in-HDFS/m-p/180626#M142872</link>
    <description>&lt;P&gt;&lt;EM&gt;&lt;A href="https://community.hortonworks.com/users/15107/sriramhadoop27.html"&gt;@Sriram Hadoop&lt;/A&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;Once you have changed the  block size at the cluster level, whatever files you put or copy to hdfs will have the new default block size of 256 MB&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;Unfortunately, apart from DISTCP you have the usual -put and -get HDFS commands&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;My default blocksize is 128MB see  attached screenshot 128MB.JPG&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;Created a file &lt;STRONG&gt;test_128MB.txt&lt;/STRONG&gt; &lt;/EM&gt;&lt;/P&gt;&lt;PRE&gt;$ vi test_128MB.txt &lt;/PRE&gt;&lt;P&gt;&lt;STRONG&gt;&lt;EM&gt;Uploaded a 128 MB files to HDFS&lt;/EM&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;PRE&gt;$ hdfs dfs -put test_128MB.txt /user/sheltong&lt;/PRE&gt;&lt;P&gt;&lt;EM&gt;see attached screenshot &lt;STRONG&gt;128MB.JPG&lt;/STRONG&gt; notice the block size&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;I then copied the same file back to the local filesystem,&lt;/EM&gt;&lt;/P&gt;&lt;PRE&gt;$ hdfs dfs -get /user/sheltong/test_128MB.txt /tmp/test_128MB_2.txt&lt;/PRE&gt;&lt;P&gt;&lt;EM&gt;The using the -D option to define a new blocksize of &lt;STRONG&gt;256 MB&lt;/STRONG&gt;&lt;/EM&gt;&lt;/P&gt;&lt;PRE&gt;$ hdfs dfs -D dfs.blocksize=268435456 -put test_128MB_2.txt /user/sheltong&lt;/PRE&gt;&lt;P&gt;&lt;EM&gt;See screenshot &lt;STRONG&gt;256MB.JPG&lt;/STRONG&gt;, technically its possible if you have a few files but you should  remember  the &lt;/EM&gt;&lt;EM&gt;&lt;STRONG&gt;test_128MB.txt&lt;/STRONG&gt; and &lt;/EM&gt;&lt;EM&gt;&lt;STRONG&gt;test_128MB_2.txt&lt;/STRONG&gt; are the same files of &lt;STRONG&gt;128MB&lt;/STRONG&gt;, so changing the blocksize  of an existing files  with try to fit a 128bock in a 256 MB block leading to wastage of space of the other 128MB, hence the reason it will ONLY apply to new files.&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;Hope that gives you a better understanding &lt;/EM&gt;&lt;/P&gt;&lt;BR /&gt;&lt;IMG src="https://community.cloudera.com/t5/image/serverpage/image-id/6336i958B2F4450DB4B39/image-size/large?v=1.0&amp;amp;px=999" border="0" alt="128mb.jpg" title="128mb.jpg" /&gt;&lt;IMG src="https://community.cloudera.com/t5/image/serverpage/image-id/6337iDCD8587BC4CE37DF/image-size/large?v=1.0&amp;amp;px=999" border="0" alt="256mb.jpg" title="256mb.jpg" /&gt;</description>
    <pubDate>Fri, 27 Apr 2018 19:48:04 GMT</pubDate>
    <dc:creator>Shelton</dc:creator>
    <dc:date>2018-04-27T19:48:04Z</dc:date>
    <item>
      <title>How to change the block size of existing files in HDFS?</title>
      <link>https://community.cloudera.com/t5/Support-Questions/How-to-change-the-block-size-of-existing-files-in-HDFS/m-p/180618#M142864</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I tried looking in to the community but could not get proper answer for this question.&lt;/P&gt;&lt;P&gt;How can I change the block size for the existing files in HDFS? I want to increase the block size.&lt;/P&gt;&lt;P&gt;I see the solution as distcp  and I understood that we have to use distcp to move the files, folders and subfolders to a new temporary location with new block size and then remove the files, folders, etc for which block size has to be increased and copy the files from temporary location back to original location.&lt;/P&gt;&lt;P&gt;The above methodology might have side effects such as overhead of HDFS by adding duplicate copies of the files and change in permissions while copying files from temporary location and etc.&lt;/P&gt;&lt;P&gt;Is they any way which is efficient enough to replace the existing files with the same name and same privileges but with increased block size?&lt;/P&gt;&lt;P&gt;Thanks to all for your time on this question.&lt;/P&gt;</description>
      <pubDate>Thu, 26 Apr 2018 17:40:50 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/How-to-change-the-block-size-of-existing-files-in-HDFS/m-p/180618#M142864</guid>
      <dc:creator>sriramhadoop27</dc:creator>
      <dc:date>2018-04-26T17:40:50Z</dc:date>
    </item>
    <item>
      <title>Re: How to change the block size of existing files in HDFS?</title>
      <link>https://community.cloudera.com/t5/Support-Questions/How-to-change-the-block-size-of-existing-files-in-HDFS/m-p/180619#M142865</link>
      <description>&lt;A rel="user" href="https://community.cloudera.com/users/15107/sriramhadoop27.html" nodeid="15107"&gt;@Sriram Hadoop&lt;/A&gt;&lt;P&gt;I'm not aware of any other method but distcp command. Just wanted to add to this thread that distcp command has a -p option that you can use to preserve file permissions (user, group, posix permissions) and timestamp as well. &lt;/P&gt;&lt;P&gt;HTH&lt;/P&gt;</description>
      <pubDate>Thu, 26 Apr 2018 18:44:38 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/How-to-change-the-block-size-of-existing-files-in-HDFS/m-p/180619#M142865</guid>
      <dc:creator>falbani</dc:creator>
      <dc:date>2018-04-26T18:44:38Z</dc:date>
    </item>
    <item>
      <title>Re: How to change the block size of existing files in HDFS?</title>
      <link>https://community.cloudera.com/t5/Support-Questions/How-to-change-the-block-size-of-existing-files-in-HDFS/m-p/180620#M142866</link>
      <description>&lt;P&gt;@Felix Albani,&lt;/P&gt;&lt;P&gt;Thanks a lot for your time on this.&lt;/P&gt;&lt;P&gt;Can you verify on this distcp procedure:&lt;/P&gt;&lt;P&gt;a) Use distcp and copy all the files and subfolders with -p option to a temporary location in HDFS on the same cluster with new block size.&lt;/P&gt;&lt;P&gt;b) Remove all the files in original location.&lt;/P&gt;&lt;P&gt;c) Copy the files from temporary location to original location.&lt;/P&gt;&lt;P&gt;Am I correct?&lt;/P&gt;</description>
      <pubDate>Thu, 26 Apr 2018 20:18:03 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/How-to-change-the-block-size-of-existing-files-in-HDFS/m-p/180620#M142866</guid>
      <dc:creator>sriramhadoop27</dc:creator>
      <dc:date>2018-04-26T20:18:03Z</dc:date>
    </item>
    <item>
      <title>Re: How to change the block size of existing files in HDFS?</title>
      <link>https://community.cloudera.com/t5/Support-Questions/How-to-change-the-block-size-of-existing-files-in-HDFS/m-p/180621#M142867</link>
      <description>&lt;P&gt;&lt;A rel="user" href="https://community.cloudera.com/users/15107/sriramhadoop27.html" nodeid="15107"&gt;@Sriram Hadoop&lt;/A&gt; &lt;/P&gt;&lt;P&gt;&amp;gt;How can I change the block size for the existing files in HDFS? I want to increase the block size.&lt;/P&gt;&lt;P&gt;May I ask what you are trying to achieve? We might be able to make better suggestions if we know what is the problem you are trying to solve? &lt;/P&gt;</description>
      <pubDate>Fri, 27 Apr 2018 01:22:46 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/How-to-change-the-block-size-of-existing-files-in-HDFS/m-p/180621#M142867</guid>
      <dc:creator>aengineer</dc:creator>
      <dc:date>2018-04-27T01:22:46Z</dc:date>
    </item>
    <item>
      <title>Re: How to change the block size of existing files in HDFS?</title>
      <link>https://community.cloudera.com/t5/Support-Questions/How-to-change-the-block-size-of-existing-files-in-HDFS/m-p/180622#M142868</link>
      <description>&lt;P&gt;&lt;A rel="user" href="https://community.cloudera.com/users/518/aengineer.html" nodeid="518"&gt;@aengineer&lt;/A&gt;&lt;/P&gt;&lt;P&gt;Thanks for your time on this.&lt;/P&gt;&lt;P&gt;I want to increase the block size of existing files and this is a requirement for us.&lt;/P&gt;&lt;P&gt;This is to decrease the latency while reading the file.&lt;/P&gt;</description>
      <pubDate>Fri, 27 Apr 2018 08:31:50 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/How-to-change-the-block-size-of-existing-files-in-HDFS/m-p/180622#M142868</guid>
      <dc:creator>sriramhadoop27</dc:creator>
      <dc:date>2018-04-27T08:31:50Z</dc:date>
    </item>
    <item>
      <title>Re: How to change the block size of existing files in HDFS?</title>
      <link>https://community.cloudera.com/t5/Support-Questions/How-to-change-the-block-size-of-existing-files-in-HDFS/m-p/180623#M142869</link>
      <description>&lt;P&gt;&lt;EM&gt;&lt;A href="https://community.hortonworks.com/users/15107/sriramhadoop27.html"&gt;@Sriram Hadoop&lt;/A&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;I&gt;Hadoop Distributed File System was designed to hold and manage large amounts of data; therefore typical HDFS block sizes are significantly larger than the block sizes you would see for a traditional filesystem the block size is specified in &lt;STRONG&gt;hdfs-site.xml&lt;/STRONG&gt;. &lt;/I&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;The default block size in Hadoop 2.0 is 128mb, to change to 256MB edit the parameter, &lt;B&gt;dfs.block.size  to &lt;/B&gt;change to the desired block size eg 256 MB and you will need to restart all the stale services for the change to take effect. It's recommended to always use Ambari UI to make HDP/HDF changes &lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;Existing files' block size can't be changed, In order to change the existing files' block size, 'distcp' utility can be used. &lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;or &lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;EM&gt;Override the default block size with 265 MB &lt;/EM&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;PRE&gt;&lt;EM&gt;hadoop fs -D dfs.blocksize=268435456 -copyFromLocal /tmp/test/payroll-april10.csv blksize/payroll-april10.csv&lt;/EM&gt;&lt;/PRE&gt;&lt;P&gt;&lt;EM&gt;Hope that helps&lt;/EM&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 27 Apr 2018 13:22:07 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/How-to-change-the-block-size-of-existing-files-in-HDFS/m-p/180623#M142869</guid>
      <dc:creator>Shelton</dc:creator>
      <dc:date>2018-04-27T13:22:07Z</dc:date>
    </item>
    <item>
      <title>Re: How to change the block size of existing files in HDFS?</title>
      <link>https://community.cloudera.com/t5/Support-Questions/How-to-change-the-block-size-of-existing-files-in-HDFS/m-p/180624#M142870</link>
      <description>&lt;P&gt;@Geoffrey Shelton Okot,&lt;/P&gt;&lt;P&gt;Thanks for your time.&lt;/P&gt;&lt;P&gt;I agree with your point about changing the block size on cluster level and restarting the services but the new block size would be applicable only for new files and the command you gave is applicable for new files.&lt;/P&gt;&lt;P&gt;I would like to know the method other than distcp to change block size of existing files in hadoop cluster.&lt;/P&gt;</description>
      <pubDate>Fri, 27 Apr 2018 17:17:38 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/How-to-change-the-block-size-of-existing-files-in-HDFS/m-p/180624#M142870</guid>
      <dc:creator>sriramhadoop27</dc:creator>
      <dc:date>2018-04-27T17:17:38Z</dc:date>
    </item>
    <item>
      <title>Re: How to change the block size of existing files in HDFS?</title>
      <link>https://community.cloudera.com/t5/Support-Questions/How-to-change-the-block-size-of-existing-files-in-HDFS/m-p/180625#M142871</link>
      <description>&lt;P&gt;&lt;A rel="user" href="https://community.cloudera.com/users/15107/sriramhadoop27.html" nodeid="15107"&gt;@Sriram&lt;/A&gt; Yes, that would work. You could also avoid having to copy twice (point a and c) by moving the original data to a temporary location first (which will trigger only a change on the Namenode metadata and not actual copy of blocks which could take lot time):&lt;/P&gt;&lt;P&gt;a) Use hdfs dfs mv command to move all the original files and subfolders to /tmp&lt;/P&gt;&lt;P&gt;b) Copy the files from /tmp to the original location using distcp -p&lt;/P&gt;&lt;P&gt;c) Remove the original files&lt;/P&gt;&lt;P&gt;*** If you found my previous  answer addressed your question, please take a moment to login and click the "accept" link on the answer.&lt;/P&gt;</description>
      <pubDate>Fri, 27 Apr 2018 19:05:40 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/How-to-change-the-block-size-of-existing-files-in-HDFS/m-p/180625#M142871</guid>
      <dc:creator>falbani</dc:creator>
      <dc:date>2018-04-27T19:05:40Z</dc:date>
    </item>
    <item>
      <title>Re: How to change the block size of existing files in HDFS?</title>
      <link>https://community.cloudera.com/t5/Support-Questions/How-to-change-the-block-size-of-existing-files-in-HDFS/m-p/180626#M142872</link>
      <description>&lt;P&gt;&lt;EM&gt;&lt;A href="https://community.hortonworks.com/users/15107/sriramhadoop27.html"&gt;@Sriram Hadoop&lt;/A&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;Once you have changed the  block size at the cluster level, whatever files you put or copy to hdfs will have the new default block size of 256 MB&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;Unfortunately, apart from DISTCP you have the usual -put and -get HDFS commands&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;My default blocksize is 128MB see  attached screenshot 128MB.JPG&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;Created a file &lt;STRONG&gt;test_128MB.txt&lt;/STRONG&gt; &lt;/EM&gt;&lt;/P&gt;&lt;PRE&gt;$ vi test_128MB.txt &lt;/PRE&gt;&lt;P&gt;&lt;STRONG&gt;&lt;EM&gt;Uploaded a 128 MB files to HDFS&lt;/EM&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;PRE&gt;$ hdfs dfs -put test_128MB.txt /user/sheltong&lt;/PRE&gt;&lt;P&gt;&lt;EM&gt;see attached screenshot &lt;STRONG&gt;128MB.JPG&lt;/STRONG&gt; notice the block size&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;I then copied the same file back to the local filesystem,&lt;/EM&gt;&lt;/P&gt;&lt;PRE&gt;$ hdfs dfs -get /user/sheltong/test_128MB.txt /tmp/test_128MB_2.txt&lt;/PRE&gt;&lt;P&gt;&lt;EM&gt;The using the -D option to define a new blocksize of &lt;STRONG&gt;256 MB&lt;/STRONG&gt;&lt;/EM&gt;&lt;/P&gt;&lt;PRE&gt;$ hdfs dfs -D dfs.blocksize=268435456 -put test_128MB_2.txt /user/sheltong&lt;/PRE&gt;&lt;P&gt;&lt;EM&gt;See screenshot &lt;STRONG&gt;256MB.JPG&lt;/STRONG&gt;, technically its possible if you have a few files but you should  remember  the &lt;/EM&gt;&lt;EM&gt;&lt;STRONG&gt;test_128MB.txt&lt;/STRONG&gt; and &lt;/EM&gt;&lt;EM&gt;&lt;STRONG&gt;test_128MB_2.txt&lt;/STRONG&gt; are the same files of &lt;STRONG&gt;128MB&lt;/STRONG&gt;, so changing the blocksize  of an existing files  with try to fit a 128bock in a 256 MB block leading to wastage of space of the other 128MB, hence the reason it will ONLY apply to new files.&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;Hope that gives you a better understanding &lt;/EM&gt;&lt;/P&gt;&lt;BR /&gt;&lt;IMG src="https://community.cloudera.com/t5/image/serverpage/image-id/6336i958B2F4450DB4B39/image-size/large?v=1.0&amp;amp;px=999" border="0" alt="128mb.jpg" title="128mb.jpg" /&gt;&lt;IMG src="https://community.cloudera.com/t5/image/serverpage/image-id/6337iDCD8587BC4CE37DF/image-size/large?v=1.0&amp;amp;px=999" border="0" alt="256mb.jpg" title="256mb.jpg" /&gt;</description>
      <pubDate>Fri, 27 Apr 2018 19:48:04 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/How-to-change-the-block-size-of-existing-files-in-HDFS/m-p/180626#M142872</guid>
      <dc:creator>Shelton</dc:creator>
      <dc:date>2018-04-27T19:48:04Z</dc:date>
    </item>
    <item>
      <title>Re: How to change the block size of existing files in HDFS?</title>
      <link>https://community.cloudera.com/t5/Support-Questions/How-to-change-the-block-size-of-existing-files-in-HDFS/m-p/180627#M142873</link>
      <description>&lt;P&gt;@Geoffery,&lt;/P&gt;&lt;P&gt;Thanks a lot for your time.&lt;/P&gt;&lt;P&gt;Yes, you are correct and I am looking for a tool other than distcp&lt;/P&gt;&lt;P&gt;Thanks a lot for your time on this again.&lt;/P&gt;</description>
      <pubDate>Sun, 29 Apr 2018 12:41:49 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/How-to-change-the-block-size-of-existing-files-in-HDFS/m-p/180627#M142873</guid>
      <dc:creator>sriramhadoop27</dc:creator>
      <dc:date>2018-04-29T12:41:49Z</dc:date>
    </item>
    <item>
      <title>Re: How to change the block size of existing files in HDFS?</title>
      <link>https://community.cloudera.com/t5/Support-Questions/How-to-change-the-block-size-of-existing-files-in-HDFS/m-p/180628#M142874</link>
      <description>&lt;P&gt;&lt;EM&gt;&lt;A href="https://community.hortonworks.com/users/15107/sriramhadoop27.html"&gt;@Sriram Hadoop&lt;/A&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;Nice to know it has answered your question.&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;Could you Accept the answer I gave by Clicking on Accept button below, That would be a great help to Community users to find the solution quickly for these kinds of errors.&lt;/EM&gt;&lt;/P&gt;</description>
      <pubDate>Sun, 29 Apr 2018 13:09:40 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/How-to-change-the-block-size-of-existing-files-in-HDFS/m-p/180628#M142874</guid>
      <dc:creator>Shelton</dc:creator>
      <dc:date>2018-04-29T13:09:40Z</dc:date>
    </item>
    <item>
      <title>Re: How to change the block size of existing files in HDFS?</title>
      <link>https://community.cloudera.com/t5/Support-Questions/How-to-change-the-block-size-of-existing-files-in-HDFS/m-p/180629#M142875</link>
      <description>&lt;A rel="user" href="https://community.cloudera.com/users/11048/falbani.html" nodeid="11048"&gt;@Felix Albani&lt;/A&gt;&lt;P&gt;This is in regard to the changing the block size of an existing file from 64mb to 128mb.&lt;/P&gt;&lt;P&gt;We are facing some issues when we delete the files.&lt;/P&gt;&lt;P&gt;So, is there a way to change the block size of an existing file, without removing the file.&lt;/P&gt;</description>
      <pubDate>Thu, 25 Oct 2018 14:22:18 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/How-to-change-the-block-size-of-existing-files-in-HDFS/m-p/180629#M142875</guid>
      <dc:creator>sriramhadoop27</dc:creator>
      <dc:date>2018-10-25T14:22:18Z</dc:date>
    </item>
    <item>
      <title>Re: How to change the block size of existing files in HDFS?</title>
      <link>https://community.cloudera.com/t5/Support-Questions/How-to-change-the-block-size-of-existing-files-in-HDFS/m-p/180630#M142876</link>
      <description>&lt;P&gt;@&lt;A href="https://community.hortonworks.com/users/1271/sheltong.html"&gt;Geoffrey Shelton Okot&lt;/A&gt;I&lt;/P&gt;&lt;P&gt;Thanks for the details.&lt;/P&gt;&lt;P&gt; I have a cluster which has 220 million files and out of which 110 million is less than 1 MB in size.&lt;/P&gt;&lt;P&gt;Default block size is set to 128 MB. &lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;What should be the blocksize for file less than 1 MB? And How we can set in live cluster?&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;Total Files + Directories: 227008030&lt;/P&gt;&lt;P&gt;Disk Remaining: 700 TB / 3.5 PB (20%)&lt;/P&gt;</description>
      <pubDate>Mon, 10 Dec 2018 18:12:26 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/How-to-change-the-block-size-of-existing-files-in-HDFS/m-p/180630#M142876</guid>
      <dc:creator>patrasuman</dc:creator>
      <dc:date>2018-12-10T18:12:26Z</dc:date>
    </item>
    <item>
      <title>Re: How to change the block size of existing files in HDFS?</title>
      <link>https://community.cloudera.com/t5/Support-Questions/How-to-change-the-block-size-of-existing-files-in-HDFS/m-p/299394#M219651</link>
      <description>&lt;P&gt;Hi.&lt;/P&gt;&lt;P&gt;I've a file with 128Mb block size&lt;/P&gt;&lt;P&gt;I'd like to change an existing file's blocksize using:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;  hdfs dfs -mv /user/myfile.txt /tmp
  hdfs dfs -D dfs.blocksize=268435456 -cp /tmp/myfile.txt /user&lt;/LI-CODE&gt;&lt;P&gt;It works&lt;/P&gt;&lt;P&gt;When I try to use a distcp, with -p to preserve original file's attributes, target file's blocksize doesn't change&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;hadoop distcp -p -D dfs.block.size=268435456 /tmp/myfile.txt /user/myfile.txt&lt;/LI-CODE&gt;&lt;P&gt;Can't understand where am I wrong&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 09 Jul 2020 09:09:29 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/How-to-change-the-block-size-of-existing-files-in-HDFS/m-p/299394#M219651</guid>
      <dc:creator>svasi</dc:creator>
      <dc:date>2020-07-09T09:09:29Z</dc:date>
    </item>
    <item>
      <title>Re: How to change the block size of existing files in HDFS?</title>
      <link>https://community.cloudera.com/t5/Support-Questions/How-to-change-the-block-size-of-existing-files-in-HDFS/m-p/312152#M225011</link>
      <description>&lt;P&gt;Agreed, but is there a way to avoid this wastage. apart from migrating data to LFS and then again to HDFS.&lt;/P&gt;&lt;P&gt;Example: We have a 500MB file with block size 128 MB i.e. 4 blocks on HDFS. Now since we changed block size to 256MB, how would we make the file on HDFS to have 2 blocks of 256MB instead of 4.&lt;/P&gt;&lt;P&gt;Please suggest.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 26 Feb 2021 10:15:08 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/How-to-change-the-block-size-of-existing-files-in-HDFS/m-p/312152#M225011</guid>
      <dc:creator>Data_enthu</dc:creator>
      <dc:date>2021-02-26T10:15:08Z</dc:date>
    </item>
  </channel>
</rss>

