Create a LVM Volume with XFS Fileystem

Install needed tools

apt-get install xfsprogs lvm2

Prepare your Volume and Create a Logical Volume pvcreate /dev/xvdf
Physical volume “/dev/xvdf” successfully created vgcreate data /dev/xvdf
Volume group “data” successfully created lvcreate -l+100%FREE -n vault data
Logical volume “vault” created


Format your LVM Volume mkfs.xfs -f /dev/mapper/data-vault
meta-data=/dev/mapper/data-vault isize=256 agcount=4, agsize=32767744 blks
= sectsz=512 attr=2, projid32bit=0
data = bsize=4096 blocks=131070976, imaxpct=25
= sunit=0 swidth=0 blks
naming =version 2 bsize=4096 ascii-ci=0
log =internal log bsize=4096 blocks=63999, version=2
= sectsz=512 sunit=0 blks, lazy-count=1
realtime =none extsz=4096 blocks=0, rtextents=0


Mount your Volume mount -t xfs /dev/mapper/data-vault /data df -Th /data/
Filesystem Type Size Used Avail Use% Mounted on
/dev/mapper/data-vault xfs 500G 33M 500G 1% /data


Mount Volume on Boot

vim /etc/fstab
/dev/mapper/data-vault /data     xfs    defaults,discard        0 0


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s