User Tools

Site Tools



This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
lvm [2013/05/24 22:55]
k2patel [LVM]
lvm [2017/03/23 15:56] (current)
k2patel [Add drive to LVM]
Line 15: Line 15:
 lvcreate -A n -L 24.5G -n lv-vol001 vg0 lvcreate -A n -L 24.5G -n lv-vol001 vg0
 mkfs.ext3 /​dev/​vg0/​lv-vol001 mkfs.ext3 /​dev/​vg0/​lv-vol001
 +==== Add drive to LVM ====
 +<code bash>
 +# Rescan the machine if not found.
 +echo "- - -" > /​sys/​class/​scsi_host/​host0/​scan
 +# Cont.
 +fdisk /dev/xvdk ## Comment "​Specify Type 8e by option t"
 +mkfs.ext3 /​dev/​xvdk1 ​
 +pvcreate /​dev/​xvdk1 ​
 +vgextend vg0 /dev/xvdk1
 +lvextend -L 300G /​dev/​vg0/​lv-vol001
 +lvextend -L+99.91G /​dev/​vg0/​lv-vol001
 +lvextend -l +100%FREE /​dev/​vg0/​lv-vol001
 +resize2fs /​dev/​vg0/​lv-vol001
 </​code>​ </​code>​
 ==== Reducing Size ==== ==== Reducing Size ====
Line 32: Line 49:
 e2fsck -y /​dev/​mapper/​VolGroup00-LogVol02 e2fsck -y /​dev/​mapper/​VolGroup00-LogVol02
 lvextend -L+512M /​dev/​mapper/​VolGroup00-LogVol02 lvextend -L+512M /​dev/​mapper/​VolGroup00-LogVol02
 +lvextend -l +100%FREE /​dev/​mapper/​VolGroup00-LogVol02
 resize2fs /​dev/​mapper/​VolGroup00-LogVol02 resize2fs /​dev/​mapper/​VolGroup00-LogVol02
 mount /opt mount /opt
Line 39: Line 58:
 <code bash | history> <code bash | history>
 +#rescan the device
 +echo "- - -" > /​sys/​class/​scsi_device/​1\:​0\:​0\:​0/​device/​rescan
 +#list devices and confirm you are going to update which drive.
 fdisk -l fdisk -l
-fdisk /dev/sda ## Comment "Specidy ​Type 8e by option t"+### Delete and recreate the partition 'make sure start block is the same'​ 
 +fdisk /dev/sda ## Comment "Specify ​Type 8e by option t" 
 +### Reprobe partition table. 
 +partprobe -s
 mkfs.ext3 /dev/sda1 mkfs.ext3 /dev/sda1
 vgextend VolGroup00 /dev/sda1 vgextend VolGroup00 /dev/sda1
lvm.1369436158.txt.gz · Last modified: 2013/05/24 22:55 by k2patel