Board logo

标题: CentOS7.8扩大/var分区 [打印本页]

作者: admin    时间: 2020-3-21 16:20     标题: CentOS7.8扩大/var分区

笺注:这是在 CentOS7.8安装KVM 的基础上进行的。 图片1.png VMware Workstation给虚拟机添加一块硬盘: 图片2.png 笺注:虚拟机重启后,才能识别新硬盘。 查看硬盘分区结构: lsblk 图片3.png 查看第二块硬盘的分区情况: fdisk -l /dev/sdb 图片4.png 查看系统默认的卷组: [root@ser1 ~]# vgdisplay --- Volume group --- VG Name centos System ID Format lvm2 Metadata Areas 1 Metadata Sequence No 5 VG Access read/write VG Status resizable MAX LV 0 Cur LV 4 Open LV 4 Max PV 0 Cur PV 1 Act PV 1 VG Size 59.80 GiB PE Size 4.00 MiB Total PE 15309 Alloc PE / Size 15308 / <59.80 GiB Free PE / Size 1 / 4.00 MiB VG UUID D1f1Nn-Y4qc-ZPqS-QpSk-mbHb-SQmZ-Gd1R72 查看系统所有的逻辑卷: [root@ser1 ~]# lvdisplay --- Logical volume --- LV Path /dev/centos/swap LV Name swap VG Name centos LV UUID dqH4dF-Yfc1-OYDo-Mcku-jKc0-S367-F5Xoh5 LV Write Access read/write LV Creation host, time ser1.q7.com, 2020-08-11 01:38:35 +0800 LV Status available # open 2 LV Size 8.00 GiB Current LE 2048 Segments 1 Allocation inherit Read ahead sectors auto - currently set to 8192 Block device 253:1 --- Logical volume --- LV Path /dev/centos/var LV Name var VG Name centos LV UUID qHu29I-pckv-X6eo-0PgS-ni1P-iNdG-O3rp3O LV Write Access read/write LV Creation host, time ser1.q7.com, 2020-08-11 01:38:35 +0800 LV Status available # open 1 LV Size 10.00 GiB Current LE 2560 Segments 1 Allocation inherit Read ahead sectors auto - currently set to 8192 Block device 253:2 --- Logical volume --- LV Path /dev/centos/home LV Name home VG Name centos LV UUID o7ZXdE-8XmF-Wrmc-rvo9-YutT-a5e5-I8ZfIH LV Write Access read/write LV Creation host, time ser1.q7.com, 2020-08-11 01:38:36 +0800 LV Status available # open 1 LV Size 18.00 GiB Current LE 4608 Segments 1 Allocation inherit Read ahead sectors auto - currently set to 8192 Block device 253:3 --- Logical volume --- LV Path /dev/centos/root LV Name root VG Name centos LV UUID fA593N-3bE5-8dgo-Yabg-bcuM-mMQL-7Rm4Lu LV Write Access read/write LV Creation host, time ser1.q7.com, 2020-08-11 01:38:36 +0800 LV Status available # open 1 LV Size <23.80 GiB Current LE 6092 Segments 1 Allocation inherit Read ahead sectors auto - currently set to 8192 Block device 253:0 查看某个的逻辑卷: [root@ser1 ~]# lvdisplay /dev/centos/var --- Logical volume --- LV Path /dev/centos/var LV Name var VG Name centos LV UUID qHu29I-pckv-X6eo-0PgS-ni1P-iNdG-O3rp3O LV Write Access read/write LV Creation host, time ser1.q7.com, 2020-08-11 01:38:35 +0800 LV Status available # open 1 LV Size 10.00 GiB Current LE 2560 Segments 1 Allocation inherit Read ahead sectors auto - currently set to 8192 Block device 253:2 创建物理卷: [root@ser1 ~]# pvcreate /dev/sdb Physical volume "/dev/sdb" successfully created. 扩大卷组: [root@ser1 ~]# vgextend centos /dev/sdb Volume group "centos" successfully extended 扩展逻辑卷(不能把空间全部分完,要留0.1G!) [root@ser1 ~]# lvextend -L +29.9G /dev/centos/var Rounding size to boundary between physical extents: 29.90 GiB. Size of logical volume centos/var changed from 10.00 GiB (2560 extents) to 39.90 GiB (10215 extents). Logical volume centos/var successfully resized. 刷新xfs文件系统: xfs_growfs /var 图片5.png /var分区扩展成功: [root@ser1 ~]# df -hT 文件系统 类型 容量 已用 可用 已用% 挂载点 devtmpfs devtmpfs 1.9G 0 1.9G 0% /dev tmpfs tmpfs 1.9G 0 1.9G 0% /dev/shm tmpfs tmpfs 1.9G 13M 1.9G 1% /run tmpfs tmpfs 1.9G 0 1.9G 0% /sys/fs/cgroup /dev/mapper/centos-root xfs 24G 3.9G 20G 17% / /dev/sda1 xfs 197M 147M 51M 75% /boot /dev/mapper/centos-home xfs 18G 37M 18G 1% /home /dev/mapper/centos-var xfs 40G 223M 40G 1% /var tmpfs tmpfs 378M 24K 378M 1% /run/user/0 备注:/var分区扩展无需重启系统;重启系统后,系统也正常。 相关文章: CentOS8_LVM_扩大根分区 ################################# ################################# 亲,学习研究也要劳逸结合哦,来我微店逛逛,买点东西好好犒劳犒劳自己和家人吧^_^^_^ 苏泊尔多功能电热锅韩式电火锅8-10人家用电炒锅不粘锅电锅电烤锅 guo.png 苏泊尔电火锅多功能家用电热锅不沾锅一体电煮锅宿舍4-6人 huoguo.png

图片附件: guo.png (2020-5-19 14:10, 470.68 KB) / 下载次数 50
http://blog.zhuohua.store/attachment.php?aid=7106&k=70a57acb09b37182bb16aad8929988fc&t=1714224138&sid=OIuuiH



图片附件: huoguo.png (2020-5-19 14:10, 444 KB) / 下载次数 57
http://blog.zhuohua.store/attachment.php?aid=7107&k=0bd8f9312f3eb7bc3b1e7f4ed240ac3a&t=1714224138&sid=OIuuiH



图片附件: 图片1.png (2020-8-17 10:38, 66.86 KB) / 下载次数 165
http://blog.zhuohua.store/attachment.php?aid=10522&k=f1c9f761e3fa26f8662b7299cbf959ec&t=1714224138&sid=OIuuiH



图片附件: 图片2.png (2020-8-17 10:38, 12.54 KB) / 下载次数 175
http://blog.zhuohua.store/attachment.php?aid=10523&k=2a73971335fc71c8b01347db2b24b1bb&t=1714224138&sid=OIuuiH



图片附件: 图片3.png (2020-8-17 10:39, 20.04 KB) / 下载次数 157
http://blog.zhuohua.store/attachment.php?aid=10524&k=f14dd9e3a37e855c846d0936da477964&t=1714224138&sid=OIuuiH



图片附件: 图片4.png (2020-8-17 10:39, 8.95 KB) / 下载次数 171
http://blog.zhuohua.store/attachment.php?aid=10525&k=0a62fc952e942bebcecb075661404f68&t=1714224138&sid=OIuuiH



图片附件: 图片5.png (2020-8-17 10:40, 54.89 KB) / 下载次数 166
http://blog.zhuohua.store/attachment.php?aid=10526&k=2626d3d8d942edf815f455ae440ec13b&t=1714224138&sid=OIuuiH






欢迎光临 blog.zhuohua.store (http://blog.zhuohua.store/) Powered by Discuz! 7.2