赞
踩
目录
1.卸载/home文件
2.删除逻辑卷
3.vgdisplay查看内存空间
4.安装psmisc
5.将剩余的空间分配到根目录的逻辑卷上
6.创建文件系统
7.查看是否成功
今天在写hive的时候,发现跑不动了,检查hadoop是否进入了安全模式,发现安全模式是开启的,使用关闭命令也无法关闭,最后是/dev/mapper/centos-root目录满了,解决办法如下:
df -h
Filesystem Size Used Avail Use% Mounted on
/dev/mapper/centos-root 50G 50G 54M 100% /
devtmpfs 7.8G 0 7.8G 0% /dev
tmpfs 7.8G 0 7.8G 0% /dev/shm
tmpfs 7.8G 8.7M 7.8G 1% /run
tmpfs 7.8G 0 7.8G 0% /sys/fs/cgroup
/dev/sda1 1014M 143M 872M 15% /boot
/dev/mapper/centos-home 62G 33M 62G 1% /home
tmpfs 1.6G 0 1.6G 0% /run/user/0
1.卸载/home文件
[root@lxm147 ~]# umount /home
2.删除逻辑卷
[root@lxm147 ~]# lvremove /dev/centos/home
Do you really want to remove active logical volume centos/home? [y/n]: y
Logical volume "home" successfully removed
3.vgdisplay查看内存空间
[root@lxm147 ~]# 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 2
Open LV 2
Max PV 0
Cur PV 1
Act PV 1
VG Size <119.00 GiB
PE Size 4.00 MiB
Total PE 30463
Alloc PE / Size 14816 / <57.88 GiB
Free PE / Size 15647 / 61.12 GiB
VG UUID 9YfXld-R9GG-qJoy-5tsP-CkuC-iaWI-W6nKb0
4.安装psmisc
yum install -y psmisc
5.将剩余的空间分配到根目录的逻辑卷上
[root@lxm147 ~]# lvextend -L +61G /dev/mapper/centos-root
Size of logical volume centos/root changed from 50.00 GiB (12800 extents) to 111.00 GiB (28416 extents).
Logical volume centos/root successfully resized.
6.创建文件系统
[root@lxm147 ~]# xfs_growfs /dev/mapper/centos-root
meta-data=/dev/mapper/centos-root isize=512 agcount=4, agsize=3276800 blks
= sectsz=512 attr=2, projid32bit=1
= crc=1 finobt=0 spinodes=0
data = bsize=4096 blocks=13107200, imaxpct=25
= sunit=0 swidth=0 blks
naming =version 2 bsize=4096 ascii-ci=0 ftype=1
log =internal bsize=4096 blocks=6400, version=2
= sectsz=512 sunit=0 blks, lazy-count=1
realtime =none extsz=4096 blocks=0, rtextents=0
data blocks changed from 13107200 to 29097984
7.查看是否成功
[root@lxm147 ~]# df -h
Filesystem Size Used Avail Use% Mounted on
/dev/mapper/centos-root 111G 50G 62G 45% /
devtmpfs 7.8G 0 7.8G 0% /dev
tmpfs 7.8G 0 7.8G 0% /dev/shm
tmpfs 7.8G 8.6M 7.8G 1% /run
tmpfs 7.8G 0 7.8G 0% /sys/fs/cgroup
/dev/sda1 1014M 143M 872M 15% /boot
tmpfs 1.6G 0 1.6G 0% /run/user/0
完成!!!
1.再次重启服务器按住Esc 查看启动进度
2.问题出现time超时,无法挂载home.device设备
a start job is running for dev-mapper-centos\x2dhome.device
Job dev-mapper-centos\x2dhome.device/start failed with result 'timoue'
job selinux-policy-migrate-local-changes@targeted.service/start failed with result 'dependency'
3.或者进入系统查看/var/log/boot.log启动日志
4.检查启动时磁盘挂载文件/etc/fstab,多出的home.device设备注释掉即可。
————————————————
版权声明:本文为CSDN博主「雷神乐乐」的原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接及本声明。
原文链接:https://blog.csdn.net/Helen_1997_1997/article/details/130582869
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。