博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
解决 /dev/mapper/centos-root 空间不足的问题
阅读量:5152 次
发布时间:2019-06-13

本文共 3071 字,大约阅读时间需要 10 分钟。

Last login: Mon Feb 25 04:53:40 2019 from 10.0.0.3

[root@vmhzpmysql ~]# df -hl
Filesystem Size Used Avail Use% Mounted on
/dev/mapper/centos-root 4.4G 3.5G 962M 79% /
devtmpfs 483M 0 483M 0% /dev
tmpfs 496M 0 496M 0% /dev/shm
tmpfs 496M 7.0M 489M 2% /run
tmpfs 496M 0 496M 0% /sys/fs/cgroup
/dev/sda1 1014M 156M 859M 16% /boot
tmpfs 100M 0 100M 0% /run/user/0
[root@vmhzpmysql ~]# df -hl /home
Filesystem Size Used Avail Use% Mounted on
/dev/mapper/centos-root 4.4G 3.5G 962M 79% /

[root@vmhzpmysql ~]# cd /

[root@vmhzpmysql /]# du -h -x --max-depth=1
35M ./etc
40K ./root
405M ./var
0 ./tmp
3.0G ./usr
0 ./home
0 ./media
0 ./mnt
0 ./opt
0 ./srv
3.4G .

[root@vmhzpmysql ~]# ls /dev/sd*

/dev/sda /dev/sda1 /dev/sdb /dev/sdb1
[root@vmhzpmysql ~]# lvs
LV VG Attr LSize Pool Origin Data% Meta% Move Log Cpy%Sync Convert
root centos -wi-ao---- 4.39g
swap centos -wi-ao---- 616.00m
[root@vmhzpmysql ~]# vgs
VG #PV #LV #SN Attr VSize VFree
centos 1 2 0 wz--n- <5.00g 0
[root@vmhzpmysql ~]#

---在虚拟机上新增一块2G硬盘,后重启系统:

[root@vmhzpmysql /]# reboot

Last login: Mon Feb 25 05:48:49 2019 from 10.0.0.3
[root@vmhzpmysql ~]# ls /dev/sd*
/dev/sda /dev/sda1 /dev/sdb /dev/sdb1 /dev/sdc
[root@vmhzpmysql ~]# pvcreate /dev/sdc
Physical volume "/dev/sdc" successfully created.
[root@vmhzpmysql ~]# vps
-bash: vps: command not found
[root@vmhzpmysql ~]# vgs
VG #PV #LV #SN Attr VSize VFree
centos 1 2 0 wz--n- <5.00g 0
[root@vmhzpmysql ~]# vgextend centos /dev/sdc
Volume group "centos" successfully extended
[root@vmhzpmysql ~]# vgs
VG #PV #LV #SN Attr VSize VFree
centos 2 2 0 wz--n- 6.99g <2.00g
[root@vmhzpmysql ~]# lvs
LV VG Attr LSize Pool Origin Data% Meta% Move Log Cpy%Sync Convert
root centos -wi-ao---- 4.39g
swap centos -wi-ao---- 616.00m
[root@vmhzpmysql ~]# lvextend -L +2G /dev/mapper/centos-root
Insufficient free space: 512 extents needed, but only 511 available
[root@vmhzpmysql ~]# lvextend -L +1.9G /dev/mapper/centos-root
Rounding size to boundary between physical extents: 1.90 GiB.
Size of logical volume centos/root changed from 4.39 GiB (1125 extents) to <6.30 GiB (1612 extents).
Logical volume centos/root successfully resized.
[root@vmhzpmysql ~]# vgs
VG #PV #LV #SN Attr VSize VFree
centos 2 2 0 wz--n- 6.99g 96.00m
[root@vmhzpmysql ~]# xfs_growfs /dev/mapper/centos-root
meta-data=/dev/mapper/centos-root isize=512 agcount=4, agsize=288000 blks
= sectsz=512 attr=2, projid32bit=1
= crc=0 finobt=0 spinodes=0
data = bsize=4096 blocks=1152000, 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 1152000 to 1650688
[root@vmhzpmysql ~]# df -hl
Filesystem Size Used Avail Use% Mounted on
/dev/mapper/centos-root 6.3G 3.5G 2.9G 55% /
devtmpfs 483M 0 483M 0% /dev
tmpfs 496M 0 496M 0% /dev/shm
tmpfs 496M 7.0M 489M 2% /run
tmpfs 496M 0 496M 0% /sys/fs/cgroup
/dev/sda1 1014M 156M 859M 16% /boot
tmpfs 100M 0 100M 0% /run/user/0

转载于:https://www.cnblogs.com/tiantom/p/10428359.html

你可能感兴趣的文章
并发编程系列小结(线程安全,synchronized,脏读,线程间的通信wait/notify,线程的三种实现方式Demo,可替代wait/notify的方法)...
查看>>
简单的Windows应用程序命名规则
查看>>
java接收数据接口
查看>>
将.csv文件用Excel 2016打开
查看>>
Period[HDU1358]
查看>>
[Offer收割]编程练习赛37
查看>>
对齐方式
查看>>
Mybatis plus中一个框多条件查询 SQL拼接
查看>>
WPF Uri
查看>>
android 获取IMEI号
查看>>
【设计模式】—— 外观模式Facade
查看>>
Log4j官方文档翻译(六、日志的级别)
查看>>
JSON定义
查看>>
你不知道的JavaScript之类型
查看>>
工作流,sharepoint 开发流程
查看>>
[转]Android推送方案分析(MQTT/XMPP/GCM)
查看>>
使用方向变换(directional transform)图像分块压缩感知
查看>>
朴素贝叶斯法
查看>>
YCbCr-YUV
查看>>
Win10 + MySQL + Tableu + PPT + 可视化方案
查看>>