Linux lvm在线扩容
1、查看磁盘空间
[root@bgd-mysql3 ~]# fdisk -l Disk /dev/sda: 107.4 GB, 107374182400 bytes, 209715200 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk label type: dos
Disk identifier: 0x000b7e20 Device Boot Start End Blocks Id System
/dev/sda1 * 2048 2099199 1048576 83 Linux
/dev/sda2 2099200 209715199 103808000 8e Linux LVM Disk /dev/sdb: 966.4 GB, 966367641600 bytes, 1887436800 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes Disk /dev/mapper/centos_bgd--ngnix1-root: 102.1 GB, 102131302400 bytes, 199475200 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytesDisk /dev/mapper/centos_bgd--ngnix1-swap: 4160 MB, 4160749568 bytes, 8126464 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
2、创建物理卷
[root@bgd-mysql3 ~]# pvcreate /dev/sdb
Physical volume "/dev/sdb" successfully created.
3、查看物理卷
--- Physical volume ---
PV Name /dev/sda2
VG Name centos_bgd-ngnix1
PV Size <99.00 GiB / not usable 3.00 MiB
Allocatable yes
PE Size 4.00 MiB
Total PE 25343
Free PE 1
Allocated PE 25342
PV UUID vr9DRr-mwG8-89Vm-LmoV-Bqel-Ykga-HM5HLg
"/dev/sdb" is a new physical volume of "900.00 GiB"
--- NEW Physical volume ---
PV Name /dev/sdb
VG Name
PV Size 900.00 GiB
Allocatable NO
PE Size 0
Total PE 0
Free PE 0
Allocated PE 0
PV UUID fhbfRd-x6qx-KVCd-3SBF-5lXN-Z81W-SIrRQz
4、查看当前卷组
[root@bgd-mysql3 ~]# vgdisplay
--- Volume group ---
VG Name centos_bgd-ngnix1
System ID
Format lvm2
Metadata Areas 1
Metadata Sequence No 3
VG Access read/write
VG Status resizable
MAX LV 0
Cur LV 2
Open LV 2
Max PV 0
Cur PV 1
Act PV 1
VG Size <99.00 GiB
PE Size 4.00 MiB
Total PE 25343
Alloc PE / Size 25342 / 98.99 GiB
Free PE / Size 1 / 4.00 MiB
VG UUID BFGY1M-PHqr-RBnE-87t2-bhYC-n7PX-idg4R1
5、扩展卷组,将/dev/sdb物理卷加到VG中
[root@bgd-mysql3 ~]# vgextend centos_bgd-ngnix1 /dev/sdb
Volume group "centos_bgd-ngnix1" successfully extended
6、查看逻辑卷
[root@bgd-mysql3 ~]# lvdisplay
--- Logical volume ---
LV Path /dev/centos_bgd-ngnix1/root
LV Name root
VG Name centos_bgd-ngnix1
LV UUID 2SnPdf-1zdM-lM5G-4fJz-oGve-JC2Z-fkTGUL
LV Write Access read/write
LV Creation host, time bgd-ngnix1, 2018-11-21 13:08:20 +0800
LV Status available
# open 1
LV Size <95.12 GiB
Current LE 24350
Segments 1
Allocation inherit
Read ahead sectors auto
- currently set to 8192
Block device 253:0
--- Logical volume ---
LV Path /dev/centos_bgd-ngnix1/swap
LV Name swap
VG Name centos_bgd-ngnix1
LV UUID l8jyte-4j0X-00Am-ich0-9qen-QLaW-LWTSHI
LV Write Access read/write
LV Creation host, time bgd-ngnix1, 2018-11-21 13:08:21 +0800
LV Status available
open 2
LV Size ️.88 GiB
Current LE 992
Segments 1
Allocation inherit
Read ahead sectors auto
currently set to 8192
Block device 253:1
7、将VG空间划分到LV
[root@bgd-mysql3 ~]# lvextend -l +100%FREE /dev/centos_bgd-ngnix1/root
Size of logical volume centos_bgd-ngnix1/root changed from <95.12 GiB (24350 extents) to <995.12 GiB (254750 extents).
Logical volume centos_bgd-ngnix1/root successfully resized.
8、重定义空间大小
[root@bgd-mysql3 ~]# xfs_growfs /dev/centos_bgd-ngnix1/root
meta-data=/dev/mapper/centos_bgd--ngnix1-root isize=512 agcount=4, agsize=6233600 blks
= sectsz=512 attr=2, projid32bit=1
= crc=1 finobt=0 spinodes=0
data = bsize=4096 blocks=24934400, imaxpct=25
= sunit=0 swidth=0 blks
naming =version 2 bsize=4096 ascii-ci=0 ftype=1
log =internal bsize=4096 blocks=12175, version=2
= sectsz=512 sunit=0 blks, lazy-count=1
realtime =none extsz=4096 blocks=0, rtextents=0
data blocks changed from 24934400 to 260864000
以上是OS7的命令,OS6的命令如下
resize2fs /dev/mapper/centos-root ---centos
9、查看空间
[root@bgd-mysql3 ~]# df -h
Filesystem Size Used Avail Use% Mounted on
/dev/mapper/centos_bgd--ngnix1-root 996G 1.7G 994G 1% /
devtmpfs 3.9G 0 3.9G 0% /dev
tmpfs 3.9G 0 3.9G 0% /dev/shm
tmpfs 3.9G 8.8M 3.9G 1% /run
tmpfs 3.9G 0 3.9G 0% /sys/fs/cgroup
/dev/sda1 1014M 184M 831M 19% /boot
tmpfs 783M 0 783M 0% /run/user/0
Linux lvm在线扩容的更多相关文章
- Linux LVM在线扩容
环境: 虚拟化环境,SUSE Linux Enterprise Server 11sp3,直接把虚拟磁盘从100G改成150G. 现有的LVM是100G,/home 的LV需要再加50G. 步骤: f ...
- Linux下lvm在线扩容步骤
转 :https://jingyan.baidu.com/article/25648fc18f22b29191fd0011.html 图片看不清可以看原文 LVM是逻辑盘卷管理(Logical Vol ...
- LVM在线扩容
我虚拟机根分区已经使用了35%,现在需要对他进行在线扩容,扩容之后使用率降到30% [root@localhost ~]# dfFilesystem 1K-blocks Used Available ...
- Linux LVM动态扩容
引用自: https://blog.csdn.net/u012439646/article/details/73380197 xfs_growfs /dev/centos/root 一.首先安 ...
- Linux记录-在线扩容8e
1.fdisk -l 2.增加分区 3.3:键入 p,主分区,并键入3(编号): 默认起始扇区和结束扇区即可(键入两次Enter) 键入t,修改分区类型为8e: 键入w,写分区表,然后重启: 卷扩容, ...
- LVM 在线扩容磁盘(ubuntu 14.04 server)
mware workstation 8 或者 vmware vsphere client 6.0( exsi 6.0) (前提:你的服务器需要有已经存在的卷组,才可以添加新的物理卷到卷组,然后再扩容逻 ...
- 微服务架构 ------ 插曲 linux LVM磁盘扩容
1.LVM的基本概念 物理卷(PV):可以在上面建立卷组的媒介,可以是硬盘分区,也可以是硬盘本身或者回环文件,物理卷包括一个特殊的header,其余部分被切割成一块块物理区域. 卷组(VG):将一组物 ...
- linux LVM 系统盘扩容
1.fdisk /dev/sda2.输入n,开始创建新分区3.输入p4.输入w5.mkfs.ext4 /dev/sda36.pvcreate /dev/sda37.vgdisplay 查看VG nam ...
- Linux lvm 分区知识笔记
盘面上可以细分出扇区(Sector)与柱面(Cylinder)两种单位,其中扇区每个为512bytes那么大. 通常所说的"硬盘分区"就是指修改磁盘分区表,它定义了"第n ...
随机推荐
- python编程中的流程控制
内容概要 成员运算 身份运算 流程控制 详细 1.成员运算 定义:判断某个个体在不在某个群体内 关键词:in(在) /// not in(不在) 例: num_list = [1, 2, 3, 4, ...
- aardio 开发桌面应用,这几点必须要掌握!
1. 前言 大家好,我是安果! 上一篇文章写到可以通过 aardio 结合 Python 开发桌面应用,有些小伙伴后台给我留言,说 Aardio 资料太少,希望我能补充一些实用的功能 实用 | 利用 ...
- Mysql教程:(六)修改语句、、删除语句、字符查询like
1.修改语句 update 表名 set where 条件 mysql> update student set birth=1988,department='中文系' where id=901 ...
- JMeter学习笔记--JDBC测试计划-连接Mysql
1.首先要下载jar包,mysql-connector-java-5.1.7-bin.jar 放到Jmeter的lib文件下ext下 2.添加JDBC Connection Configuration ...
- js判断是否是同一域名
可以判断自己的网页是否是嵌入别的网页中 /** * 是否相同域名 * @returns {boolean} * @constructor */ function SameDomain() { try ...
- IntelliJ IDEA竟然出了可以在云端编码的功能?
前言 自从我用了正版的IntelliJ IDEA后,基本上都是与时俱进,出一个新版本就立马更新,这也能能让我体验到最新最快的功能. 最近在闲逛Jetbrains的官网时,看到了最新的2021.3EAP ...
- 微信小程序(三)开发框架
基本构成: 数据绑定: 例: <!--index.hxml--> <view> <text data-name="{{theName}}">&l ...
- thin_check命令 man手册
# man thin_checkthin_check 检查验证设备或文件的精简配置元数据.thin_check checks thin provisioning metadata created by ...
- [cf1349D]Slime and Biscuits
枚举最终的获得所有饼干的人$i$(以下简称"获胜者"),对于$i$获胜的情况,令其贡献为游戏轮数,否则其贡献为0,记$F_{i}$为期望贡献(即所有情况概率*贡献之和),答案即为$ ...
- 快速入门上手Markdown
第一次接触Markdown是写代码初期看很多大佬的github,他们的项目一定会有一份文件叫Readme.md的文件 他们由一些简单美观的符号和汉字字母组成,编译之后成为一篇简单直观的文档 深入了解之 ...