当前位置:网站首页>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] ~]#
边栏推荐
- 二叉树专题--AcWing 47. 二叉树中和为某一值的路径(前序遍历)
- Leetcode 182 Find duplicate email (2022.07.01)
- [quick application] win7 system cannot run and debug projects using Huawei ide
- tidb-dm报警DM_sync_process_exists_with_error排查
- How to implement tabbar title bar with list component
- TIPC Getting Started6
- III Chip startup and clock system
- The working day of the month is calculated from the 1st day of each month
- 【深入浅出玩转FPGA学习5-----复位设计】
- 高德根据轨迹画线
猜你喜欢

Mongodb learning and sorting (condition operator, $type operator, limit() method, skip() method and sort() method)

Flick two open, realized a batch lookup join (with source code)

Tick Data and Resampling

【深入浅出玩转FPGA学习3-----基本语法】

Nodejs+express+mysql simple blog building

二叉树专题--AcWing 19. 二叉树的下一个节点(找树中节点的后继)
![[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?

Implement custom drawer component in quick application

One trick to quickly realize custom application titlebar

Openmldb meetup No.4 meeting minutes
随机推荐
PCL point cloud to depth image
二叉树专题--AcWing 18. 重建二叉树(利用前、中序遍历,构建二叉树)
PCL eigen introduction and simple use
二叉树专题--洛谷 P3884 [JLOI2009]二叉树问题(dfs求二叉树深度 bfs求二叉树宽度 dijkstra求最短路)
mmrotate旋转目标检测框架使用记录
Luogu p1892 [boi2003] Gang (and search for variant anti set)
Binary tree topic -- Luogu p3884 [jloi2009] binary tree problem (DFS for binary tree depth BFS for binary tree width Dijkstra for shortest path)
V2x SIM dataset (Shanghai Jiaotong University & New York University)
Special topic of binary tree -- acwing 1497 Traversal of the tree (use post and mid order traversal to build a binary tree)
QT learning diary 8 - resource file addition
二叉树专题--洛谷 P1229 遍历问题(乘法原理 已知前、后序遍历求中序遍历个数)
PCL projection point cloud
高德根据轨迹画线
Matlab processing of distance measurement of experimental electron microscope
JVM garbage collector
TIPC messaging3
Flink two Open, implement Batch Lookup join (attached source)
TIPC Getting Started6
Implementation of six singleton modes
【深入浅出玩转FPGA学习4----漫谈状态机设计】