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

 

 

 

 

 

All content available through this Web Site is provided on an “AS IS” and “AS AVAILABLE” basis, with all faults. Tracston LTD makes no warranty or representation with respect to the quality, accuracy, or availability of the Web Site or any of its content.