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/
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
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 label type: dos
Disk identifier: 0x0e9c0acb
Device Boot Start End Blocks Id System
/dev/sdb1 2048 419430399 209714176 83 Linux
**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
- format disk
[root@db210_12:15:04 /backup]
#fdisk /dev/sdc
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 PV & VG& LV
[root@db210_12:15:23 /backup]
#pvcreate /dev/sdc1
Physical volume "/dev/sdc1" successfully created.
[root@db210_12:15:47 /backup]
#pvs
PV VG Fmt Attr PSize PFree
/dev/sdc1 lvm2 --- <500.00g <500.00g
#vgcreate MySQL /dev/sdc1
Volume group "MySQL" successfully created
#vgs
VG #PV #LV #SN Attr VSize VFree
MySQL 1 0 0 wz--n- <500.00g <500.00g
#lvcreate -L499G MySQL
Logical volume "lvol0" created.
- Format LV and Mount the LV
[root@db210_12:21:52 /backup]
#mkfs.xfs /dev/MySQL/lvol0
meta-data=/dev/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 log bsize=4096 blocks=63872, version=2
= sectsz=512 sunit=0 blks, lazy-count=1
realtime =none extsz=4096 blocks=0, rtextents=0
#mkdir /data2
[root@db210_12:24:39 /backup]
#mount /dev/MySQL/lvol0 /data2
[root@db210_12:25:18 /data]
#mv * /data2/
- show the mounted disk .
#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/sdb1 200G 33M 200G 1% /data
/dev/sda1 497M 119M 379M 24% /boot
tmpfs 783M 0 783M 0% /run/user/0
/dev/mapper/MySQL-lvol0 499G 44G 456G 9% /data2
- To make the mount persistent across reboots
vi /etc/fstab
**********************************************************
# /etc/fstab
# Created by anaconda on Sat Jun 30 21:49:24 2018
#
# Accessible filesystems, by reference, are maintained under '/dev/disk'
# See man pages fstab(5), findfs(8), mount(8) and/or blkid(8) for more info
#
UUID=4e617a1c-dcd5-4891-b649-a096e15371d9 / xfs defaults 0 0
UUID=202e21ef-c8f9-44b2-8fd0-e9dee6be5df8 /boot xfs defaults 0 0
UUID=f249e917-5db3-40e4-8738-c7c17077e8d5 /home xfs defaults 0 0
UUID=738f0097-2ef4-42b3-8782-f96fc3eaa95d swap swap defaults 0 0
/dev/mapper/MySQL-lvol0 /data xfs defaults 0 0
Centos_Lvm_Create pv vg lv and mount的更多相关文章
- 【Linux】pv vg lv, 加盘,扩容磁盘
PV VG LV关系:一个物理盘(或一个lun)就是一个pv,有几个物理盘就有几个pv.一个或者几个硬盘可以组成一个vg,一个系统可以包括好几个vg,比如rootvg ,datavg等 PV组成VG, ...
- AIX中PV,VG,LV及FS常用相关命令
1.PV常用相关命令 1)lsdev:列出ODM(Object Data Manager)中的设备. 2)chdev:修改一个AIX设备的属性. 3)mkdev:创建一个AIX设备. 4)chpv:修 ...
- linux上创建PV/VG/LV
LVM的整体思路是: 首先创建PV-->然后创建VG并将多个PV加到VG里-->然后创建LV-->格式化分区-->mount分区 1.创建PV pvcreate /dev/sd ...
- LUN/PV/VG/LV
存储中的几个概念,参考一些网络资料重新画个图梳理下,如下: LUN:lun是针对存储设备(如磁盘阵列)的逻辑概念,物理上可能就是几块硬盘.那么主机的HBA 卡看到的存储上的存储资源就靠主要两个东西定位 ...
- centos扩容(pv,vg,lv)
preFace: (应用场景需求分析)
- linux vg lv pv
= pv由物理卷或者分区组成 pv可以组成一个或者多个vg vg可以分成多个lv 方便扩展 pvs vgs lvs 可以查看当前存在的pv vg lv 我的centos硬盘20g 使用了一 ...
- AIX存储LV PV VG (转载)
1.基本概念:PV 物理卷:普通的直接访问的存储设备,有固定的和可移动的之分,代表性的就是硬盘.vg 卷组:AIX中最大的存储单位,一个卷组由一组物理硬盘组成,也就是由一个或多个物理卷组成.pp 物理 ...
- aix vg lv pv
lsvg lsvg -o lsvg rootvg 查看rootvg的信息 lsvg -p rootvg 查看rootvg卷里的物理硬盘以及分布信息 lsvg -l rootvg 查看rootvg卷下的 ...
- lvm管理:扩展lv、删除pv、lv等
从卷组VG里扩展lv.删除pv,并删除物理卷PV 一.扩展LV.缩小LV 1.卸载LV 命令:umount "挂载目录" 2.扩展LV 命令:lvextend -L +500m ...
随机推荐
- C++基础知识(二)
八. 继承:让某个类的对象获得另一个类的对象的特性.通过继承可实现代码重用,即从已存在的类派生出的一个新类将自动具有原来那个类的特性. 类的继承还具有:(1)单向性:A类为B类的基类(父类),则派生类 ...
- (转)python 搭建libsvm方法。python版本和libsvm版本匹配很重要!
<集体智慧编程>关于婚介数据集的SVM分类 转自:http://muilpin.blog.163.com/blog/static/165382936201131875249123/ 作 ...
- bzoj 1037: [ZJOI2008]生日聚会Party (dp)
dp,但是要顺推容易点 const mm=; var f:..,..,..,..]of longint; n,m,kk,now,sum,i,j,k1,k2:longint; function max( ...
- Javascript基础之-强制类型转换(二)
思考下面这个问题: console.log(+"123"); // 123 console.log(-"123"); // -123 console.log(+ ...
- 无序数组中第Kth大的数
题目:找出无序数组中第Kth大的数,如{63,45,33,21},第2大的数45. 输入: 第一行输入无序数组,第二行输入K值. 该是内推滴滴打车时(2017.8.26)的第二题,也是<剑指of ...
- bzoj2083: [Poi2010]Intelligence test(二分+vector)
只是记录一下vector的用法 v.push_back(x)加入x v.pop_back()弹出最后一个元素 v[x]=v.back(),v.pop_back()删除x,但是会打乱vector顺序 v ...
- bzoj1062【Noi2008】糖果雨
orz.....神tm数形结合题 题意:http://www.lydsy.com/JudgeOnline/problem.php?id=1062 插入线段,删除线段,查询区间内线段个数,线段随时间往复 ...
- ReentrantLock和synchronized区别和联系?
相同:ReentrantLock提供了synchronized类似的功能和内存语义,都是可重入锁. 不同: 1.ReentrantLock功能性方面更全面,比如时间锁等候,可中断锁等候,锁投票等,因此 ...
- XOR and Favorite Number (莫对算法)
E. XOR and Favorite Number time limit per test 4 seconds memory limit per test 256 megabytes input s ...
- PIP 批量更新改为清华这边的镜像更新
之前pip批量更新的时候发现有些包无法更新,而且速度也特别慢,今天尝试了下清华的镜像,速度是真快 # coding=utf-8import pipfrom subprocess import call ...