0% found this document useful (0 votes)
40 views

Create New Filesystem On Logical Volume

1) Create a 100MB logical volume called lv_xfs on volume group vg. 2) Format the logical volume with xfs filesystem. 3) Mount the filesystem permanently to /xfs by adding an entry to /etc/fstab using the filesystem UUID.

Uploaded by

Maher Mechi
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
40 views

Create New Filesystem On Logical Volume

1) Create a 100MB logical volume called lv_xfs on volume group vg. 2) Format the logical volume with xfs filesystem. 3) Mount the filesystem permanently to /xfs by adding an entry to /etc/fstab using the filesystem UUID.

Uploaded by

Maher Mechi
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 3

Create new filesystem on logical volume

Question:
Create a xfs file system on a new logical volume of 100MB called lv_xfs. Mount it permanently with
uuid under /xfs.

(scroll down for an answer)


Answer:
Before any kind of operations on LVM it is good to know what we actually have in the system.
The proper command to list all devices we can use is in order pvs, vgsand lvs. It shows all
physical storages and devices, volume groups and logical volumes.

First we create a logical volume that is mentioned in the question and we create files system
on it:

lvcreate –size 100M –name lv_xfs /dev/vg


# we can also use mkfs -type xfs /dev/vg/lv_xfs
mkfs.xfs /dev/vg/lv_xfs

After that we have to perform all the steps for permanent mounting, starting with creation of
mount point:

mkdir /xfs

Then we edit fstab file in order to make mounting permanent:

blkid | grep lv_xfs >> /etc/fstab

OR

vi /etc/fstab
UUID=... /xfs xfs defaults 1 2

Finally we remount the discs by reloading fstab configuration using:

mount -a

Additional comment:
Make sure that You know the difference between partition label and file system
name - https://superuser.com/questions/1099232/what-is-the-difference-between-a-partition-
name-and-a-partition-label/1099292 and You do not confuse them.

When editing fstab file by hand we got much more control over mount options. Also pay attention
to the fact that with provided solution we use '1 2' values for checking mount point integrity - the
first one indicates how often the partition will be backed by dump program, the second one points
to the level of integrity check when mounting (0 means no check, 1 is applied only to the root
partition).

You might also like