storcli/percli的使用场景
storcli/percli常用场景
查看帮助信息
storcli64 help
查看控制器数量
storcli64 show ctrlcount
[root@SZVPN-2 ~]# storcli64 show ctrlcount
CLI Version = 007.0415.0000.0000 Feb 13, 2018
Operating system = Linux 3.10.0-862.11.6.el7.x86_64
Status Code = 0
Status = Success
Description = None
Controller Count = 1
Note:
说明只有一个控制器,也就对应为/c0
一般每台服务器一到两个控制器
在线做raid卷组
storcli64 /c0/eall/sall show
[root@SZVPN-2 ~]# storcli64 /c0/eall/sall show
CLI Version = 007.0415.0000.0000 Feb 13, 2018
Operating system = Linux 3.10.0-862.11.6.el7.x86_64
Controller = 0
Status = Success
Description = Show Drive Information Succeeded.
Drive Information :
=================
------------------------------------------------------------------------------
EID:Slt DID State DG Size Intf Med SED PI SeSz Model Sp Type
------------------------------------------------------------------------------
252:0 14 Onln 0 278.464 GB SAS HDD N N 512B ST9300603SS U -
252:1 21 Onln 0 278.464 GB SAS HDD N N 512B MK3001GRRB U -
252:2 20 Onln 1 557.861 GB SAS HDD N N 512B MBF2600RC U -
252:3 17 Onln 1 557.861 GB SAS HDD N N 512B MBF2600RC U -
252:4 18 Onln 1 557.861 GB SAS HDD N N 512B MBF2600RC U -
252:5 22 Onln 1 557.861 GB SAS HDD N N 512B MBF2600RC U -
252:6 23 Onln 1 557.861 GB SAS HDD N N 512B MBF2600RC U -
252:7 24 UGood - 557.861 GB SAS HDD N N 512B MBF2600RC U -
------------------------------------------------------------------------------
EID-Enclosure Device ID|Slt-Slot No.|DID-Device ID|DG-DriveGroup
DHS-Dedicated Hot Spare|UGood-Unconfigured Good|GHS-Global Hotspare
UBad-Unconfigured Bad|Onln-Online|Offln-Offline|Intf-Interface
Med-Media Type|SED-Self Encryptive Drive|PI-Protection Info
SeSz-Sector Size|Sp-Spun|U-Up|D-Down/PowerSave|T-Transition|F-Foreign
UGUnsp-Unsupported|UGShld-UnConfigured shielded|HSPShld-Hotspare shielded
CFShld-Configured shielded|Cpybck-CopyBack|CBShld-Copyback Shielded
Note:
此时硬盘252:7 也就是插槽号为7的硬盘是刚插上没有raid状态的硬盘,此时对该硬盘做raid0.
为252:7做raid0的VD:
storcli64 /c0 add vd r0 size=all drives=252:7 wb direct strip=128
Note:
r0 是raid0的意思,默认ceph里我们选用单盘做raid0,还有r1 r5 等raid的level.
size=all 所有的空间都用来做该vd;.
drives=252:7 对应新盘的eid/slt,如果是多个盘作为一个VD,可以写252:7,8,9的格式对应slt.
wb 代表write_back模式,wt代表write_through模式.
direct 代表DirectIO 读操作不缓存到raid卡cache ,相对应的是CacheIO会把读操作热数据缓存到raid卡的cache.
strip=128 代表条带大小128kb,单盘无区别,多盘做raid0需要考虑,此处只要跟其他盘保持一致即可,
storcli64 /c0/vall show all
能看到其他vd的strip size.
完成vd添加后,可以看到vd已经存在storcli64 /c0/vall show
[root@SZVPN-2 ~]# storcli64 /c0/vall show
CLI Version = 007.0415.0000.0000 Feb 13, 2018
Operating system = Linux 3.10.0-862.11.6.el7.x86_64
Controller = 0
Status = Success
Description = None
Virtual Drives :
==============
---------------------------------------------------------------
DG/VD TYPE State Access Consist Cache Cac sCC Size Name
---------------------------------------------------------------
0/0 RAID1 Optl RW No RWBD - ON 278.464 GB
1/1 RAID5 Optl RW Yes RWBD - ON 2.178 TB
2/2 RAID0 Optl RW Yes RWBD - ON 557.861 GB
---------------------------------------------------------------
Cac=CacheCade|Rec=Recovery|OfLn=OffLine|Pdgd=Partially Degraded|Dgrd=Degraded
Optl=Optimal|RO=Read Only|RW=Read Write|HD=Hidden|TRANS=TransportReady|B=Blocked|
Consist=Consistent|R=Read Ahead Always|NR=No Read Ahead|WB=WriteBack|
AWB=Always WriteBack|WT=WriteThrough|C=Cached IO|D=Direct IO|sCC=Scheduled
Check Consistency
Note:
DG/VD 2/2即是新添加的VD
系统里lsblk可以看到已经存在:
[root@SZVPN-2 ~]# lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
sda 8:0 0 278.5G 0 disk
├─sda1 8:1 0 1G 0 part /boot
└─sda2 8:2 0 277.5G 0 part
├─cl-root 253:0 0 50G 0 lvm /
├─cl-swap 253:1 0 4G 0 lvm [SWAP]
└─cl-home 253:2 0 223.5G 0 lvm /home
sdb 8:16 0 2.2T 0 disk
└─sdb1 8:17 0 2.2T 0 part /data
sdc 8:32 0 557.9G 0 disk
sdc即为新盘.
删除卷组
通过命令storcli64 /c0/vall show
获取到所有VD信息
[root@SZVPN-2 ~]# storcli64 /c0/vall show
CLI Version = 007.0415.0000.0000 Feb 13, 2018
Operating system = Linux 3.10.0-862.11.6.el7.x86_64
Controller = 0
Status = Success
Description = None
xiang
Virtual Drives :
==============
---------------------------------------------------------------
DG/VD TYPE State Access Consist Cache Cac sCC Size Name
---------------------------------------------------------------
0/0 RAID1 Optl RW No RWBD - ON 278.464 GB
1/1 RAID5 Optl RW Yes RWBD - ON 2.178 TB
2/2 RAID0 Optl RW Yes RWBD - ON 557.861 GB
---------------------------------------------------------------
Cac=CacheCade|Rec=Recovery|OfLn=OffLine|Pdgd=Partially Degraded|Dgrd=Degraded
Optl=Optimal|RO=Read Only|RW=Read Write|HD=Hidden|TRANS=TransportReady|B=Blocked|
Consist=Consistent|R=Read Ahead Always|NR=No Read Ahead|WB=WriteBack|
AWB=Always WriteBack|WT=WriteThrough|C=Cached IO|D=Direct IO|sCC=Scheduled
Check Consistency
此时如果要删除VD2,要确认VD2的对应的系统分区,此处为sdc及该设备的分区sdc1...没有被挂载使用,
删除VD命令: storcli64 /c0/v2 del force
删除后VD即不见了.
[root@SZVPN-2 ~]# storcli64 /c0/vall show
CLI Version = 007.0415.0000.0000 Feb 13, 2018
Operating system = Linux 3.10.0-862.11.6.el7.x86_64
Controller = 0
Status = Success
Description = None
Virtual Drives :
==============
---------------------------------------------------------------
DG/VD TYPE State Access Consist Cache Cac sCC Size Name
---------------------------------------------------------------
0/0 RAID1 Optl RW No RWBD - ON 278.464 GB
1/1 RAID5 Optl RW Yes RWBD - ON 2.178 TB
---------------------------------------------------------------
Cac=CacheCade|Rec=Recovery|OfLn=OffLine|Pdgd=Partially Degraded|Dgrd=Degraded
Optl=Optimal|RO=Read Only|RW=Read Write|HD=Hidden|TRANS=TransportReady|B=Blocked|
Consist=Consistent|R=Read Ahead Always|NR=No Read Ahead|WB=WriteBack|
AWB=Always WriteBack|WT=WriteThrough|C=Cached IO|D=Direct IO|sCC=Scheduled
Check Consistency
修改VD的属性
查看VD的属性
[root@SZVPN-2 ~]# storcli64 /c0/vall show
CLI Version = 007.0415.0000.0000 Feb 13, 2018
Operating system = Linux 3.10.0-862.11.6.el7.x86_64
Controller = 0
Status = Success
Description = None
Virtual Drives :
==============
---------------------------------------------------------------
DG/VD TYPE State Access Consist Cache Cac sCC Size Name
---------------------------------------------------------------
0/0 RAID1 Optl RW No RWBD - ON 278.464 GB
1/1 RAID5 Optl RW Yes RWBD - ON 2.178 TB
2/2 RAID0 Optl RW Yes RWBD - ON 557.861 GB
---------------------------------------------------------------
Cac=CacheCade|Rec=Recovery|OfLn=OffLine|Pdgd=Partially Degraded|Dgrd=Degraded
Optl=Optimal|RO=Read Only|RW=Read Write|HD=Hidden|TRANS=TransportReady|B=Blocked|
Consist=Consistent|R=Read Ahead Always|NR=No Read Ahead|WB=WriteBack|
AWB=Always WriteBack|WT=WriteThrough|C=Cached IO|D=Direct IO|sCC=Scheduled
Check Consistency
VD2的Cache属性是RWBD
,分别是输出下方的注释即: Read Ahead, WriteBack,Direct IO.
将VD2的cache策略=修改为WriteThrough模式:
storcli64 /c0/v2 set wrcache=wt
此时再看v2的状态 Cache一栏将会是RWTD
Note:
set的帮助
storcli64 /c0/v2 set help
[root@SZVPN-2 ~]# storcli64 /c0/v2 set help
Storage Command Line Tool Ver 007.0415.0000.0000 Feb 13, 2018 (c)Copyright 2018, AVAGO Technologies, All Rights Reserved. storcli /cx/vx set ssdcaching=on|off
storcli /cx/vx set hidden=on|off
storcli /cx/vx set fshinting=<value>
storcli /cx/vx set emulationType=0|1|2
storcli /cx/vx set cbsize=0|1|2 cbmode=0|1|2|3|4|7
storcli /cx/vx set wrcache=WT|WB|AWB
storcli /cx/vx set rdcache=RA|NoRA
storcli /cx/vx set iopolicy=Cached|Direct
storcli /cx/vx set accesspolicy=RW|RO|Blocked|RmvBlkd
storcli /cx/vx set pdcache=On|Off|Default
storcli /cx/vx set name=<NameString>
storcli /cx/vx set HostAccess=ExclusiveAccess|SharedAccess
storcli /cx/vx set ds=Default|Auto|None|Max|MaxNoCache
storcli /cx/vx set autobgi=On|Off
storcli /cx/vx set pi=Off
storcli /cx/vx set bootdrive=<on|off>
可以设置各种配置项
将VD2的cache预读策略=修改为NR模式:
storcli64 /c0/v2 set rdcache=NoRA
此时再看v2的状态 Cache一栏将会是NRWTD
在线设置硬盘为直通(jbod)模式
1.确认raid卡支持jbod模式并开启jbod模式:
storcli64 /c0 show all |grep -i jbod
[root@SZVPN-2 ~]# storcli64 /c0 show all|grep -i jbod
Support JBOD = Yes
Support SecurityonJBOD = No
Support JBOD Write cache = No
Enable JBOD = No
Note:
可以看到support JBOD = Yes , 也就是说raid卡支持jbod模式
但是 Enable JBOD = No , 说明当前raid卡没有开启jbod模式,此时需要手工开启
[root@SZVPN-2 ~]# storcli64 /c0 set jbod=on
CLI Version = 007.0415.0000.0000 Feb 13, 2018
Operating system = Linux 3.10.0-862.11.6.el7.x86_64
Controller = 0
Status = Success
Description = None Controller Properties :
===================== ----------------
Ctrl_Prop Value
----------------
JBOD ON
----------------
[root@SZVPN-2 ~]# storcli64 /c0 show all |grep -i jbod
Support JBOD = Yes
Support SecurityonJBOD = No
Support JBOD Write cache = No
Enable JBOD = Yes
enable JBOD = Yes ,已经开启了jbod模式
2.把指定设备设置成jbod模式:
storcli64 /c0/e252/s7 set jbod
[root@SZVPN-2 ~]# storcli64 /c0/e252/s7 set jbod
CLI Version = 007.0415.0000.0000 Feb 13, 2018
Operating system = Linux 3.10.0-862.11.6.el7.x86_64
Controller = 0
Status = Success
Description = Set Drive JBOD Succeeded.
[root@SZVPN-2 ~]# storcli64 /c0/e252/s7 show
CLI Version = 007.0415.0000.0000 Feb 13, 2018
Operating system = Linux 3.10.0-862.11.6.el7.x86_64
Controller = 0
Status = Success
Description = Show Drive Information Succeeded.
Drive Information :
=================
------------------------------------------------------------------------------
EID:Slt DID State DG Size Intf Med SED PI SeSz Model Sp Type
------------------------------------------------------------------------------
252:7 24 JBOD - 557.861 GB SAS HDD N N 512B MBF2600RC U -
------------------------------------------------------------------------------
Note:
此时该设备已经是jbod模式了.
3.修改jbod模式为UG模式:
如果要将该设备的jbod模式撤销掉storcli64 /c0/e252/s7 set good force
[root@SZVPN-2 ~]# storcli64 /c0/e252/s7 set good force
CLI Version = 007.0415.0000.0000 Feb 13, 2018
Operating system = Linux 3.10.0-862.11.6.el7.x86_64
Controller = 0
Status = Success
Description = Set Drive Good Succeeded.
[root@SZVPN-2 ~]# storcli64 /c0/e252/s7 show
CLI Version = 007.0415.0000.0000 Feb 13, 2018
Operating system = Linux 3.10.0-862.11.6.el7.x86_64
Controller = 0
Status = Success
Description = Show Drive Information Succeeded.
Drive Information :
=================
------------------------------------------------------------------------------
EID:Slt DID State DG Size Intf Med SED PI SeSz Model Sp Type
------------------------------------------------------------------------------
252:7 24 UGood - 557.861 GB SAS HDD N N 512B MBF2600RC U -
------------------------------------------------------------------------------
Note:
设备变回UGood状态,可以重新配置raid卷组了.
storcli/percli的使用场景的更多相关文章
- 拨开迷雾,找回自我:DDD 应对具体业务场景,Domain Model 到底如何设计?
写在前面 除了博文内容之外,和 netfocus 兄的讨论,也可以让你学到很多(至少我是这样),不要错过哦. 阅读目录: 迷雾森林 找回自我 开源地址 后记 毫无疑问,领域驱动设计的核心是领域模型,领 ...
- [NodeJS] 优缺点及适用场景讨论
概述: NodeJS宣称其目标是“旨在提供一种简单的构建可伸缩网络程序的方法”,那么它的出现是为了解决什么问题呢,它有什么优缺点以及它适用于什么场景呢? 本文就个人使用经验对这些问题进行探讨. 一. ...
- Asp.Net MVC中使用StreamReader读取“Post body”之应用场景。
场景:有三个市场(Global.China.USA),对前台传过来的数据有些验证需要细化到每个市场去完成. 所以就出现了基类(Global)和派生类(China.USA) 定义基类(Global)Pe ...
- Java学习之反射机制及应用场景
前言: 最近公司正在进行业务组件化进程,其中的路由实现用到了Java的反射机制,既然用到了就想着好好学习总结一下,其实无论是之前的EventBus 2.x版本还是Retrofit.早期的View注解框 ...
- Android线程管理之ThreadLocal理解及应用场景
前言: 最近在学习总结Android的动画效果,当学到Android属性动画的时候大致看了下源代码,里面的AnimationHandler存取使用了ThreadLocal,激起了我很大的好奇心以及兴趣 ...
- MVC常遇见的几个场景代码分享
本次主要分享几个场景的处理代码,有更好处理方式多多交流,相互促进进步:代码由来主要是这几天使用前端Ace框架做后台管理系统,这Ace是H5框架里面的控件效果挺多的,做兼容也很好,有点遗憾是控件效果基本 ...
- RabbitMq应用一的补充(RabbitMQ的应用场景)
直接进入正题. 一.异步处理 场景:发送手机验证码,邮件 传统古老处理方式如下图 这个流程,全部在主线程完成,注册->入库->发送邮件->发送短信,由于都在主线程,所以要等待每一步完 ...
- javascript之闭包理解以及应用场景
半个月没写博文了,最近一直在弄小程序,感觉也没啥好写的. 之前读了js权威指南,也写了篇博文,但是实话实说当初看闭包确实还是一头雾水.现在时隔一个多月(当然这一段时间还是一直有在看闭包的相关知识)理解 ...
- TYPESDK手游聚合SDK服务端设计思路与架构之一:应用场景分析
TYPESDK 服务端设计思路与架构之一:应用场景分析 作为一个渠道SDK统一接入框架,TYPESDK从一开始,所面对的需求场景就是多款游戏,通过一个统一的SDK服务端,能够同时接入几十个甚至几百个各 ...
随机推荐
- 解决DBGridEh遍历记录后不移动当前行位置的方法
解决DBGridEh遍历记录后不移动当前行位置的方法 在用DBGridEh配合ClientDataSet使用时,需要知道用户选择了哪些记录,可用遍历记录的方法查询选择列是否为真,但在这之后,Clien ...
- 转载:深入理解Spring MVC 思想
原文作者:赵磊 原文地址:http://elf8848.iteye.com/blog/875830 目录 一.前言二.spring mvc 核心类与接口三.spring mvc 核心流程图 四.sp ...
- flask(2.0)
目录 一. Flask基础(一) 1.Flask启动 2.路由 3.Response 4.Request 5.Jinja2 6.session 二.Flask基础(二) 1.路由配置 (1)metho ...
- clrscr()及gotoxy()函数
1.clrscr() 作用:清屏,跟 cmd 中的清屏作用一样 注意:只有在 Trubo C 中能用,需要包含头文件:conio.h 替代:system("cls"); 需要头文件 ...
- 感知器做二分类的原理及python实现
本文目录: 1. 感知器 2. 感知器的训练法则 3. 梯度下降和delta法则 4. python实现 1. 感知器[1] 人工神经网络以感知器(perceptron)为基础.感知器以一个实数值向量 ...
- Unreal Engine* 4/英特尔® VTune™ Amplifier 使用指南
借助英特尔 VTune Amplifier,可以通过单一易用的分析界面获得先进的分析功能.UE4 和英特尔 VTune Amplifier 相互配合,支持调查代码并进行分析,从而在多个内核上顺畅运行. ...
- python 读取文件夹中所有同类型的文件 并用pandas合并
import globimport osimport pandas as pd read_path = 'D:/Data' # 要读取的文件夹的地址read_excel = glob.glob(os. ...
- 【POJ - 2078】Matrix(dfs)
-->Matrix Descriptions: 输入一个n×n的矩阵,可以对矩阵的每行进行任意次的循环右移操作,行的每一次右移后,计算矩阵中每一列的和的最大值,输出这些最大值中的最小值. Sam ...
- SpringCloud学习(六)分布式配置中心(Spring Cloud Config)(Finchley版本)
在上一篇文章讲述zuul的时候,已经提到过,使用配置服务来保存各个服务的配置文件.它就是Spring Cloud Config. 简介 在分布式系统中,由于服务数量巨多,为了方便服务配置文件统一管理, ...
- JS、JQUERY 获取浏览器和屏幕各种高度宽度
好长时间没有更新博客了... 把我最近积累的一点知识点放上博客,以后以备不需之要,也给大家整理一下.. Javascript: IE中:document.body.clientWidth ==> ...