Welcome to Halil Demirezen's Tips and Tutorials Page
Personal
Home
Contact
Biography
Research

Projects
Tutorials
Celsus Library (TR)

Categories

LinuxNetworkComputer VisionDatabasesProgamming
vmware


LVM: Creating a new logical volume 2020-02-17 09:19:44

To create a logical volume after adding a disk to the system, follow the steps below:


a) Initialize the disk to the linux system without restart

echo "- - -" > /sys/class/scsi_host/host0/scan


b) Create LVM partition with fdisk

fdisk /dev/sdd

type "n" for new partition
type "t" for LVM type, which is "8e"


c) Create physical volume on the parititon

pvcreate /dev/sdd1


d) Create a volume group on the partition

vgcreate vg00 /dev/sdd1


e) Create a logical volume on the volume group. For example we are
using %100 of the volume group space for the new logical volume.

lvcreate -n lvm00 -l 100%FREE vg00



You can reach the newly create volume through /dev/vg00/lvm00
You should format this disk to mount under any directory.

mkfs.ext4 /dev/vg00/lvm00