How to Resize a Linux Cloud Disk Size After an Upgrade

Scope

This article was written to outline the steps required to resize the disk space on a Codero Cloud instance that had previously been upgraded to a larger size.

 

Requirements

A Codero Cloud account
A running Codero Cloud instance that had previously been upgraded to a larger size.

 

Procedure

 

Log In

Log into your cloud instance as root using SSH

 

Verify upgraded size

You can verify the size of the drive had been upgraded by running the following command:

# fdisk -l /dev/xvda
Sample Output:

Disk /dev/xvda: 39.7 GB, 39728447488 bytes
255 heads, 63 sectors/track, 4830 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x000c1698
...

The available disk is 39.7GB

 

Verify current disk size

Check the current size of the disk by running the df (disk free) command

df -h
Sample Output:

Filesystem      Size  Used Avail Use% Mounted on
/dev/xvda3       19G  1.1G   17G   6% /
tmpfs           497M     0  497M   0% /dev/shm
/dev/xvda1      485M   64M  396M  14% /boot

In this example the current usable disk size is 19G

 

Resize the disk

Resize the disk using the resize2fs command

# resize2fs /dev/xvda3
Sample Output

Leave a Reply

You must be logged in to post a comment.