当前位置:网站首页>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] ~]#
边栏推荐
- 从攻击面视角,看信创零信任方案实践
- QT learning diary 7 - qmainwindow
- Nodejs+express+mysql simple blog building
- 金山云——2023届暑期实习
- 华为应用市场应用统计数据问题大揭秘
- PCL extracts a subset from a point cloud
- Summary of cases of players' disconnection and reconnection in Huawei online battle service
- [paid promotion] collection of frequently asked questions, recommended list FAQ
- webauthn——官方开发文档
- The working day of the month is calculated from the 1st day of each month
猜你喜欢
随机推荐
PCL eigen introduction and simple use
ImportError: cannot import name ‘Digraph‘ from ‘graphviz‘
String (Analog
Luogu p1892 [boi2003] Gang (and search for variant anti set)
二叉树专题--AcWing 47. 二叉树中和为某一值的路径(前序遍历)
高德根据轨迹画线
Matlab processing of distance measurement of experimental electron microscope
洛谷 P4281 [AHOI2008]紧急集合 / 聚会(树上倍增 LCA)
Binary tree topic -- p1030 [noip2001 popularization group] find the first order
Special topic of binary tree -- acwing 47 Path with a certain value in binary tree (preorder traversal)
STM32单片机编程学习
PKG package manager usage instance in FreeBSD
通过券商经理的开户二维码开股票账户安全吗?还是去证券公司开户安全?
Static variables in static function
tqdm的多行显示与单行显示
Internship report skywalking distributed link tracking?
Rest (XOR) position and thinking
Special topic of binary tree -- [deep base 16. Example 7] ordinary binary tree (simplified version) (multiset seeks the precursor and subsequent sentry Art)
Flick two open, realized a batch lookup join (with source code)
How does the whole network display IP ownership?