Centos_Lvm expand capacity without restarting CentOS
- Rescan the new disk(/dev/sdb):
#ls /sys/class/scsi_host/
host0 host1 host2
[root@db210_13:56:14 /data]
#echo "- - -" > /sys/class/scsi_host/host0/scan
[root@db210_13:57:57 /data]
#echo "- - -" > /sys/class/scsi_host/host1/scan
[root@db210_13:57:57 /data]
#echo "- - -" > /sys/class/scsi_host/host2/scan
[root@db210_13:57:58 /data]
#fdisk -l
Disk /dev/sda: 64.4 GB, 64424509440 bytes, 125829120 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: 0x00084df7
Device Boot Start End Blocks Id System
/dev/sda1 * 2048 1026047 512000 83 Linux
/dev/sda2 1026048 5222399 2098176 82 Linux swap / Solaris
/dev/sda3 5222400 86259711 40518656 83 Linux
/dev/sda4 86259712 125829119 19784704 5 Extended
/dev/sda5 86261760 125829119 19783680 83 Linux
--- new disk is /dev/sdb ---
Disk /dev/sdb: 214.7 GB, 214748364800 bytes, 419430400 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/sdc: 536.9 GB**, 536870912000 bytes, 1048576000 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: 0xb4f30c82
Device Boot Start End Blocks Id System
/dev/sdc1 2048 1048575999 524286976 83 Linux
- format the new disk
[root@db210_12:15:04 /backup]
#fdisk /dev/sdb
Welcome to fdisk (util-linux 2.23.2).
Changes will remain in memory only, until you decide to write them.
Be careful before using the write command.
Device does not contain a recognized partition table
Building a new DOS disklabel with disk identifier 0xb4f30c82.
Command (m for help): n
Partition type:
p primary (0 primary, 0 extended, 4 free)
e extended
Select (default p): p
Partition number (1-4, default 1):
First sector (2048-1048575999, default 2048):
Using default value 2048
Last sector, +sectors or +size{K,M,G} (2048-1048575999, default 1048575999):
Using default value 1048575999
Partition 1 of type Linux and of size 500 GiB is set
Command (m for help): w
The partition table has been altered!
Calling ioctl() to re-read partition table.
Syncing disks.
- Create a PV
[root@db210_12:15:23 /backup]
#pvcreate /dev/sdb1
Physical volume "/dev/sdb1" successfully created.
[root@db210_12:15:47 /backup]
#pvs
PV VG Fmt Attr PSize PFree
/dev/sdb1 lvm2 --- <500.00g <500.00g
- Gets the existing VG name
#vgdisplay
--- Volume group ---
VG Name MySQL
System ID
Format lvm2
Metadata Areas 2
Metadata Sequence No 3
VG Access read/write
VG Status resizable
MAX LV 0
Cur LV 1
Open LV 1
Max PV 0
Cur PV 2
Act PV 2
VG Size 699.99 GiB
PE Size 4.00 MiB
Total PE 179198
Alloc PE / Size 127744 / 499.00 GiB
Free PE / Size 51454 / 200.99 GiB
VG UUID VkivHp-IPdu-bPwW-kRNx-UUB3-ZWj1-SJ9gjo
- Add /dev/sdb1 to VG(MySQL)
[root@db210_12:39:53 /data]
#vgextend MySQL /dev/sdb1
Volume group "MySQL" successfully extended
-Expand capacity to LV
#df -h
Filesystem Size Used Avail Use% Mounted on
/dev/sda3 39G 12G 28G 30% /
devtmpfs 3.9G 0 3.9G 0% /dev
tmpfs 3.9G 0 3.9G 0% /dev/shm
tmpfs 3.9G 8.6M 3.9G 1% /run
tmpfs 3.9G 0 3.9G 0% /sys/fs/cgroup
/dev/sda5 19G 33M 19G 1% /home
/dev/sda1 497M 119M 379M 24% /boot
tmpfs 783M 0 783M 0% /run/user/0
/dev/mapper/MySQL-lvol0 499G 44G 456G 9% /data
#lvextend -rl +100%FREE /dev/MySQL/lvol0
Size of logical volume MySQL/lvol0 changed from <500.00 GiB (127999 extents) to 699.99 GiB (179198 extents).
Logical volume MySQL/lvol0 successfully resized.
meta-data=/dev/mapper/MySQL-lvol0 isize=256 agcount=4, agsize=32702464 blks
= sectsz=512 attr=2, projid32bit=1
= crc=0 finobt=0
data = bsize=4096 blocks=130809856, imaxpct=25
= sunit=0 swidth=0 blks
naming =version 2 bsize=4096 ascii-ci=0 ftype=0
log =internal bsize=4096 blocks=63872, version=2
= sectsz=512 sunit=0 blks, lazy-count=1
realtime =none extsz=4096 blocks=0, rtextents=0
data blocks changed from 130809856 to 183498752
[root@db210_13:49:04 /data]
#df -h
Filesystem Size Used Avail Use% Mounted on
/dev/sda3 39G 12G 28G 30% /
devtmpfs 3.9G 0 3.9G 0% /dev
tmpfs 3.9G 0 3.9G 0% /dev/shm
tmpfs 3.9G 8.6M 3.9G 1% /run
tmpfs 3.9G 0 3.9G 0% /sys/fs/cgroup
/dev/sda5 19G 33M 19G 1% /home
/dev/sda1 497M 119M 379M 24% /boot
tmpfs 783M 0 783M 0% /run/user/0
/dev/mapper/MySQL-lvol0 700G 44G 657G 7% /data
Centos_Lvm expand capacity without restarting CentOS的更多相关文章
- 20162314 《Program Design & Data Structures》Learning Summary Of The Fifth Week
20162314 2017-2018-1 <Program Design & Data Structures>Learning Summary Of The Fifth Week ...
- Centos_Lvm_Create pv vg lv and mount
re-scan new disks without restarting CentOS re-scan new disks(/dev/sdc): #ls /sys/class/scsi_host/ h ...
- Ramdisk根文件系统映像的修改与创建
本文简述Ramdisk根文件系统映像的修改以及创建,并附相关脚本以实现自动化配置,而根文件系统的制作过程请网上自行搜索.相关过程尽可能以图的方式展示出来,重在说明操作的过程,仅供参考. Ramdisk ...
- 使用packer制作vagrant centos box
使用packer制作vagrant box:centos 制作vagrant box,网上有教程,可以自己step by step的操作.不过直接使用虚拟在VirtualBox中制作vagrant b ...
- CentOS如何查看硬盘品牌型号等具体信息
首先使用smartctl --all /dev/sda 指令来检查硬盘信息,该指令CentOS自带,得到的结果可能如下: smartctl 5.43 2012-06-30 r3573 [x86_64- ...
- centos 查看脚本
centos 查看脚本 #!/bin/bash date >>info.txt echo "本机centos版本为" >>info.txt cat /etc ...
- CentOS下配置nginx conf/koi-win为同一文件的各类错误
今天配置CentOS6.5下安装Nginx + php7 + mysql5.7.15遇到了一些坑.本来家里的电脑在配置环境的时候没有问题,拿去公司的电脑上就是到处报错.不知道是不是人品问题.今晚在家重 ...
- CentOS 7下源码安装MySQL 5.6
本文转载,并非原创. 目录 准备工作 运行环境 确认你的安装版本 下载MySQL 安装MySQL 准备安装环境 编译和安装 配置MySQL 单实例配置 单实例配置方法 添加防火墙 启动MySQL 重启 ...
- (转)CentOs上配置samba服务
前 言 在我们使用 Windows 作为客户机的时候,通常有文件.打印共享的需求.作为Windows 网络功能之一,通常可以在 Windows 客户机之间通过 Windows Network 固有的功 ...
随机推荐
- 【bzoj5001】搞事情 暴力
题目描述 给定一个NM的01矩阵,每次可以选定一个位置,将它和它相邻格子的数取反.问:怎样操作使得所有格子都变为0.当有多组解时,优先取操作次数最小的:当操作次数相同时,优先取字典序最小的. 输入 第 ...
- 【bzoj1614】[Usaco2007 Jan]Telephone Lines架设电话线 二分+SPFA
题目描述 Farmer John打算将电话线引到自己的农场,但电信公司并不打算为他提供免费服务.于是,FJ必须为此向电信公司支付一定的费用. FJ的农场周围分布着N(1 <= N <= 1 ...
- FTP-成型版本
1. 旧知识回顾-反射 hasattr(object, name) 说明:判断对象object是否包含名为name的属性(方法) 测试代码如下: class tt(object): def __ini ...
- POJ3090:Visible Lattice Points——题解
http://poj.org/problem?id=3090 题目大意:你站在(0,0)的点上看向第一向限的点,点和点会互相阻挡,问最多看到多少点. 很容易想到,我们能看到的点,它的横纵坐标一定是互质 ...
- BZOJ5322:[JXOI2018]排序问题——题解
https://www.lydsy.com/JudgeOnline/problem.php?id=5322 https://loj.ac/problem/2543 <-可以看数据,要没有这数据我 ...
- 在 C Level 用 dlopen 使用 第三方的 Shared Library (.so)
http://falldog7.blogspot.com/2013/10/android-c-level-dlopen-shared-library-so.html 在 Android 裡,撰寫 JN ...
- ubuntu切割mp3文件
ffmpeg -i InputFile -vn -acodec copy -ss 00:00:00 -t 00:01:32 OutPutFile
- HDU1522 稳定婚姻匹配 模板
Marriage is Stable Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Other ...
- [设计篇]01.RESTFUL URI 简单入门设计
1. HTTP Methods HTTP 常用方法: GET: 获取某个资源. POST: 创建一个新的资源. PUT: 替换某个已有的资源. PATCH: 修改某个已有的资源.-->这个自己没 ...
- transition和animation概况
有人可能会有疑问,CSS3动画不是只有animation一个属性吗?怎么又和转化(transform)和过渡(transition)扯上关系了,其实并非如此,转化(transform)属性让动画的变换 ...