CentOS7 LVM磁盘扩容
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磁盘扩容的更多相关文章
- 【转载】CentOS LVM磁盘扩容
转自:http://blog.sina.com.cn/s/blog_8882a6260101cpfs.html EXSI5.1主机有一个linux虚拟机,系统是centos运行httpd服务,因为是多 ...
- 03.LinuxCentOS系统root目录LVM磁盘扩容
根目录LVM扩容操作步骤: [root@centos7 ~]# df -lh文件系统 容量 已用 可用 已用% 挂载点/dev/mapper/centos-root 50G 7.7G 43G 6% / ...
- linux下 lvm 磁盘扩容
打算给系统装一个oracle,发现磁盘空间不足.在安装系统的时候我选择的是自动分区,系统就会自动以LVM的方式分区.为了保证系统后期的可用性,建议所有新系统安装都采用LVM,之后生产上的设备我也打算这 ...
- CentOS 下lvm 磁盘扩容
打算给系统装一个oracle,发现磁盘空间不足.在安装系统的时候我选择的是自动分区,系统就会自动以LVM的方式分区.为了保证系统后期的可用性,建议所有新系统安装都采用LVM,之后生产上的设备我也打算这 ...
- lvm 磁盘扩容
LVM磁盘管理 一.LVM简介 LVM是 Logical Volume Manager(逻辑卷管理)的简写,它由Heinz Mauelshagen在Linux 2.4内核上实现.LVM将一个或多个硬盘 ...
- lvm磁盘扩容
LVM实现新挂载磁盘扩容到原有目录 #查看磁盘 fdisk -l #创建pv pvcreate /dev/sdb [root@VM-67-49 ~]# pvcreate /dev/sdb Physic ...
- VMware CentOS LVM磁盘扩容
一. 在虚拟机上增加磁盘空间 如下图. 增加完后会有提示 "磁盘已成功扩展.您必须从客户机操作系统内部对磁盘重新进行分区和扩展文件系统.是继续完成以下步骤才算成功. 二.调整虚拟机磁盘LVM ...
- 阿里云ECS 实例Centos7系统磁盘扩容
需求:一台阿里云的数据盘磁盘空间不足,需要扩容,我这里只有一个主分区,ext4文件系统. 因为磁盘扩容场景不同,阿里云的文档比较全面一些,所以先奉上阿里云的文档,下面开始我的操作步骤: 1.登录控制台 ...
- 微服务架构 ------ 插曲 linux LVM磁盘扩容
1.LVM的基本概念 物理卷(PV):可以在上面建立卷组的媒介,可以是硬盘分区,也可以是硬盘本身或者回环文件,物理卷包括一个特殊的header,其余部分被切割成一块块物理区域. 卷组(VG):将一组物 ...
随机推荐
- linux 下载rpm包到本地,createrepo:创建本地YUM源
如何下载rpm包到本地 设置yum安装时,保留rpm包. 1.编辑 /etc/yum.conf 将keepcache的值设置为1; 这样就可以将yum安装时的rpm包保存在 /var/cache/yu ...
- matlab之viscircles()函数
函数功能:画圆 语法: viscircles(centers,radii) viscircles(ax,centers,radii) viscircles(___,Name,Value) h = vi ...
- ASP.WEB Form 几点知识
1.GridView 行的多选 <asp:TemplateField ControlStyle-Width="30" HeaderText="选择" &g ...
- 分享知识-快乐自己:Java中各种集合特点
Java中各种集合特点: Collection[单列集合]: List(有序,可重复): ArrayList: 底层数据结构是数组,查询快,增删慢.线程不安全,效率高. Vector: 底层数据结构是 ...
- C++ STL中Map的按Key排序跟按Value排序
C++ STL中Map的按Key排序和按Value排序 map是用来存放<key, value>键值对的数据结构,可以很方便快速的根据key查到相应的value.假如存储学生和其成绩(假定 ...
- 利用Hibernate 框架,实现对数据库的增删改查
增: package com.maya.test; import org.hibernate.*; import org.hibernate.cfg.*; import com.maya.model. ...
- Python基础知识之字符串操作方法总结
Python 中字符串也是一种数据类型,针对此数据总结下常用的方法 1,字符串截取,变量[头下标:尾下标],就可以截取相应的字符串,其中下标是从0开始算起,可以是正数或负数,下标可以为空表示取到头或尾 ...
- 用cookie登录慕课网络教学中心刷评论
声明:本文仅供学习参考 我们学校和的网络教学平台是在慕课网上的,需要登录到慕课网的教学平台以后,拿到cookie 注意:没次提交后需要休眠,否则刷评论过快会被系统发现 如果请求太快,很容易被系统发现( ...
- php和mysql连接方式(短 长 池)
一个php work进程只能处理一个请求,当完成一个请求了,才能处理下一次的请求 2.短连接: 执行到php关闭mysql连接的代码时,就断开,否则在处理本次请求结束的时候,释放mysql连接 实验: ...
- PS 滤镜— —挤压效果
clc; clear all; close all; addpath('E:\PhotoShop Algortihm\Image Processing\PS Algorithm'); I=imread ...