当前位置:网站首页>Lunix reallocates root and home space memory
Lunix reallocates root and home space memory
2022-07-02 10:31:00 【Lucky lucky】
View virtual machine disk distribution
[root@data ~]# df -lh
file system Capacity Already used You can use Already used % Mount point
devtmpfs 4.7G 0 4.7G 0% /dev
tmpfs 4.7G 0 4.7G 0% /dev/shm
tmpfs 4.7G 13M 4.7G 1% /run
tmpfs 4.7G 0 4.7G 0% /sys/fs/cgroup
/dev/mapper/centos-root 50G 44G 6.3G 88% /
/dev/mapper/centos-home 46G 33M 46G 1% /home
/dev/sda1 1014M 149M 866M 15% /boot
tmpfs 959M 0 959M 0% /run/user/0
overlay 50G 44G 6.3G 88% /var/lib/docker/overlay2/25621b52617632efeb043f119ed67c0a0b6c8328d7835d11fa74395d0090866d/merged
overlay 50G 44G 6.3G 88% /var/lib/docker/overlay2/4b60531fff0d2eb5abb3569ea4cd03c480b0562071782477a0da0f5bec14062c/merged
overlay 50G 44G 6.3G 88% /var/lib/docker/overlay2/00e04c30d59668fa38acee4cde5ffb17ba4783bc2a43901750199b5d6de309f9/merged
Backup home Partition all files
[root@singlelucky ~]# tar cvf /tmp/home.tar /home
-- uninstall /home, If you can't uninstall , Terminate use first /home File system process --
-- It is best to restart the virtual machine , Make the virtual machine in the initial state --
> /home/
> /home/zhaozuozuo/
> /home/zhaozuozuo/.bash_logout
> /home/zhaozuozuo/.bash_profile
> /home/zhaozuozuo/.bashrc
> ;
uninstall home Partition
[root@singlelucky ~]# yum install psmisc
Loaded plug-in :fastestmirror
Determining fastest mirrors
* base: mirrors.njupt.edu.cn
* extras: mirrors.njupt.edu.cn
* updates: mirrors.njupt.edu.cn
base | 3.6 kB 00:00:00
docker-ce-stable | 3.5 kB 00:00:00
extras | 2.9 kB 00:00:00
updates | 2.9 kB 00:00:00
(1/2): docker-ce-stable/7/x86_64/primary_db | 63 kB 00:00:00
(2/2): updates/7/x86_64/primary_db | 9.6 MB 00:00:02
Resolving dependencies
--> Checking transactions
---> software package psmisc.x86_64.0.22.20-17.el7 Will be install
--> Resolve dependency complete
Dependency resolution
==================================================================================================================================
Package framework edition Source size
==================================================================================================================================
Installing :
psmisc x86_64 22.20-17.el7 base 141 k
Business summary
==================================================================================================================================
install 1 software package
Total Downloads :141 k
Installation size :475 k
Is this ok [y/d/N]: y
Downloading packages:
psmisc-22.20-17.el7.x86_64.rpm | 141 kB 00:00:00
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
Installing : psmisc-22.20-17.el7.x86_64 1/1
Verification in progress : psmisc-22.20-17.el7.x86_64 1/1
already installed :
psmisc.x86_64 0:22.20-17.el7
complete !
[root@singlelucky ~]# fuser -km /home/
[root@singlelucky ~]# umount /home
Delete /home Where lv
[root@singlelucky ~]# lvremove /dev/mapper/centos-home
Do you really want to remove active logical volume centos/home? [y/n]: ( Input )y
Logical volume "home" successfully removed
Add disk space of the specified size to the specified partition
-- What I'm specifying here is root increase 40G, because home Only account file , Do not store other documents
[root@singlelucky ~]# lvextend -L +40G /dev/mapper/centos-root
Size of logical volume centos/root changed from 50.00 GiB (12800 extents) to 90.00 GiB (23040 extents).
Logical volume centos/root successfully resized.
Expand /root file system
[root@singlelucky ~]# 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 23592960
The reconstruction home Partition
[root@singlelucky ~]# lvcreate -L 2G -n /dev/mapper/centos-home
Logical volume "home" created.
Create file system
[root@singlelucky ~]# mkfs.xfs /dev/mapper/centos-home
meta-data=/dev/mapper/centos-home isize=512 agcount=4, agsize=131072 blks
= sectsz=512 attr=2, projid32bit=1
= crc=1 finobt=0, sparse=0
data = bsize=4096 blocks=524288, imaxpct=25
= sunit=0 swidth=0 blks
naming =version 2 bsize=4096 ascii-ci=0 ftype=1
log =internal log bsize=4096 blocks=2560, version=2
= sectsz=512 sunit=0 blks, lazy-count=1
realtime =none extsz=4096 blocks=0, rtextents=0
mount home
[root@singlelucky ~]# mount /dev/mapper/centos-home
home Backup file recovery
[root@singlelucky ~]# tar xvf /tmp/home.tar -C/
home/
home/wxl/
home/wxl/.bash_logout
home/wxl/.bash_profile
home/wxl/.bashrc
Check the new disk space distribution
[root@singlelucky ~]# df -lh
file system Capacity Already used You can use Already used % Mount point
devtmpfs 4.7G 0 4.7G 0% /dev
tmpfs 4.7G 0 4.7G 0% /dev/shm
tmpfs 4.7G 13M 4.7G 1% /run
tmpfs 4.7G 0 4.7G 0% /sys/fs/cgroup
/dev/mapper/centos-root 90G 44G 47G 49% /
/dev/sda1 1014M 149M 866M 15% /boot
tmpfs 959M 0 959M 0% /run/user/0
/dev/mapper/centos-home 2G 33M 2G 2% /home
边栏推荐
- ERROR 1118 (42000): Row size too large (> 8126)
- 判断数组中是否存在重复元素
- Pytest framework implements pre post
- Blender multi lens (multi stand) switching
- 【Unity3D】无法正确获取RectTransform的属性值导致计算出错
- Network real-time video streaming based on OpenCV
- pytest学习--base
- 【避坑指南】Unity3D项目接入腾讯Bugly工具时遇到的坑
- 【虚幻4】UMG组件的简介与使用(更新中...)
- Understand the composition of building energy-saving system
猜你喜欢
【Visual Studio】每次打开一个Unity3D的脚本,都会自动重新打开一个新的VS2017
allure--常用配置项
How to judge the quality of primary market projects when the market is depressed?
Considerations for Apache deploying static web page projects
This article takes you to learn in detail what is fiber to home FTTH
Blender ocean production
Blender石头雕刻
[ue5] two implementation methods of AI random roaming blueprint (role blueprint and behavior tree)
Webui automated learning
2021-10-02
随机推荐
2021-10-04
【虚幻】自动门蓝图笔记
[unity3d] nested use layout group to make scroll view with dynamic sub object height
2021-09-12
ue4材质的入门和原理笔记
VLAN experiment
Metaclass type and using metaclass to implement model class ORM
[unity3d] production progress bar - make image have the functions of filled and sliced at the same time
【虚幻】武器插槽:拾取武器
sqoop的表的导入
虛幻AI藍圖基礎筆記(萬字整理)
How to achieve the top progress bar effect in background management projects
Postman -- use
Blender摄像机环绕运动、动画渲染、视频合成
Blender体积雾
AutoCAD - layer Linetype
Beautiful and intelligent, Haval H6 supreme+ makes Yuanxiao travel safer
lunix重新分配root 和 home 空间内存
Brief analysis of edgedb architecture
flume 190 INSTALL