• 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的更多相关文章

  1. 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 ...

  2. 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 ...

  3. Ramdisk根文件系统映像的修改与创建

    本文简述Ramdisk根文件系统映像的修改以及创建,并附相关脚本以实现自动化配置,而根文件系统的制作过程请网上自行搜索.相关过程尽可能以图的方式展示出来,重在说明操作的过程,仅供参考. Ramdisk ...

  4. 使用packer制作vagrant centos box

    使用packer制作vagrant box:centos 制作vagrant box,网上有教程,可以自己step by step的操作.不过直接使用虚拟在VirtualBox中制作vagrant b ...

  5. CentOS如何查看硬盘品牌型号等具体信息

    首先使用smartctl --all /dev/sda 指令来检查硬盘信息,该指令CentOS自带,得到的结果可能如下: smartctl 5.43 2012-06-30 r3573 [x86_64- ...

  6. centos 查看脚本

    centos 查看脚本 #!/bin/bash date >>info.txt echo "本机centos版本为" >>info.txt cat /etc ...

  7. CentOS下配置nginx conf/koi-win为同一文件的各类错误

    今天配置CentOS6.5下安装Nginx + php7 + mysql5.7.15遇到了一些坑.本来家里的电脑在配置环境的时候没有问题,拿去公司的电脑上就是到处报错.不知道是不是人品问题.今晚在家重 ...

  8. CentOS 7下源码安装MySQL 5.6

    本文转载,并非原创. 目录 准备工作 运行环境 确认你的安装版本 下载MySQL 安装MySQL 准备安装环境 编译和安装 配置MySQL 单实例配置 单实例配置方法 添加防火墙 启动MySQL 重启 ...

  9. (转)CentOs上配置samba服务

    前 言 在我们使用 Windows 作为客户机的时候,通常有文件.打印共享的需求.作为Windows 网络功能之一,通常可以在 Windows 客户机之间通过 Windows Network 固有的功 ...

随机推荐

  1. openstack之keystone部署

    前言 openstack更新频率是挺快的,每六个月更新一次(命名是是以A-Z的方式,Austin,Bexar...Newton).博主建议大家先可一种版本研究,等某一版本研究透彻了,在去研究新的版本. ...

  2. P1491 集合位置

    题目描述 每次有大的活动,大家都要在一起“聚一聚”,不管是去好乐迪,还是避风塘,或者汤姆熊,大家都要玩的痛快.还记得心语和花儿在跳舞机上的激情与释放,还记得草草的投篮技艺是如此的高超,还记得狗狗的枪法 ...

  3. DFS染色解决区域分块问题UVALive 6663

    怪我比赛的时候想法太过于杂乱了. 注重于区域的属性了.甚至还想用状态压缩或者是hash来描述分块的区域. 其实我们的可以宏观的角度去审视这个问题.就是求分区的问题.那么我们完全可以标记边框的值为1.即 ...

  4. BZOJ4557:[JLOI2016/SHOI2016]侦察守卫——题解

    https://www.lydsy.com/JudgeOnline/problem.php?id=4557 小R和B神正在玩一款游戏.这款游戏的地图由N个点和N-1条无向边组成,每条无向边连接两个点, ...

  5. mysql jdbc 连接url

    jdbc url连接地址格式: jdbc:mysql://[host][,failoverhost...][:port]/[database] [?propertyName1][=propertyVa ...

  6. 细谈select函数(C语言)

    Select在Socket编程中还是比较重要的,可是对于初学Socket的人来说都不太爱用Select写程序,他们只是习惯写诸如connect.accept.recv或recvfrom这样的阻塞程序( ...

  7. vue-transition-move

    <!Doctype> <html> <head> <meta charset="utf-8"> <meta name=&quo ...

  8. ZooKeeper文档(二)

    ZooKeeper:因为协调的分布式系统是一个动物园 ZooKeeper对分布式应用来说是一个高性能的协调服务.它暴露通常的服务-比如命名,配置管理,同步,和组服务-用一种简单的接口,所以你不用从头开 ...

  9. MyBatis框架的使用及源码分析(十三) ResultSetHandler

    在PreparedStatementHandler中的query()方法中,用ResultSetHandler来完成结果集的映射. public <E> List<E> que ...

  10. 解决方案:WindowsError: [Error 2]

    使用Python的rename()函数重命名文件时出现问题,提示 WindowsError: [Error 2] 错误,最初代码如下: def renameFile(filename): filePr ...