Wednesday, October 03, 2012

Resize Unix Root File System

The resize2fs program will resize ext2, ext3, or ext4 file systems.
It can be used to enlarge or shrink an unmounted file system located on
device. If the filesystem is mounted, it can be used to expand the size
of the mounted filesystem, assuming the kernel supports on-line resizing.

First of all, we need to add a new partition.
# fdisk <disk>

Command (m for help): n

Command action
e extended
p primary partition (1-4)

and input the required partition size and lastly 'w' to write the
changes to partition table.

# shutdown -r now (or use partprobe)

# pvcreate <the new partition>

# vgextend VolGroup /dev/xvda3 (add the new physical volume to a
volume group)

# lvextend /dev/VolGroup/lv_root /dev/xvda3 (extend an existing logical
volume with the newly created physical volume)

# resize2fs /dev/mapper/VolGroup-lv_root (at last, we run resize2fs to
enlarge the filesystem)

1 comment:

  1. Thank you very much for your information.
    Australia ETA/eVisitor Visa
    is quiet easy to apply online from Singapore,
    Malaysia, United Kingdom, United States, Canada, France and including all others ETA Eligible Countries from our website.