Create LVM - CentOS
Below are the steps to create LVM. LVM stands for Logical Volume Manager.
With LVM, we can create logical partitions that can span across one or more physical hard drives. First, the hard drives are divided into physical volumes, then those physical volumes are combined together to create the volume group and finally the logical volumes are created from volume group.
Add the new disk in your Virtual Machine and Scan the system using the below command
echo "- - -" > /sys/class/scsi_host/host0/scan
echo "- - -" > /sys/class/scsi_host/host1/scan
echo "- - -" > /sys/class/scsi_host/host2/scan
echo "- - -" > /sys/class/scsi_host/host3/scan
pvcreate /dev/sdb
vgcreate -s 32M vg_data /dev/sdb
lvcreate -l 100%FREE -n lv_data vg_data
mkfs.ext4 /dev/vg_data/lv_data
mkdir /data
echo -e "/dev/vg_data/lv_data\t/data\text4\tdefaults\t1 2" >> /etc/fstab
mount /data
or
mount -a
Comments
Post a Comment