title: No space left on device even after increasing the volume and partition size on EC2
body: <p>I have an EC2 instance with 2 EBS volumes. On the root volume, I increased the volume size.</p>
  
  <p>First I modified the <a href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/console-modify.html" rel="nofollow noreferrer">volume size on console</a>. Then followed this instruction to <a href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/recognize-expanded-volume-linux.html" rel="nofollow noreferrer">extended the partition following this instruction</a>.</p>
  
  <p>However, when running any command, I get No space left on device.</p>
  
  <pre><code>echo "Hello" &gt; hello.txt
  -bash: hello.txt: No space left on device
  </code></pre>
  
  <p>The df -h correctly shows, the total space correctly.</p>
  
  <pre><code>$ df -h
  Filesystem      Size  Used Avail Use% Mounted on
  udev            1.9G     0  1.9G   0% /dev
  tmpfs           395M  596K  394M   1% /run
  /dev/xvda1       30G   19G  9.6G  67% /
  tmpfs           2.0G     0  2.0G   0% /dev/shm
  tmpfs           5.0M     0  5.0M   0% /run/lock
  tmpfs           2.0G     0  2.0G   0% /sys/fs/cgroup
  /dev/xvdg        10G  6.2G  3.9G  62% /data2
  tmpfs           395M     0  395M   0% /run/user/1001
  
  
  $ lsblk
  NAME    MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
  xvda    202:0    0  30G  0 disk 
  └─xvda1 202:1    0  30G  0 part /
  xvdg    202:96   0  31G  0 disk /data2
  </code></pre>
  
  <p>The bottom of the <a href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/recognize-expanded-volume-linux.html" rel="nofollow noreferrer">guide</a> said,</p>
  
  <blockquote>
    <p>If the increased available space on your volume remains invisible to
    the system, try re-initializing the volume as described in
    Initializing Amazon EBS Volumes.</p>
  </blockquote>
  
  <p>So I followed <a href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ebs-initialize.html" rel="nofollow noreferrer">the instruction to reinitialize the volume</a>.</p>
  
  <p>I used dd to reinitialize.</p>
  
  <pre><code>sudo dd if=/dev/xvda of=/dev/null bs=1M
  
  30720+0 records in
  30720+0 records out
  32212254720 bytes (32 GB, 30 GiB) copied, 504.621 s, 63.8 MB/s
  </code></pre>
  
  <p>However, I still get "No space left on device" error. I have done multipe reboot of the instance, I still see the same error.</p>
  
  <p>Update 1: I have a large number of small files 4-10KB. So, I am running out of inodes. Please let me know how to increase the inodes (on ext4 partition)? Thanks. </p>
  
  <pre><code>df -i
  Filesystem      Inodes   IUsed   IFree IUse% Mounted on
  udev            497270     371  496899    1% /dev
  tmpfs           504717     539  504178    1% /run
  /dev/xvda1     1966080 1966080       0  100% /
  tmpfs           504717       1  504716    1% /dev/shm
  tmpfs           504717       4  504713    1% /run/lock
  tmpfs           504717      18  504699    1% /sys/fs/cgroup
  /dev/xvdg      5242880   39994 5202886    1% /data2
  tmpfs           504717      10  504707    1% /run/user/1001
  </code></pre>
  
  <p>Please let me know how to resolve this error. </p>