当前位置:网站首页>LVM operation
LVM operation
2022-07-02 11:14:00 【gaojingsong】
───────────────────────────────────────────────────────┐
│ • MobaXterm 11.1 • │
│ (SSH client, X-server and networking tools) │
│ │
│ * SSH session to [email protected] │
│ • SSH compression : │
│ • SSH-browser : │
│ • X11-forwarding : (remote display is forwarded through SSH) │
│ • DISPLAY : (automatically set on remote server) │
│ │
│ * For more info, ctrl+click on help or visit our website │
└────────────────────────────────────────────────────────────────────┘
Last login: Wed Jun 28 19:26:00 2022 from 123.189.233.143
[[email protected] ~]#
[[email protected] ~]# fdisk -l
The disk size is 214G, But only 100G
disk /dev/sda:214.7 GB, 214748364800 byte ,419430400 Sectors
Units = A sector of 1 * 512 = 512 bytes
Sector size ( Logic / Physics ):512 byte / 512 byte
I/O size ( Minimum / The best ):512 byte / 512 byte
Disk label type :dos
Disk identifier :0x000d0ed9
equipment Boot Start End Blocks Id System
/dev/sda1 * 2048 2099199 1048576 83 Linux
/dev/sda2 2099200 209715199 103808000 8e Linux LVM
/dev/sda3 209715200 419430399 104857600 8e Linux LVM
disk /dev/mapper/centos-root:53.7 GB, 53687091200 byte ,104857600 Sectors
Units = A sector of 1 * 512 = 512 bytes
Sector size ( Logic / Physics ):512 byte / 512 byte
I/O size ( Minimum / The best ):512 byte / 512 byte
disk /dev/mapper/centos-swap:2147 MB, 2147483648 byte ,4194304 Sectors
Units = A sector of 1 * 512 = 512 bytes
Sector size ( Logic / Physics ):512 byte / 512 byte
I/O size ( Minimum / The best ):512 byte / 512 byte
disk /dev/mapper/centos-home:50.5 GB, 50457477120 byte ,98549760 Sectors
Units = A sector of 1 * 512 = 512 bytes
Sector size ( Logic / Physics ):512 byte / 512 byte
I/O size ( Minimum / The best ):512 byte / 512 byte
Check disk capacity
[[email protected] ~]# df -h
file system Capacity Already used You can use Already used % Mount point
devtmpfs 7.8G 0 7.8G 0% /dev
tmpfs 7.8G 4.0K 7.8G 1% /dev/shm
tmpfs 7.8G 50M 7.8G 1% /run
tmpfs 7.8G 0 7.8G 0% /sys/fs/cgroup
/dev/mapper/centos-root 50G 50G 349M 100% /
/dev/sda1 1014M 245M 770M 25% /boot
/dev/mapper/centos-home 47G 2.4G 45G 6% /home
tmpfs 1.6G 0 1.6G 0% /run/user/0
establish pv( Give the newly created partition /dev/sda3), And then put pv Join in vg in , It's equivalent to expanding vg Size
[[email protected] ~]# pvcreate /dev/sda3
WARNING: ext4 signature detected on /dev/sda3 at offset 1080. Wipe it? [y/n]: y
Wiping ext4 signature on /dev/sda3.
Physical volume "/dev/sda3" successfully created.
You are in /var/spool/mail/root New message in
[[email protected] ~]# vgs
VG #PV #LV #SN Attr VSize VFree
centos 1 3 0 wz--n- <99.00g 4.00m
Expand vg, Use vgextend command
[[email protected] ~]# vgextend centos /dev/sda3
Volume group "centos" successfully extended
You are in /var/spool/mail/root New message in
[[email protected] ~]# vgs
VG #PV #LV #SN Attr VSize VFree
centos 2 3 0 wz--n- 198.99g 100.00g
see lv size
[[email protected] ~]# lvs
LV VG Attr LSize Pool Origin Data% Meta% Move Log Cpy%Sync Convert
home centos -wi-ao---- 46.99g
root centos -wi-ao---- 50.00g
swap centos -wi-ao---- 2.00g
Expand lv, Use lvextend command
[[email protected] ~]#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.
You are in /var/spool/mail/root New message in
Expand lv, Use lvextend command
[[email protected] ~]# lvextend -L +20G /dev/mapper/centos-home
Size of logical volume centos/home changed from 46.99 GiB (12030 extents) to 66.99 GiB (17150 extents).
Logical volume centos/home successfully resized.
[[email protected] ~]# lvs
LV VG Attr LSize Pool Origin Data% Meta% Move Log Cpy%Sync Convert
home centos -wi-ao---- 66.99g
root centos -wi-ao---- 90.00g
swap centos -wi-ao---- 2.00g
Find out centos-root There is no change in space , Use command xfs_growfs Make the system read the size again
[[email protected] ~]# df -h
file system Capacity Already used You can use Already used % Mount point
devtmpfs 7.8G 0 7.8G 0% /dev
tmpfs 7.8G 4.0K 7.8G 1% /dev/shm
tmpfs 7.8G 50M 7.8G 1% /run
tmpfs 7.8G 0 7.8G 0% /sys/fs/cgroup
/dev/mapper/centos-root 50G 50G 349M 100% /
/dev/sda1 1014M 245M 770M 25% /boot
/dev/mapper/centos-home 47G 2.4G 45G 6% /home
tmpfs 1.6G 0 1.6G 0% /run/user/0
You are in /var/spool/mail/root New message in
[[email protected] ~]# 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
[[email protected] ~]# df -h
file system Capacity Already used You can use Already used % Mount point
devtmpfs 7.8G 0 7.8G 0% /dev
tmpfs 7.8G 4.0K 7.8G 1% /dev/shm
tmpfs 7.8G 50M 7.8G 1% /run
tmpfs 7.8G 0 7.8G 0% /sys/fs/cgroup
/dev/mapper/centos-root 90G 50G 41G 56% /
/dev/sda1 1014M 245M 770M 25% /boot
/dev/mapper/centos-home 47G 2.4G 45G 6% /home
tmpfs 1.6G 0 1.6G 0% /run/user/0
[[email protected] ~]# xfs_growfs /dev/mapper/centos-home
meta-data=/dev/mapper/centos-home isize=512 agcount=4, agsize=3079680 blks
= sectsz=512 attr=2, projid32bit=1
= crc=1 finobt=0 spinodes=0
data = bsize=4096 blocks=12318720, imaxpct=25
= sunit=0 swidth=0 blks
naming =version 2 bsize=4096 ascii-ci=0 ftype=1
log =internal bsize=4096 blocks=6015, version=2
= sectsz=512 sunit=0 blks, lazy-count=1
realtime =none extsz=4096 blocks=0, rtextents=0
data blocks changed from 12318720 to 17561600
You are in /var/spool/mail/root New message in
[[email protected] ~]# df -h
file system Capacity Already used You can use Already used % Mount point
devtmpfs 7.8G 0 7.8G 0% /dev
tmpfs 7.8G 4.0K 7.8G 1% /dev/shm
tmpfs 7.8G 50M 7.8G 1% /run
tmpfs 7.8G 0 7.8G 0% /sys/fs/cgroup
/dev/mapper/centos-root 90G 50G 41G 56% /
/dev/sda1 1014M 245M 770M 25% /boot
/dev/mapper/centos-home 67G 2.4G 65G 4% /home
tmpfs 1.6G 0 1.6G 0% /run/user/0
[[email protected] ~]#
边栏推荐
猜你喜欢
![[AGC] how to solve the problem that the local display of event analysis data is inconsistent with that in AGC panel?](/img/66/674a06d8e45a31ae879b81554ef373.png)
[AGC] how to solve the problem that the local display of event analysis data is inconsistent with that in AGC panel?

洛谷 P5536 【XR-3】核心城市(贪心 + 树形 dp 寻找树的中心)
![[play with FPGA learning 5 in simple terms ----- reset design]](/img/57/816a59787259dc32b52897c069e1a6.png)
[play with FPGA learning 5 in simple terms ----- reset design]

TIPC Cluster5

一招快速实现自定义快应用titlebar

二叉树专题--AcWing 47. 二叉树中和为某一值的路径(前序遍历)

Iii. Système de démarrage et d'horloge à puce

二叉树专题--AcWing 1589. 构建二叉搜索树

二叉树专题--AcWing 3540. 二叉搜索树建树(实用板子 构建二叉搜索树 并输出前、中、后序遍历)

三.芯片启动和时钟系统
随机推荐
Luogu p5536 [xr-3] core city (greed + tree DP looking for the center of the tree)
QT学习日记8——资源文件添加
华为AppLinking中统一链接的创建和使用
最详细MySql安装教程
Binary tree topic -- Luogu p3884 [jloi2009] binary tree problem (DFS for binary tree depth BFS for binary tree width Dijkstra for shortest path)
快应用中实现自定义抽屉组件
Iii. Système de démarrage et d'horloge à puce
QT学习日记7——QMainWindow
Overview of integrated learning
二叉树专题--洛谷 P1229 遍历问题(乘法原理 已知前、后序遍历求中序遍历个数)
Use Huawei performance management service to configure the sampling rate on demand
Implementation of six singleton modes
Primary key policy problem
From the perspective of attack surface, see the practice of zero trust scheme of Xinchuang
ImportError: cannot import name ‘Digraph‘ from ‘graphviz‘
洛谷 P3398 仓鼠找 sugar(树上倍增 lca 判断树中两条路径是否相交 结论)
华为快应用中如何实现同时传递事件对象和自定义参数
mmrotate旋转目标检测框架使用记录
TIPC Getting Started6
Importerror: impossible d'importer le nom « graph» de « graphviz»