Tuesday, February 22, 2011

Extend Lvsize by adding new Hard disk

 
Extend Lvsize by adding new Hard disk


Extend VG Size by Adding new Hard disk /dev/hdc

Create New hard disk drive and convert it int lvm

# fdisk -l
# fdisk /dev/sdc
p
n
Enter
Enter
t
8e
w

Extend pv size

# fdisk -l
# lvmdiskscan

skip…
/dev/sdc1 [ 100.00 GB]
…skip…
# pvcreate /dev/sdc1
Physical volume “/dev/sdc1″ successfully created


Extend vgsize
# vgdisplay
--- Volume group ---
VG Name amco
System ID
Format lvm2
…skip…



# vgextend vgname_whatever /dev/sdc1
Volume group “VolGroup01″ successfully extended

Extend For each Lv size
# lvextend -L +2G /dev/vgname/lvname
Extending logical volume LogVol00 to 2 GB
Logical volume LogVol00 successfully resized
OPTIONAL
Extend the logical volume to use the full size of the volume group:
# lvm lvextend -l +100%FREE /dev/VolGroup01/LogVol00
Extending logical volume LogVol00 to 449.99 GB
Logical volume LogVol00 successfully resized
resize the partition for the OS to recognize the new size
# df -h
Filesystem Size Used Avail Use% Mounted on
/dev/sda2 155G 569M 146G 1% /
/dev/sda1 99M 9.0M 85M 10% /boot
tmpfs 95M 0 95M 0% /dev/shm
/dev/mapper/amco-g 2.0G 36M 1.9G 2% /mnt/amco/g
/dev/mapper/amco-h 2.0G 36M 1.9G 2% /mnt/amco/h
/dev/mapper/amco-j 20G 173M 19G 1% /mnt/amco/j
/dev/mapper/amco-k 20G 173M 19G 1% /mnt/amco/k
/dev/mapper/amco-l 21G 394M 19G 3% /mnt/amco/l
# resize2fs -p /dev/mapper/volgroupname-logvolname


No comments:

Post a Comment