fdisk /dev/sdb #repeat this first step for all disks required (/dev/sdc)
fdisk -l
pvcreate /dev/sdb1 #/dev/sdc1 /dev/sdd1 # add as applicable pvs #check the creation
Replace my_new_vg with a name of your choice
vgcreate -s 32M my_new_vg /dev/sdb1 # /dev/sdc1 /dev/sdd1 #see below for -s variable vgs #verify it exists
The -s value sets the size fo the extents (optional) Larger values are best for storing larger files and having larger partitions
This VG uses a 32Mb value. If this was a 120gb partition, there would be 120GB / 32MB or 120000 / 32 = 3750 If you want multiple partitions, work out the number for each (10gb, 50gb and 60gb is 312, 1562 and 1875 respectively)
lvcreate -l (Extend size) -n (name_of_logical_volume) (volume_group) #General Syntax lvcreate -l 3750 -n disk my_new_vg #Full disk OR lvcreate -l 312 -n small my_new_vg #Partition 1 10gb lvcreate -l 1562 -n medium my_new_vg #Partition 2 50gb lvcreate -l 1875 -n big my_new_vg #Partition 3 60gb lvs #Check creation
If you are lazy, and don't like maths, you can use estimated GB values:
lvcreate -L 10G -n small my_new_vg lvcreate -L 50G -n medium my_new_vg lvcreate -L 50G -n big my_new_vg #We won't have 60GB free lvextend -l +100%FREE /dev/my_new_vg/big #use up all the remaining space lvs #check creation
mkfs.ext4 /dev/volume_group_name/logical_volume_name #General Syntax
mkfs.ext4 /dev/my_new_vg/small
mkfs.ext4 /dev/my_new_vg/medium
mkfs.ext4 /dev/my_new_vg/big
mount /dev/volume_group_name/logical_volume_name /mnt/mountpoint/ #general syntax mount /dev/my_new_vg/small /mnt/small_LVM_volume mount /dev/my_new_vg/medium /mnt/medium_LVM_volume mount /dev/my_new_vg/big /mnt/big_LVM_volume df -h #confirm
nano /etc/fstab
/dev/mapper/volume_group_name-logical_volume_name /mnt/mountpoint filesystem defaults 0 0 /dev/mapper/my_new_vg-small /mnt/small ext4 defaults 0 0 /dev/mapper/my_new_vg-medium /mnt/medium ext4 defaults 0 0 /dev/mapper/my_new_vg-big /mnt/big ext4 defaults 0 0
NOTE THE VARIATION FROM BEFORE!! volume group name is part of the device file, not a folder. Save and exit The partitions will automount!