vg组增加磁盘

初始化磁盘

查看所有磁盘
fdisk -l

Disk /dev/sda: 55.8 GB, 55834574848 bytes
255 heads, 63 sectors/track, 6788 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x000cf736

Device Boot Start End Blocks Id System
/dev/sda1 * 1 26 204800 83 Linux
Partition 1 does not end on cylinder boundary.
/dev/sda2 26 6789 54320128 8e Linux LVM

Disk /dev/sdb: 21.5 GB, 21474836480 bytes
255 heads, 63 sectors/track, 2610 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000

新添加的是/dev/sdb磁盘
初始化磁盘
pvcreate /dev/sdb
提示
Physical volume "/dev/sdb" successfully created

查询磁盘信息
pvdisplay

— Physical volume —
PV Name /dev/sda2
VG Name vg_home
PV Size 51.80 GiB / not usable 3.00 MiB
Allocatable yes
PE Size 4.00 MiB
Total PE 13261
Free PE 973
Allocated PE 12288
PV UUID n3opJu-1JHT-ocQm-JIon-UpBC-6hBn-IJubN2

"/dev/sdb" is a new physical volume of "20.00 GiB"
— NEW Physical volume —
PV Name /dev/sdb
VG Name

PV Size 20.00 GiB
Allocatable NO
PE Size 0

Total PE 0
Free PE 0
Allocated PE 0
PV UUID OUkoM7-C1th-SZHJ-sOFk-JSr4-MSc1-jKgAqO

查询当前vg情况
pvscan

PV /dev/sda2 VG vg_home lvm2 [51.80 GiB / 3.80 GiB free]
PV /dev/sdb lvm2 [20.00 GiB]
Total: 2 [71.80 GiB] / in use: 1 [51.80 GiB] / in no VG: 1 [20.00 GiB]

添加 /dev/sdb磁盘到vg_home组
vgextend vg_home /dev/sdb
显示
Volume group "vg_home" successfully extended

查询完成后vg状态
pvscan

PV /dev/sda2 VG vg_home lvm2 [51.80 GiB / 3.80 GiB free]
PV /dev/sdb VG vg_home lvm2 [20.00 GiB / 20.00 GiB free]
Total: 2 [71.80 GiB] / in use: 2 [71.80 GiB] / in no VG: 0 [0 ]

添加空间
从vg_home 中建立8g fra空间
lvcreate -L 8G -n FRA vg_home

Logical volume "FRA" created

初始化FRA空间
mkfs -t ext4 /dev/vg_home/fra

mke2fs 1.41.12 (17-May-2010)
Filesystem label=
OS type: Linux
Block size=4096 (log=2)
Fragment size=4096 (log=2)
Stride=0 blocks, Stripe width=0 blocks
524288 inodes, 2097152 blocks
104857 blocks (5.00%) reserved for the super user
First data block=0
Maximum filesystem blocks=2147483648
64 block groups
32768 blocks per group, 32768 fragments per group
8192 inodes per group
Superblock backups stored on blocks:
32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632

Writing inode tables: done

Creating journal (32768 blocks): done
Writing superblocks and filesystem accounting information: done

This filesystem will be automatically checked every 31 mounts or
180 days, whichever comes first. Use tune2fs -c or -i to override.

接下来只需mount即可

后将参数修改入/etc/fstab就可以开机自动加载了