title: Resizing an EXT4 Partition
body: <p>I have an Ubuntu 18.04 server in a VM. The VM administrator has allocated more disk space. How do I resize a partition to use that space?</p>
  
  <p>My setup is as follows:</p>
  
  <pre><code>Device          Start        End    Sectors  Size Type
  /dev/sda1        2048    1050623    1048576  512M EFI System
  /dev/sda2     1050624    5244927    4194304    2G Linux filesystem
  /dev/sda3     5244928  424675327  419430400  200G Linux filesystem
  /dev/sda4   424675328  529532927  104857600   50G Linux filesystem
  /dev/sda5   529532928 1578108927 1048576000  500G Linux filesystem
  /dev/sda6  1578108928 1745881087  167772160   80G Linux filesystem
  
  (parted) print free space                                                
  Model: Msft Virtual Disk (scsi)
  Disk /dev/sda: 1397GB
  Sector size (logical/physical): 512B/4096B
  Partition Table: gpt
  Disk Flags:
  
  Number  Start   End     Size    File system  Name  Flags
          17.4kB  1049kB  1031kB  Free Space
   1      1049kB  538MB   537MB   fat32              boot, esp
   2      538MB   2685MB  2147MB  ext4
   3      2685MB  217GB   215GB   ext4
   4      217GB   271GB   53.7GB  ext4
   5      271GB   808GB   537GB   ext4
   6      808GB   894GB   85.9GB  ext4
          894GB   1397GB  503GB   Free Space
  </code></pre>
  
  <p>How can I assign that free space to the fifth partition.</p>
  
  <p>Following the instructions in: 
  <a href="https://geekpeek.net/resize-filesystem-fdisk-resize2fs/" rel="nofollow noreferrer">https://geekpeek.net/resize-filesystem-fdisk-resize2fs/</a></p>
  
  <p>I deleted /dev/sda5 and then recreated it, but it remained the same size:</p>
  
  <p>Similarly, following:</p>
  
  <p><a href="https://www.tecmint.com/parted-command-to-create-resize-rescue-linux-disk-partitions/" rel="nofollow noreferrer">https://www.tecmint.com/parted-command-to-create-resize-rescue-linux-disk-partitions/</a></p>
  
  <p>resizepart doesn't suggest that there's any available disk space to use and the partition remains the same size.</p>
  
  <p>Do I need to remove /dev/sda6 to get access to the available disk space?</p>