I know this question has already been answered for a primary partition, but what about a secondary?

I have extended the space to 30G in VMware. When I perform an fdisk -l, here's the output:

Disk /dev/sda: 32.2 GB, 32212254720 bytes
255 heads, 63 sectors/track, 3916 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *           1          13      104391   83  Linux
/dev/sda2              14        1174     9325732+  8e  Linux LVM
/dev/sda3            1175        1958     6297480   83  Linux

I want to be able to extend /dev/sda3.

I follow instructions using fdisk /dev/sda - but since the partition I want to extend is not LVM, I'm not sure how to finish it.


Download and boot a Parted Magic or similar CD in your virtual machine. Then use gparted to easily resize the third partition.

| improve this answer | |
  1. Use fdisk (or sfdisk or cfdisk or similar) to change /dev/sda3 so that it extends to the end of the disk.

  2. Resize the filesystem. Exact details depend on what kind of fs it is. e.g. for ext3 or ext4, it'll be resize2fs /dev/sda3, while for xfs it will be xfs_growfs /

xfs_growfs wants the mount point rather than the device name - i'm assuming that /dev/sda3 is mounted as the root fs or /

resize2fs can also be used for ext2 filesystems, but ext2 does not support online resizing so you'd have to boot to a CD like gparted or something.

See the man pages for these tools and read them thoroughly to understand them before using.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.