【CentOS7根目录磁盘扩容(/dev/mapper/centos-root 空间不足)】书史足自悦,安用勤与劬。这篇文章主要讲述CentOS7根目录磁盘扩容(/dev/mapper/centos-root 空间不足)相关的知识,希望能为你提供帮助。
今天在给测试环境搭建k8s系统时,发现master根目录磁盘空间不足,需要扩容,记录如下。
# 查看根分区大小 [root@master ~]# df -h FilesystemSizeUsed Avail Use% Mounted on devtmpfs63G063G0% /dev tmpfs63G063G0% /dev/shm tmpfs63G1.3G62G2% /run tmpfs63G063G0% /sys/fs/cgroup /dev/mapper/cl_geekthings-root50G38G13G76% / /dev/sda11014M311M704M31% /boot /dev/mapper/cl_geekthings-home918G12G906G2% /home tmpfs13G12K13G1% /run/user/42 tmpfs13G013G0% /run/user/0 overlay50G38G13G76% /var/lib/docker/overlay2/70dffe831895bb55d79b4a8f483364a4f736637ccb2f6694f1cf82ba7ff1743d/merged# 查看磁盘编号 [root@master ~]# ls /dev/sd* /dev/sda/dev/sda1/dev/sda2# 这里在vMware vCenter中新增一块硬盘(编辑-> 新增设备)再次查看磁盘 [root@master ~]# ls /dev/sd* /dev/sda/dev/sda1/dev/sda2/dev/sdb# 创建pv [root@master ~]# pvcreate /dev/sdb Physical volume "/dev/sdb" successfully created.# 查看vg组 [root@master ~]# vgs VG#PV #LV #SN AttrVSizeVFree cl_geekthings130 wz--n- < 999.00g 4.00m# 扩展vg [root@master ~]# vgextend cl_geekthings /dev/sdb Volume group "cl_geekthings" successfully extended[root@master ~]# vgs VG#PV #LV #SN AttrVSize VFree cl_geekthings230 wz--n- 1.17t 200.00g# 扩展lv [root@master ~]# lvextend -L +200G /dev/mapper/cl_geekthings-root Size of logical volume cl_geekthings/root changed from 50.00 GiB (12800 extents) to 250.00 GiB (64000 extents). Logical volume cl_geekthings/root successfully resized.# 系统重新读取大小 [root@master ~]# xfs_growfs /dev/mapper/cl_geekthings-root meta-data=https://www.songbingjia.com/dev/mapper/cl_geekthings-root isize=512agcount=4, agsize=3276800 blks =sectsz=512attr=2, projid32bit=1 =crc=1finobt=0 spinodes=0 data=bsize=4096blocks=13107200, imaxpct=25 =sunit=0swidth=0 blks naming=version 2bsize=4096ascii-ci=0 ftype=1 log=internalbsize=4096blocks=6400, version=2 =sectsz=512sunit=0 blks, lazy-count=1 realtime =noneextsz=4096blocks=0, rtextents=0 data blocks changed from 13107200 to 65536000# 查看扩容是否成功 [root@master ~]# df -h FilesystemSizeUsed Avail Use% Mounted on devtmpfs63G063G0% /dev tmpfs63G063G0% /dev/shm tmpfs63G1.3G62G2% /run tmpfs63G063G0% /sys/fs/cgroup /dev/mapper/cl_geekthings-root250G38G213G16% / /dev/sda11014M311M704M31% /boot /dev/mapper/cl_geekthings-home918G12G906G2% /home tmpfs13G12K13G1% /run/user/42 tmpfs13G013G0% /run/user/0 overlay250G38G213G16% /var/lib/docker/overlay2/70dffe831895bb55d79b4a8f483364a4f736637ccb2f6694f1cf82ba7ff1743d/merged [root@master ~]# lsblk NAMEMAJ:MIN RMSIZE RO TYPE MOUNTPOINT sda8:001000G0 disk ├─sda18:101G0 part /boot └─sda28:20999G0 part ├─cl_geekthings-root 253:00250G0 lvm/ ├─cl_geekthings-swap 253:1031.5G0 lvm └─cl_geekthings-home 253:20 917.5G0 lvm/home sdb8:160200G0 disk └─cl_geekthings-root253:00250G0 lvm/ sr011:014.1G0 rom
推荐阅读
- CSAPP第八章
- 如何通过UX设计吸引电子商务购物者
- UX和Web可访问性的重要性
- 通过这些Photoshop教程掌握热门设计趋势
- 如何在设计中有效引导自我
- 未来的无按钮UI设计
- 完善你的UX设计流程-原型设计指南
- 增强用户流程– UX分析指南
- 发挥灵感-情绪板指南