:より転載http://blog.itpub.net/25469263/viewspace-2662215/
centos7は、ルートパーティションを拡張するためにVGの方法を使用しました
PVを作成します。1.
FDISKは/ dev / sdbと
Nの増加入力パーティション
Pへの入力タイプ:プライマリパーティション
入力パーティション番号が1に設定されている1
デフォルトのサイズを入力します。
デフォルトのサイズを入力します。
入力ワットを終了
2. PV添加VG、膨張VGのサイズの等価
拡張VG、コマンドvgextendを使用
1
2
3
|
[root@localhost ~]
# vgextend centos /dev/sdb1
Volume group
"centos"
successfully extended
vgextend名字命令接的vg的名字,后面是磁盘的位置
|
3.私たちは、VGSの表情で、ボリュームVGを成功裏に拡大しています
1
2
3
4
5
6
7
|
[root@localhost ~]
# vgs
VG
#PV #LV #SN Attr VSize VFree
centos 2 2 0 wz--n- 39.50g 20.04g
[root@localhost ~]
# lvs
LV VG Attr LSize Pool Origin Data% Meta% Move Log Cpy%Sync Convert
root centos -wi-ao---- 17.47g
swap centos -wi-ao---- 2.00g <br><br>虽然我们把vg扩展了,但是lv还没有扩展
|
コマンドは、lvextendを使用して4.拡張LV、
1
2
3
|
[root@localhost ~]
# lvextend -L +20G /dev/mapper/centos-root
|
ビューLVサイズ
1
2
3
4
|
[root@localhost ~]
# lvs
LV VG Attr LSize Pool Origin Data% Meta% Move Log Cpy%Sync Convert
root centos -wi-ao---- 37.47g
swap centos -wi-ao---- 2.00g
|
ビューには何も変更を-hないDF
1
2
3
4
5
6
7
8
9
|
[root@localhost ~]
# df -h
文件系统 容量 已用 可用 已用% 挂载点
/dev/mapper/centos-root
18G 1.1G 17G 6% /
devtmpfs 479M 0 479M 0%
/dev
tmpfs 489M 0 489M 0%
/dev/shm
tmpfs 489M 6.7M 483M 2%
/run
tmpfs 489M 0 489M 0%
/sys/fs/cgroup
/dev/sda1
497M 125M 373M 25%
/boot
tmpfs 98M 0 98M 0%
/run/user/0
<br><br>没有变化。
|
私たちが使いたいので、[ルート@ localhostの〜]#xfs_growfsは/ dev /マッパー/ CentOSのルートを再読み込みサイズにシステムコマンド
1
2
3
4
5
6
7
8
9
10
11
|
[root@localhost ~]
# xfs_growfs /dev/mapper/centos-root
meta-data=
/dev/mapper/centos-root
isize=256 agcount=4, agsize=1144832 blks
= sectsz=512 attr=2, projid32bit=1
= crc=0 finobt=0
data = bsize=4096 blocks=4579328, imaxpct=25
= sunit=0 swidth=0 blks
naming =version 2 bsize=4096 ascii-ci=0 ftype=0
log =internal bsize=4096 blocks=2560, version=2
= sectsz=512 sunit=0 blks, lazy-count=1
realtime =none extsz=4096 blocks=0, rtextents=0
data blocks changed from 4579328 to 9822208
|
そして、-hビューdfを使用します
1
2
3
4
5
6
7
8
9
|
[root@localhost ~]
# df -h
文件系统 容量 已用 可用 已用% 挂载点
/dev/mapper/centos-root
38G 1.1G 37G 3% /
devtmpfs 479M 0 479M 0%
/dev
tmpfs 489M 0 489M 0%
/dev/shm
tmpfs 489M 6.7M 483M 2%
/run
tmpfs 489M 0 489M 0%
/sys/fs/cgroup
/dev/sda1
497M 125M 373M 25%
/boot
tmpfs 98M 0 98M 0%
/run/user/0
|
ここでは、成功し拡大しています。
注:私たちは新しいで、VG、LV VGの独自のセットを生成し、生成することができます
vgcreate新しいグループVGを作成
新しいの新しいLVのVGを作成するためには、lvcreateが、VGの名前を指定します
一つだけVG PVが直接vgremove使用されている場合、PVのVGから削除vgreduce