linux grow rootfs

Grow xfs rootfs
The root volumegroup in this
example is centos, the disk in the
volumegroup is sda. We add a new
disk, extend the group, extend the
logical volume and grow the filesystem.

add new disk.
(in vmware: edit vm and add new harddisk)

# fdisk -l | grep sd
Disk /dev/sda: 10.7 GB, 10737418240 bytes, 20971520 sectors
/dev/sda1 * 2048 1026047 512000 83 Linux
/dev/sda2 1026048 20971519 9972736 8e Linux LVM
Disk /dev/sdb: 5368 MB, 5368709120 bytes, 10485760 sectors

create new physical volume
# pvcreate /dev/sdb

extend root volume group
# vgextend centos /dev/sdb

extend logical volume
# lvexend /dev/centos/root -L 10g

grow the filesystem
# xfs_growfs /

This entry was posted in Uncategorized. Bookmark the permalink.

Comments are closed.