1:创建磁盘分区(注意红色命令部分)

[root@hongyin-test- ~]# fdisk /dev/sda
Welcome to fdisk (util-linux 2.23.). Changes will remain in memory only, until you decide to write them.
Be careful before using the write command. Command (m for help): m
Command action
a toggle a bootable flag
b edit bsd disklabel
c toggle the dos compatibility flag
d delete a partition
g create a new empty GPT partition table
G create an IRIX (SGI) partition table
l list known partition types
m print this menu
n add a new partition
o create a new empty DOS partition table
p print the partition table
q quit without saving changes
s create a new empty Sun disklabel
t change a partition's system id
u change display/entry units
v verify the partition table
w write table to disk and exit
x extra functionality (experts only) Command (m for help): n
Partition type:
p primary ( primary, extended, free)
e extended
Select (default e): p
Selected partition
First sector (-, default ):
Using default value
Last sector, +sectors or +size{K,M,G} (-, default ):
Using default value
Partition of type Linux and of size GiB is set Command (m for help): t
Partition number (-, default ):
Hex code (type L to list all codes): L Empty NEC DOS Minix / old Lin bf Solaris
FAT12 Hidden NTFS Win Linux swap / So c1 DRDOS/sec (FAT-
XENIX root Plan Linux c4 DRDOS/sec (FAT-
XENIX usr 3c PartitionMagic OS/ hidden C: c6 DRDOS/sec (FAT-
FAT16 <32M Venix Linux extended c7 Syrinx
Extended PPC PReP Boot NTFS volume set da Non-FS data
FAT16 SFS NTFS volume set db CP/M / CTOS / .
HPFS/NTFS/exFAT 4d QNX4.x Linux plaintext de Dell Utility
AIX 4e QNX4.x 2nd part 8e Linux LVM df BootIt
AIX bootable 4f QNX4.x 3rd part Amoeba e1 DOS access
a OS/ Boot Manag OnTrack DM Amoeba BBT e3 DOS R/O
b W95 FAT32 OnTrack DM6 Aux 9f BSD/OS e4 SpeedStor
c W95 FAT32 (LBA) CP/M a0 IBM Thinkpad hi eb BeOS fs
e W95 FAT16 (LBA) OnTrack DM6 Aux a5 FreeBSD ee GPT
f W95 Ext'd (LBA) 54 OnTrackDM6 a6 OpenBSD ef EFI (FAT-12/16/
OPUS EZ-Drive a7 NeXTSTEP f0 Linux/PA-RISC b
Hidden FAT12 Golden Bow a8 Darwin UFS f1 SpeedStor
Compaq diagnost 5c Priam Edisk a9 NetBSD f4 SpeedStor
Hidden FAT16 < SpeedStor ab Darwin boot f2 DOS secondary
Hidden FAT16 GNU HURD or Sys af HFS / HFS+ fb VMware VMFS
Hidden HPFS/NTF Novell Netware b7 BSDI fs fc VMware VMKCORE
AST SmartSleep Novell Netware b8 BSDI swap fd Linux raid auto
1b Hidden W95 FAT3 DiskSecure Mult bb Boot Wizard hid fe LANstep
1c Hidden W95 FAT3 PC/IX be Solaris boot ff BBT
1e Hidden W95 FAT1 Old Minix
Hex code (type L to list all codes): 8e
Changed type of partition 'Linux' to 'Linux LVM' Command (m for help): w
The partition table has been altered! Calling ioctl() to re-read partition table. WARNING: Re-reading the partition table failed with error : Device or resource busy.
The kernel still uses the old table. The new table will be used at
the next reboot or after you run partprobe() or kpartx()
Syncing disks.

2:重新加载分区表

[root@hongyin-test- ~]# partprobe 

3:查看新建的分区sda4

[root@hongyin-test- ~]# fdisk -l

Disk /dev/sda: 150.3 GB,  bytes,  sectors
Units = sectors of * = bytes
Sector size (logical/physical): bytes / bytes
I/O size (minimum/optimal): bytes / bytes
Disk label type: dos
Disk identifier: 0x000b2e61 Device Boot Start End Blocks Id System
/dev/sda1 * Linux
/dev/sda2 8e Linux LVM
/dev/sda3 8e Linux LVM
/dev/sda4 8e Linux LVM Disk /dev/mapper/centos-root: 126.2 GB, bytes, sectors
Units = sectors of * = bytes
Sector size (logical/physical): bytes / bytes
I/O size (minimum/optimal): bytes / bytes Disk /dev/mapper/centos-swap: MB, bytes, sectors
Units = sectors of * = bytes
Sector size (logical/physical): bytes / bytes
I/O size (minimum/optimal): bytes / bytes

4: 初始化物理卷

[root@hongyin-test- ~]# pvcreate /dev/sda4
Physical volume "/dev/sda4" successfully created

5: 查看卷组

[root@hongyin-test- ~]# vgdisplay
--- Volume group ---
VG Name centos
System ID
Format lvm2
Metadata Areas
Metadata Sequence No
VG Access read/write
VG Status resizable
MAX LV
Cur LV
Open LV
Max PV
Cur PV
Act PV
VG Size 119.50 GiB
PE Size 4.00 MiB
Total PE
Alloc PE / Size / 119.50 GiB
Free PE / Size /
VG UUID RS3QPD-QV32-zaC9-gnx7-vcfj-Eg5a-G01NoW

6:  把新建的物理卷加到需要扩展的卷组

[root@hongyin-test- ~]# vgextend centos /dev/sda4
Volume group "centos" successfully extended

7: 查看逻辑卷

[root@hongyin-test- ~]# lvdisplay
--- Logical volume ---
LV Path /dev/centos/root
LV Name root
VG Name centos
LV UUID rVqhOK-1Qqp-2yRM-82t6-QR26-8SQQ-4mnefZ
LV Write Access read/write
LV Creation host, time localhost, -- :: +
LV Status available
# open
LV Size 117.50 GiB
Current LE
Segments
Allocation inherit
Read ahead sectors auto
- currently set to
Block device : --- Logical volume ---
LV Path /dev/centos/swap
LV Name swap
VG Name centos
LV UUID TWOjFe-dRbI-V5je-TJrM-U2Zr-8kZ4-FHmyZC
LV Write Access read/write
LV Creation host, time localhost, -- :: +
LV Status available
# open
LV Size 2.00 GiB
Current LE
Segments
Allocation inherit
Read ahead sectors auto
- currently set to
Block device :

8: 扩展逻辑卷

[root@hongyin-test- ~]# lvextend -l +%FREE /dev/centos/root
Size of logical volume centos/root changed from 117.50 GiB ( extents) to 137.50 GiB ( extents).
Logical volume root successfully resized.

9: 格式化文件系统

[root@hongyin-test- ~]# xfs_growfs /dev/centos/root
meta-data=/dev/mapper/centos-root isize= agcount=, agsize= blks
= sectsz= attr=, projid32bit=
= crc= finobt=
data = bsize= blocks=, imaxpct=
= sunit= swidth= blks
naming =version bsize= ascii-ci= ftype=
log =internal bsize= blocks=, version=
= sectsz= sunit= blks, lazy-count=
realtime =none extsz= blocks=, rtextents=
data blocks changed from to

CentOS7 LVM磁盘扩容的更多相关文章

  1. 【转载】CentOS LVM磁盘扩容

    转自:http://blog.sina.com.cn/s/blog_8882a6260101cpfs.html EXSI5.1主机有一个linux虚拟机,系统是centos运行httpd服务,因为是多 ...

  2. 03.LinuxCentOS系统root目录LVM磁盘扩容

    根目录LVM扩容操作步骤: [root@centos7 ~]# df -lh文件系统 容量 已用 可用 已用% 挂载点/dev/mapper/centos-root 50G 7.7G 43G 6% / ...

  3. linux下 lvm 磁盘扩容

    打算给系统装一个oracle,发现磁盘空间不足.在安装系统的时候我选择的是自动分区,系统就会自动以LVM的方式分区.为了保证系统后期的可用性,建议所有新系统安装都采用LVM,之后生产上的设备我也打算这 ...

  4. CentOS 下lvm 磁盘扩容

    打算给系统装一个oracle,发现磁盘空间不足.在安装系统的时候我选择的是自动分区,系统就会自动以LVM的方式分区.为了保证系统后期的可用性,建议所有新系统安装都采用LVM,之后生产上的设备我也打算这 ...

  5. lvm 磁盘扩容

    LVM磁盘管理 一.LVM简介 LVM是 Logical Volume Manager(逻辑卷管理)的简写,它由Heinz Mauelshagen在Linux 2.4内核上实现.LVM将一个或多个硬盘 ...

  6. lvm磁盘扩容

    LVM实现新挂载磁盘扩容到原有目录 #查看磁盘 fdisk -l #创建pv pvcreate /dev/sdb [root@VM-67-49 ~]# pvcreate /dev/sdb Physic ...

  7. VMware CentOS LVM磁盘扩容

    一. 在虚拟机上增加磁盘空间 如下图. 增加完后会有提示 "磁盘已成功扩展.您必须从客户机操作系统内部对磁盘重新进行分区和扩展文件系统.是继续完成以下步骤才算成功. 二.调整虚拟机磁盘LVM ...

  8. 阿里云ECS 实例Centos7系统磁盘扩容

    需求:一台阿里云的数据盘磁盘空间不足,需要扩容,我这里只有一个主分区,ext4文件系统. 因为磁盘扩容场景不同,阿里云的文档比较全面一些,所以先奉上阿里云的文档,下面开始我的操作步骤: 1.登录控制台 ...

  9. 微服务架构 ------ 插曲 linux LVM磁盘扩容

    1.LVM的基本概念 物理卷(PV):可以在上面建立卷组的媒介,可以是硬盘分区,也可以是硬盘本身或者回环文件,物理卷包括一个特殊的header,其余部分被切割成一块块物理区域. 卷组(VG):将一组物 ...

随机推荐

  1. Eclipse 下配置MySql5.6的连接池,使用Tomcat7.0

    目前找到的最简单的配置方法.   1.首先在eclipse中创建一个Dynamical Web Application,在WebContent文件夹下的META-INF文件夹中创建新的名为conten ...

  2. 分享知识-快乐自己:idea的断点调试

    1:Step Over ,进入下一步,如果是方法,那就直接跳过(F8) 2:Step Into,进入下一步,如果是方法,就进入方法内部,但是不会进入jdk封装的方法.(F7) 3:Force Step ...

  3. python3反射解析

    python反射解析   一. 简介 python中的反射功能是由以下四个内置函数提供:hasattr.getattr.setattr.delattr,改四个函数分别用于对对象内部执行:检查是否含有某 ...

  4. Python基础之列表操作

    列表的常用操作包括但不限于以下操作: 列表的索引,切片,追加,删除,切片等 这里将对列表的内置操作方法进行总结归纳,重点是以示例的方式进行展示. 使用type获取创建对象的类 type(list) 使 ...

  5. python glances来监控linux服务器CPU 内存 IO使用

    什么是 Glances? Glances 是一个由 Python 编写,使用 psutil 库来从系统抓取信息的基于 curses 开发的跨平台命令行系统监视工具. 通过 Glances,我们可以监视 ...

  6. hdu-1025 Constructing Roads In JGShining's Kingdom(二分查找)

    题目链接: Constructing Roads In JGShining's Kingdom Time Limit: 2000/1000 MS (Java/Others)     Memory Li ...

  7. Linux-安装ssh服务

    问题描述: 有些版本的linux系统,如Ubuntn 16 ,安装完成后缺少ssh服务, 所以putty链接会出现访问失败的情况. 解决办法: 在linux中安装ssh服务,并启动 1.安装 sudo ...

  8. 《java编程思想》:散列的原理

    以实现一个简单的HashMap为例,详细讲解在code之中. 简单解释散列原理: 1.map中内建固定大小数组,但是数组并不保存key值本身,而是保存标识key的信息 2.通过key生成数组角标,对应 ...

  9. Hexo 版本

    Mac hexo s 启动Hexo服务报错如下: Error: The module '/usr/local/lib/node_modules/hexo-cli/node_modules/.0.8.0 ...

  10. ONVIF测试方法及工具

    设备是否支持ONVIF验证1 ONVIF Test Tool安装1.1PC安装环境要求:装有Microsoft .Net Framework 3.5或以上版本.1.2安装源文件请见:ONVIF Con ...