操作系统:
[root@single ~]# lsb_release -a
LSB Version: :base-4.0-amd64:base-4.0-noarch:core-4.0-amd64:core-4.0-noarch:graphics-4.0-amd64:graphics-4.0-noarch:printing-4.0-amd64:printing-4.0-noarch
Distributor ID: OracleServer
Description: Oracle Linux Server release 6.6
Release: 6.6
Codename: n/a
模拟测试:
新增加一块4T的硬盘。
分区为一个1T的分区,创建为逻辑卷并挂载到根目录下面。
分区为另外一个3T的分区,暂时不使用。
[root@single ~]# df -h
Filesystem Size Used Avail Use% Mounted on
/dev/mapper/vg_single-LogVol00
20G 17G 2.1G 90% /
tmpfs 995M 475M 521M 48% /dev/shm
/dev/sda1 477M 64M 384M 15% /boot
/dev/mapper/vg_single-LogVol02
2.9G 4.9M 2.8G 1% /tmp
1.开始分区
parted /dev/sdb
help
mklabel gpt
parted sdb1 1G 1024G
parted sdb2 1024G 4096G
Model: VMware, VMware Virtual S (scsi)
Disk /dev/sdb: 4398GB
Sector size (logical/physical): 512B/512B
Partition Table: gpt
Number Start End Size File system Name Flags
1 1000MB 1024GB 1023GB sdb1
2 1024GB 4096GB 3072GB sdb2
2.创建逻辑卷
[root@single ~]# pvcreate /dev/sdb1
Physical volume "/dev/sdb1" successfully created
[root@single ~]# vgextend vg_single /dev/sdb1
Volume group "vg_single" successfully extended
3.扩容目录
[root@single ~]# lvextend -L +900G /dev/mapper/vg_single-LogVol00
Size of logical volume vg_single/LogVol00 changed from 20.00 GiB (5120 extents) to 920.00 GiB (235520 extents).
Logical volume LogVol00 successfully resized
[root@single ~]# resize2fs /dev/mapper/vg_single-LogVol00
resize2fs 1.43-WIP (20-Jun-2013)
Filesystem at /dev/mapper/vg_single-LogVol00 is mounted on /; on-line resizing required
old_desc_blocks = 2, new_desc_blocks = 58
The filesystem on /dev/mapper/vg_single-LogVol00 is now 241172480 blocks long.
4.验证
[root@single ~]# df -h
Filesystem Size Used Avail Use% Mounted on
/dev/mapper/vg_single-LogVol00
906G 17G 852G 2% /
tmpfs 995M 80K 995M 1% /dev/shm
/dev/sda1 477M 64M 384M 15% /boot
/dev/mapper/vg_single-LogVol02
2.9G 4.9M 2.8G 1% /tmp