Linux How to add a new disk to LVM

时间:2023-01-22 03:47:14

转自:http://blog.itpub.net/7191998/viewspace-772060/

1.check old diskspace and device list
df -hal
free -m
fdisk -l

2.add a new hardsik into server
fdisk /dev/sdb(hdb)
action: n #create a new partition
action: p #primary partition
action: 1-4 # how many partition
action: enter #default is ok

action: t # change a partition's system id
action: 8e # Linux LVM

action: w #save and exit
3.active the new disk as below or reboot
partprobe ro reboot
fdisk -l

4.check the LVM -create the PV and add into Group
vgs
pvcreate /dev/sdb1
vgextend VolGroup /dev/sdb1
vgdisplay

5.create and resize and effect LV
lvresize -L +21.96G /dev/VolGroup00/LogVol00
resize2fs /dev/VolGroup00/LogVol00