Extend device using LVM
How to Extend LVM Partition with lvextend command
PURPOSE: All documents are provided on this Blog just for educational purposes only. Please make sure that you run it in your test environment before to move on to production environment.
Extent physical volume using LVM
# Use VCenter and give the disk.ls -l /dev/disk/by-path/ <<== Scan the correct scsi device
fdisk /dev/sdc <<== With the command another disk is recognized. Example: sdc1 or sdc2 recognized
n #n add a new partition
p #p print the partition table
enter
enter
enter
w #w write table to disk and exit
partprobe
pvscan
pvscan
xfs_growfs /data
Done:
-------------------
Steps for Physical Host extend LVM File system with multipath.
rescan-scsi-bus.sh -a -w -m
multipath -ll
#LUN WWID finden. You do with pipe
lsscsi -i -s
vgdisplay
lvdisplay
vi /etc/multipath.conf # add new LUN ID
service multipathd reload
multipath -ll
parted /dev/mapper/tst-03DATA_03
GNU Parted 3.1
Using /dev/mapper/tst-01DATA_03
Welcome to GNU Parted! Type 'help' to view a list of commands.
(parted) mklabel gpt
(parted) mkpart tst-03DATA_03 2048s 100%
(parted) align-check opt 1
1 aligned
(parted) quit
ll /dev/mapper/
pvcreate /dev/mapper/tst-03DATA_03p1
You can use multiple PV in one command.
pvcreate /dev/mapper/xxx /dev/mapper/xxx
pvscan
vgs
vgextend vg_data /dev/mapper/tst-03DATA_03p1
You can as well as extend multiple VG as one command
vgextend /dev/mapper/xxx /dev/mapper/xxx
lvextend --resizefs -l +100%FREE /dev/vg_data/lv_data
df -hl
Done
Your comments are most valuable and it would help me to come up with better posts.