当前位置:网站首页>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
边栏推荐
- VLAN experiment
- Project practice, redis cluster technology learning (13)
- UE illusory engine programmed plant generator setup -- how to quickly generate large forests
- [Fantasy 4] the transformation from U3D to UE4
- 【Unity3D】嵌套使用Layout Group制作拥有动态子物体高度的Scroll View
- Ctrip starts mixed office. How can small and medium-sized enterprises achieve mixed office?
- Configuration programmée du générateur de plantes du moteur illusoire UE - - Comment générer rapidement une grande forêt
- Basic usage of mock server
- What is call / cc- What is call/cc?
- Tee command usage example
猜你喜欢
Brief analysis of edgedb architecture

Basic notes of illusory AI blueprint (10000 words)
![[illusory] weapon slot: pick up weapons](/img/a7/1e395fc9cdfd0359e7ae4d2313290d.png)
[illusory] weapon slot: pick up weapons

Flink实时计算topN热榜

webUI自动化学习

【虚幻4】UMG组件的简介与使用(更新中...)

Leetcode -- the nearest common ancestor of 236 binary tree

Network real-time video streaming based on OpenCV

How to judge the quality of primary market projects when the market is depressed?

Delivery mode design of Spartacus UI of SAP e-commerce cloud
随机推荐
MongoDB-快速上手MongoDB命令行的一些简单操作
快速做出原型
Tee command usage example
VLAN experiment
Pytest framework implements pre post
[Fantasy 4] introduction and use of UMG components (under update...)
Remember a simple Oracle offline data migration to tidb process
[illusory] automatic door blueprint notes
Project practice, redis cluster technology learning (11)
【虚幻】过场动画笔记
Mock Server基本使用方法
This article takes you to learn in detail what is fiber to home FTTH
【Unity3D】无法正确获取RectTransform的属性值导致计算出错
VLAN experiment
MySQL -- time zone / connector / driver type
2021-09-12
pytest--之测试报告allure配置
判断数组中是否存在重复元素
stm32和電機開發(上比特系統)
ue虚幻引擎程序化植物生成器设置——如何快速生成大片森林