Rocks: XFS and LVM2

From Define Wiki
Jump to navigation Jump to search
# e.g. on setting up lvm and xfs on 2 partitions,
# then growing the fs on a 3rd partition
# partitions used are sda1 sda2 sdc1
# first step, initialise partitions for use with lvm
pvcreate /dev/sda1
pvcreate /dev/sda2
pvdisplay

# once paritions are initialised, create volume group and activate it
vgcreate viglenvol /dev/sda1 /dev/sda2
vgchange -a y viglenvol
vgdisplay

# create the logical volume
lvcreate -L 43.63T -nxfsLV viglenvol
lvdisplay

# create filesystem and mount
mkfs.xfs /dev/viglenvol/xfsLV
mount /dev/viglenvol/xfsLV /mnt/viglenvol

# lets extend this now with sdc1
pvcreate /dev/sdc1                   # check with pvs / pvdisplay
vgextend viglenvol /dev/sdc1         # check with vgs / vgdisplay
lvextend -L+20T /dev/viglenvol/xfsLV # check with lvs / lvdisplay

# grow the filesystem, xfs can do this online
xfs_growfs /mnt/viglenvol (hmmm, didnt really work until i umounted, then mounted again)