Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

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.

share|improve this question

2 Answers 2

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

share|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.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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