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):将一组物 ...
随机推荐
- 用 CSS3 创建一个漂亮的多种色彩的菜单
1. [图片] thumb.png 2. [代码][HTML]代码 <!DOCTYPE html><html lang="en" > <hea ...
- Linux课程---5、常用文件命令和目录命令(创建文件命令)
Linux课程---5.常用文件命令和目录命令(创建文件命令) 一.总结 一句话总结: touch file1 1.管道符|有什么用? 将前一个命令的结果作为后一个命令的输入:比如查看文件前3行:ca ...
- 分享知识-快乐自己:IO流基本操作
点我参考常用API: IO图解: 相关理论: 流的概念和作用: 流是一组有顺序的,有起点和终点的字节集合,是对数据传输的总称或抽象.即数据在两设备间的传输称为流,流的本质是数据传输,根据数据传输特性将 ...
- 目标检测 — Inception-ResNet-v2
这篇文章介绍的网络有Inception V1.Inception V2.Inception V3.Inception V4与Inception-ResNet-V2. 1.Inception V1 主要 ...
- java_面试_01_一个月的面试总结(java)
重点知识 由于我面试的JAVA开发工程师,针对于JAVA,需要理解的重点内容有: JVM内存管理机制和垃圾回收机制(基本每次面试都会问,一定要搞得透彻) JVM内存调优(了解是怎么回事,一般做项目过程 ...
- jQuery插件--图片文字向上向左循环滚动
需要引用jquery 调用非常简单: 一. 向上滚动 $(".scroll_two").jScroll({vertical: true}); <div class=" ...
- JSP的一个增删改查例子和总结
总结的几点: 1.在jsp中注意<%! %>声明代码块中的变量只会在项目开始的时候第一次运行jsp的时候执行一遍,有点类似于java类中的static代码块,所以如果是会改变的值不应该声明 ...
- Android数据传递的五种方法汇总
Android开发中,在不同模块(如Activity)间经常会有各种各样的数据需要相互传递,我把常用的几种 方法都收集到了一起.它们各有利弊,有各自的应用场景. 我现在把它们集中到一个例子中展示,在例 ...
- Select\Poll\Epoll异步IO与事件驱动
事件驱动与异步IO 事件驱动编程是一种编程规范,这里程序的执行流由外部事件来规定.它的特点是包含一个事件循环,但外部事件发生时使用回调机制来触发响应的处理.另外两种常见的编程规范是(单线程)同步以及多 ...
- Redis的安装和配置文件
实验环境:Centos6.8 Redis版本:3.0.6 下载Redis,并放到/usr/local/soft下: yum -y install gcc automake autoconf libto ...