当前位置:网站首页>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] ~]#
边栏推荐
- TIPC协议
- 二叉树专题--洛谷 P3884 [JLOI2009]二叉树问题(dfs求二叉树深度 bfs求二叉树宽度 dijkstra求最短路)
- enumrate的start属性的坑
- The working day of the month is calculated from the 1st day of each month
- Complement (Mathematical Simulation
- Special topic of binary tree -- acwing 3540 Binary search tree building (use the board to build a binary search tree and output the pre -, middle -, and post sequence traversal)
- The most detailed MySQL installation tutorial
- JVM garbage collector
- PCL extracts a subset from a point cloud
- 快应用中实现自定义抽屉组件
猜你喜欢
[AI application] Hikvision ivms-4200 software installation
The first white paper on agile practice in Chinese enterprises was released | complete download is attached
tqdm的多行显示与单行显示
Tick Data and Resampling
ImportError: cannot import name ‘Digraph‘ from ‘graphviz‘
二叉树专题--AcWing 1497. 树的遍历(利用后、中序遍历,构建二叉树)
二叉树专题--AcWing 47. 二叉树中和为某一值的路径(前序遍历)
洛谷 P5536 【XR-3】核心城市(贪心 + 树形 dp 寻找树的中心)
一.STM32的开发环境,keil5/MDK5.14安装教程(附下载链接)
实验电镜距离测量之Matlab处理
随机推荐
Win11 arm system configuration Net core environment variable
二叉树专题--【深基16.例7】普通二叉树(简化版)(multiset 求前驱 后继 哨兵法)
Binary tree topic -- Luogu p3884 [jloi2009] binary tree problem (DFS for binary tree depth BFS for binary tree width Dijkstra for shortest path)
static 函数中的静态变量
Uncover the secrets of Huawei application market application statistics
[play with FPGA learning 5 in simple terms ----- reset design]
TIPC protocol
Use of vscode tool
III Chip startup and clock system
OpenMLDB Meetup No.4 会议纪要
ImportError: cannot import name ‘Digraph‘ from ‘graphviz‘
spritejs
三.芯片啟動和時鐘系統
Luogu p4281 [ahoi2008] emergency gathering / gathering (tree doubling LCA)
Special topic of binary tree -- Logu p1229 traversal problem (the number of traversals in the middle order is calculated when the pre and post order traversals of the multiplication principle are know
三.芯片启动和时钟系统
How to implement tabbar title bar with list component
洛谷 P3398 仓鼠找 sugar(树上倍增 lca 判断树中两条路径是否相交 结论)
TIPC Service and Topology Tracking4
高德根据轨迹画线