Forum Navigation
You need to log in to create posts and topics.

Create New Logical Volume with LVM disk and mount

Problem:

User wants to add new disk and mount it in as a logical volume with LVM under Linux  system.

  • Add New disk either physical or virtual disk
  • reboot your Operating system and check if the disk available

           fdisk -l 

  • create volume group

            vgcreate VOLUMEGROUPNAME/dev/sdb

  • create logical volume 100%

            lvcreate –name NEWVOLUME -l 100%FREE VOLUMEGROUPNAME

  • check that the volume is created

          lvdisplay 

  • format the new volume for EXT4  or xfs

          mkfs.ext4 /dev/VOLUMEGROUPNAME/NEWVOLUME

          mkfs.xfs /dev/VOLUMEGROUPNAME/NEWVOLUME

  • make directory to mount the new volume

          mkdir /data

  • mount the new volume

          mount /dev/VOLUMEGROUPNAME/NEWVOLUME /data

  • To mount automatically on system boot add the following line in /etc/fstab

          /dev/VOLUMEGROUPNAME/NEWVOLUME /data xfs defaults 0 0

  •  reboot after adding this line or run the following command

          mount -a

 

 

 

 

 

Uploaded files: