dmdecode 与 megacli 命令用法参考

测试机器 10.199.128.69

dmdecode 常用命令

机器型号

[root@test_raid ~]# dmidecode | grep "Product"
        Product Name: PowerEdge R720xd
        Product Name: 068CDY

厂商

[root@test_raid ~]# dmidecode| grep  "Manufacturer"
        Manufacturer: Dell Inc.

序号信息

[root@test_raid ~]# dmidecode | grep -B 4 "Serial Number"  | more
System Information
        Manufacturer: Dell Inc.
        Product Name: PowerEdge R720xd
        Version: Not Specified
        Serial Number: 8V3Q342
--
Base Board Information
        Manufacturer: Dell Inc.
        Product Name: 068CDY
        Version: A01
        Serial Number: ..CN779214AR02CC.

CPU 信息

[root@test_raid ~]# dmidecode | grep  "CPU"
        Socket Designation: CPU1
        Version:       Intel(R) Xeon(R) CPU E5-2695 v2 @ 2.40GHz
        Socket Designation: CPU2
        Version:       Intel(R) Xeon(R) CPU E5-2695 v2 @ 2.40GHz

物理 CPU 个数

[root@test_raid ~]# dmidecode | grep  "Socket Designation: CPU" |wc -l
2

生产日期

[root@test_raid ~]# dmidecode | grep "Date"
        Release Date: 07/09/2014

megacli 常用命令

电源管理

充电状态

[root@test_raid ~]# megacli -AdpBbuCmd -GetBbuStatus -aALL |grep "Charger Status"
Charger Status: Complete

充电百分比

[root@test_raid ~]# megacli -AdpBbuCmd -GetBbuStatus -aALL |grep "Relative State of Charge"
Relative State of Charge: 100 %

当前 RAID 数量

[root@test_raid ~]# megacli -cfgdsply -aALL |grep "Number of DISK GROUPS:"
Number of DISK GROUPS: 1

信息检测

RAID 卡信息

[root@test_raid ~]# megacli -cfgdsply –aALL  | more

==============================================================================
Adapter: 0
Product Name: PERC H710P Mini
Memory: 1024MB
BBU: Present
Serial No: 49F033N
==============================================================================
Number of DISK GROUPS: 1

DISK GROUP: 0
Number of Spans: 1
SPAN: 0
Span Reference: 0x00
Number of PDs: 2
Number of VDs: 1
Number of dedicated Hotspares: 0
Virtual Drive Information:
Virtual Drive: 0 (Target Id: 0)
Name                :system_vd
RAID Level          : Primary-1, Secondary-0, RAID Level Qualifier-0
Size                : 3.637 TB
Mirror Data         : 3.637 TB
State               : Optimal
Strip Size          : 64 KB
Number Of Drives    : 2
Span Depth          : 1
Default Cache Policy: WriteBack, ReadAdaptive, Direct, No Write Cache if Bad BBU
Current Cache Policy: WriteBack, ReadAdaptive, Direct, No Write Cache if Bad BBU
Default Access Policy: Read/Write
Current Access Policy: Read/Write
Disk Cache Policy   : Disk's Default
Ongoing Progresses:
  Background Initialization: Completed 13%, Taken 63 min.
Encryption Type     : None
Default Power Savings Policy: Controller Defined
Current Power Savings Policy: None
Can spin up in 1 minute: Yes
LD has drives that support T10 power conditions: Yes
LD's IO profile supports MAX power savings with cached writes: No
Bad Blocks Exist: No
Is VD Cached: Yes
Cache Cade Type : Read Only
Physical Disk Information:
Physical Disk: 0
Enclosure Device ID: 32
Slot Number: 0
Drive's postion: DiskGroup: 0, Span: 0, Arm: 0
Enclosure position: 1
Device Id: 0
WWN: 5000C50062A960D0
Sequence Number: 2
Media Error Count: 0
Other Error Count: 0
Predictive Failure Count: 0
Last Predictive Failure Event Seq Number: 0
PD Type: SAS

Raw Size: 3.638 TB [0x1d1c0beb0 Sectors]
Non Coerced Size: 3.637 TB [0x1d1b0beb0 Sectors]
Coerced Size: 3.637 TB [0x1d1b00000 Sectors]
Firmware state: Online, Spun Up
Device Firmware Level: GS0F
Shield Counter: 0
Successful diagnostics completion on :  N/A
SAS Address(0): 0x5000c50062a960d1
SAS Address(1): 0x0
Connected Port Number: 0(path0)
Inquiry Data: SEAGATE ST4000NM0023    GS0FZ1Z6ABTC
FDE Capable: Not Capable
FDE Enable: Disable
Secured: Unsecured
Locked: Unlocked
Needs EKM Attention: No
Foreign State: None
Device Speed: 6.0Gb/s
Link Speed: 6.0Gb/s
Media Type: Hard Disk Device
Drive Temperature :29C (84.20 F)
PI Eligibility:  No
Drive is formatted for PI information:  No
PI: No PI
Port-0 :
Port status: Active
Port's Linkspeed: 6.0Gb/s
Port-1 :
Port status: Active
Port's Linkspeed: Unknown
Drive has flagged a S.M.A.R.T alert : No

Physical Disk: 1
Enclosure Device ID: 32
Slot Number: 1
Drive's postion: DiskGroup: 0, Span: 0, Arm: 1
Enclosure position: 1
Device Id: 1
WWN: 5000C50062A98C78
Sequence Number: 2
Media Error Count: 0
Other Error Count: 0
Predictive Failure Count: 0
Last Predictive Failure Event Seq Number: 0
PD Type: SAS

Raw Size: 3.638 TB [0x1d1c0beb0 Sectors]
Non Coerced Size: 3.637 TB [0x1d1b0beb0 Sectors]
Coerced Size: 3.637 TB [0x1d1b00000 Sectors]
Firmware state: Online, Spun Up
Device Firmware Level: GS0F
Shield Counter: 0
Successful diagnostics completion on :  N/A
SAS Address(0): 0x5000c50062a98c79
SAS Address(1): 0x0
Connected Port Number: 0(path0)
Inquiry Data: SEAGATE ST4000NM0023    GS0FZ1Z6ABD4
FDE Capable: Not Capable
FDE Enable: Disable
Secured: Unsecured
Locked: Unlocked
Needs EKM Attention: No
Foreign State: None
Device Speed: 6.0Gb/s
Link Speed: 6.0Gb/s
Media Type: Hard Disk Device
Drive Temperature :29C (84.20 F)
PI Eligibility:  No
Drive is formatted for PI information:  No
PI: No PI
Port-0 :
Port status: Active
Port's Linkspeed: 6.0Gb/s
Port-1 :
Port status: Active
Port's Linkspeed: Unknown
Drive has flagged a S.M.A.R.T alert : No

其他物理信息

[root@test_raid ~]# megacli -PDList -aALL 

当前 RAID 磁盘信息

[root@test_raid ~]# megacli -LDInfo -LALL –aAll

Adapter 0 -- Virtual Drive Information:
Virtual Drive: 0 (Target Id: 0)
Name                :system_vd
RAID Level          : Primary-1, Secondary-0, RAID Level Qualifier-0
Size                : 3.637 TB
Mirror Data         : 3.637 TB
State               : Optimal
Strip Size          : 64 KB
Number Of Drives    : 2
Span Depth          : 1
Default Cache Policy: WriteBack, ReadAdaptive, Direct, No Write Cache if Bad BBU
Current Cache Policy: WriteBack, ReadAdaptive, Direct, No Write Cache if Bad BBU
Default Access Policy: Read/Write
Current Access Policy: Read/Write
Disk Cache Policy   : Disk's Default
Ongoing Progresses:
  Background Initialization: Completed 14%, Taken 64 min.
Encryption Type     : None
Default Power Savings Policy: Controller Defined
Current Power Savings Policy: None
Can spin up in 1 minute: Yes
LD has drives that support T10 power conditions: Yes
LD's IO profile supports MAX power savings with cached writes: No
Bad Blocks Exist: No
Is VD Cached: Yes
Cache Cade Type : Read Only

raid 控制器个数

[root@test_raid ~]# megacli  -adpCount

Controller Count: 1.

raid 控制器时间

[root@test_raid ~]# megacli -AdpGetTime –aALL

Adapter 0:
    Date: 12/31/2014
    Time: 16:21:15

缓存及策略

raid cache 策略

[root@test_raid ~]# megacli  -cfgdsply -aALL |grep Polic
Default Cache Policy: WriteBack, ReadAdaptive, Direct, No Write Cache if Bad BBU
Current Cache Policy: WriteBack, ReadAdaptive, Direct, No Write Cache if Bad BBU
Default Access Policy: Read/Write
Current Access Policy: Read/Write
Disk Cache Policy   : Disk's Default
Default Power Savings Policy: Controller Defined
Current Power Savings Policy: None

查看磁盘缓存策略

[root@test_raid ~]# megacli -LDGetProp -Cache -L0 -a0   <- 第一个 RAID
[root@test_raid ~]# megacli -LDGetProp -Cache -L1 -a0   <- 第二个 RAID
[root@test_raid ~]# megacli -LDGetProp -Cache -LALL -a0

Adapter 0-VD 0(target id: 0): Cache Policy:WriteBack, ReadAdaptive, Direct, No Write Cache if bad BBU

设置磁盘缓存策略

缓存策略解释:

WT    (Write through)
WB    (Write back)
NORA  (No read ahead)
RA    (Read ahead)
ADRA  (Adaptive read ahead)
Cached
Direct

-RW|RO|Blocked|RemoveBlocked | WT|WB|ForcedWB [-Immediate] |RA|NORA | DsblP | Cached|Direct | -EnDskCache|DisDskCache | CachedBadBBU|NoCachedBadBBU
        -Lx|-L0,1,2|-Lall -aN|-a0,1,2|-aALL

设定直接回写

[root@test_raid ~]# megacli -LDSetProp WT -L0 -a0

Set Write Policy to WriteThrough on Adapter 0, VD 0 (target id: 0) success

直接回写

[root@test_raid ~]# megacli -LDSetProp -Direct -L0 -a0

Set Cache Policy to Direct on Adapter 0, VD 0 (target id: 0) success

关闭缓存

[root@test_raid ~]# megacli -LDSetProp -DisDskCache -L0 -a0

Set Disk Cache Policy to Disabled on Adapter 0, VD 0 (target id: 0) success

 raid 管理

磁盘检测方法

查询磁盘个数, 序号

[root@test_raid ~]# megacli -PDList -aALL | grep 'Inquiry Data:'
Inquiry Data: SEAGATE ST4000NM0023    GS0FZ1Z6ABTC
Inquiry Data: SEAGATE ST4000NM0023    GS0FZ1Z6ABD4
Inquiry Data: SEAGATE ST4000NM0023    GS0FZ1Z69SFJ
Inquiry Data: SEAGATE ST4000NM0023    GS0FZ1Z6A4Z7
Inquiry Data: SEAGATE ST4000NM0023    GS0FZ1Z6A4X5
Inquiry Data: SEAGATE ST4000NM0023    GS0FZ1Z6A5YG
Inquiry Data: SEAGATE ST4000NM0023    GS0FZ1Z6AB8R
Inquiry Data: SEAGATE ST4000NM0023    GS0FZ1Z6AALM
Inquiry Data: SEAGATE ST4000NM0023    GS0FZ1Z6A4N0
Inquiry Data: SEAGATE ST4000NM0023    GS0FZ1Z6A51S
Inquiry Data: SEAGATE ST4000NM0023    GS0FZ1Z69ST5
Inquiry Data: SEAGATE ST4000NM0023    GS0FZ1Z6A4V1

[root@test_raid ~]# megacli -PDList -aALL | grep WWN
WWN: 5000C50062A960D0
WWN: 5000C50062A98C78
WWN: 5000C50062A9AF54
WWN: 5000C50062A98F30
WWN: 5000C50062A993AC
WWN: 5000C50062A93EA4
WWN: 5000C50062A9998C
WWN: 5000C50062A9CB4C
WWN: 5000C50062A9B52C
WWN: 5000C50062A98CB0
WWN: 5000C50062A99CF0
WWN: 5000C50062A99990

检测磁盘 ID 注意, 该ID 值用于标注磁盘

[root@test_raid ~]# megacli -PDlist -aALL | grep "ID"  | uniq
Enclosure Device ID: 32

检测当前 raid 组及每个 raid 组对应的磁盘

[root@test_raid ~]#  megacli -cfgdsply –aALL  | grep -E "DISK\ GROUP|Slot\ Number"
Number of DISK GROUPS: 1
DISK GROUP: 0
Slot Number: 0
Slot Number: 1

查询当前磁盘的序号, 并且可以检测磁盘是否损坏 (注, 当前第 6 个磁盘出问题)

[root@test_raid ~]# megacli -PDList -aALL | grep -E "Drive\:\ \ Not\ Supported|Slo"
Slot Number: 0
Slot Number: 1
Slot Number: 2
Slot Number: 3
Slot Number: 4
Slot Number: 5
Drive:  Not Supported
Slot Number: 6
Slot Number: 7
Slot Number: 8
Slot Number: 9
Slot Number: 10
Slot Number: 11

foreign 管理

创建 RAID 前, 需要检测是否具有 foreign 配置, 如果有需要清除( foreign = 某个新加入的磁盘之前已经创建了 RAID, 需要初始化)

[root@test_raid ~]# megacli -PDlist -aALL | grep "Foreign State"
Foreign State: None
Foreign State: None
Foreign State: None
Foreign State: None
Foreign State: None
Foreign State: None  (Foreign) 加入具有 foreign 配置, 则显示该配置  (对应上一个命令中 Slot Number: 5磁盘)
Foreign State: None
Foreign State: None
Foreign State: None
Foreign State: None
Foreign State: None
Foreign State: None

把上面标注为 Foreign 磁盘标注为 unconfigrue good

[root@test_raid ~]# megacli -PDMakeGood -PhysDrv[32:5] -a0

Adapter: 0: Failed to change PD state at EnclId-32 SlotId-5.  [由于当前并不是 foreign 状态, 因此返回错误]

Exit Code: 0x01

清除 foreign 配置

[root@test_raid ~]# megacli -CfgForeign -Scan -a0

There is no foreign configuration on controller 0.

Exit Code: 0x00

raid 0 管理

创建 raid 0 方法 ( 3 个磁盘 )

[root@test_raid ~]#  megacli -CfgLdAdd -r0 [32:2,32:3,32:4] WB Direct -a0

Adapter 0: Created VD 1

Adapter 0: Configured the Adapter!!

Exit Code: 0x00

检查 raid 组与对应磁盘

[root@test_raid ~]# megacli -cfgdsply –aALL  | grep -E "DISK\ GROUP|Slot\ Number|RAID\ Level|Target"
Number of DISK GROUPS: 2
DISK GROUP: 0
Virtual Drive: 0 (Target Id: 0)          [磁盘虚拟 ID, 删除时候使用]
RAID Level          : Primary-1, Secondary-0, RAID Level Qualifier-0      [primay-1]  raid 1
Slot Number: 0
Slot Number: 1
DISK GROUP: 1
Virtual Drive: 1 (Target Id: 1)
RAID Level          : Primary-0, Secondary-0, RAID Level Qualifier-0      [primary-0]  raid 0
Slot Number: 2
Slot Number: 3
Slot Number: 4

查询磁盘是否在创建中

[root@test_raid ~]# megacli -PDRbld -ProgDsply -PhysDrv [32:3,32,2,32,4] -aALL
Device(Encl-32 Slot-3) is not in rebuild process
Device(Encl-32 Slot-2) is not in rebuild process
Device(Encl-32 Slot-4) is not in rebuild process

删除某个 RAID

[root@test_raid ~]# megacli -CfgLdDel -L1 -a0

 Virtual Disk is associate with Cache Cade. Please Use force option to delete   <- 需要使用 force 参数

[root@test_raid ~]# megacli -CfgLdDel -L1 -force -a0

Adapter 0: Deleted Virtual Drive-1(target id-1)

Exit Code: 0x00

raid 1 管理

利用两个磁盘创建 RAID 1

[root@test_raid ~]# megacli -CfgLdAdd -r1 [32:5,32:6] WB Direct -a0

Adapter 0: Created VD 2

Adapter 0: Configured the Adapter!!

Exit Code: 0x00

检测方法

[root@test_raid ~]# megacli -cfgdsply –aALL  | grep -E "DISK\ GROUP|Slot\ Number|RAID\ Level|Target"
Number of DISK GROUPS: 3
DISK GROUP: 0
Virtual Drive: 0 (Target Id: 0)
RAID Level          : Primary-1, Secondary-0, RAID Level Qualifier-0
Slot Number: 0
Slot Number: 1
DISK GROUP: 1
Virtual Drive: 1 (Target Id: 1)
RAID Level          : Primary-0, Secondary-0, RAID Level Qualifier-0
Slot Number: 2
Slot Number: 3
Slot Number: 4
DISK GROUP: 2
Virtual Drive: 2 (Target Id: 2)
RAID Level          : Primary-1, Secondary-0, RAID Level Qualifier-0
Slot Number: 5
Slot Number: 6

删除方法同上

[root@test_raid ~]# megacli -CfgLdDel -L2 -force -a0

RAID 5 管理

一个热备 3 个组 RAID 方法

[root@test_raid ~]# megacli -CfgLdAdd -r5 [32:7,32:8,32:9] WB Direct -Hsp[32:10] -a0

Adapter 0: Created VD 3
Adapter: 0: Set Physical Drive at EnclId-32 SlotId-10 as Hot Spare Success.

Adapter 0: Configured the Adapter!!

Exit Code: 0x00

组 RAID 马上完成, 组 RAID 后, 马上能够在磁盘上看见设备名称

[root@test_raid ~]# megacli -PDRbld -ProgDsply -PhysDrv [32:7,32:8,32:9] -aALL

Device(Encl-32 Slot-7) is not in rebuild process
Device(Encl-32 Slot-8) is not in rebuild process
Device(Encl-32 Slot-9) is not in rebuild process

查询当前 RAID 5 磁盘大小

[root@test_raid ~]#  fdisk -l /dev/sdd
Disk /dev/sdd: 8000.5 GB, 8000450330624 bytes
255 heads, 63 sectors/track, 972666 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000

查询热盘方法

[root@test_raid ~]# megacli -PDList -aALL |  grep -E "DISK\ GROUP|Slot\ Number|postion:|Firmware\ state:"
Slot Number: 0                                      <- 磁盘序号
Drive's postion: DiskGroup: 0, Span: 0, Arm: 0      <- DiskGroup: 0 标注当前属于那个 RAID 组
Firmware state: Online, Spun Up                     <- Online 标注磁盘当前在线
Slot Number: 1
Drive's postion: DiskGroup: 0, Span: 0, Arm: 1
Firmware state: Online, Spun Up
Slot Number: 2
Drive's postion: DiskGroup: 1, Span: 0, Arm: 0
Firmware state: Online, Spun Up
Slot Number: 3
Drive's postion: DiskGroup: 1, Span: 0, Arm: 1
Firmware state: Online, Spun Up
Slot Number: 4
Drive's postion: DiskGroup: 1, Span: 0, Arm: 2
Firmware state: Online, Spun Up
Slot Number: 5
Drive's postion: DiskGroup: 2, Span: 0, Arm: 0
Firmware state: Online, Spun Up
Slot Number: 6
Drive's postion: DiskGroup: 2, Span: 0, Arm: 1
Firmware state: Online, Spun Up
Slot Number: 7
Drive's postion: DiskGroup: 3, Span: 0, Arm: 0
Firmware state: Online, Spun Up
Slot Number: 8
Drive's postion: DiskGroup: 3, Span: 0, Arm: 1
Firmware state: Online, Spun Up
Slot Number: 9
Drive's postion: DiskGroup: 3, Span: 0, Arm: 2
Firmware state: Online, Spun Up
Slot Number: 10
Firmware state: Hotspare, Spun Up                   <- HotSpare 表示当前为热盘
Slot Number: 11
Firmware state: Unconfigured(good), Spun Up

RAID 5 扩容[失败]

[root@test_raid ~]# megacli -LDRecon -Start -r5 -Add -PhysDrv[32:11] -L3 -a0

Failed to Start Reconstruction of Virtual Drive.

FW error description:
  The requested virtual drive operation cannot be performed because consistency check is in progress.

Exit Code: 0x17

故障模拟

模拟故障磁盘, 遇到故障后, 需要把磁盘执行 OFFLINE 操作

[root@test_raid ~]# megacli -PDOffline -PhysDrv [32:9] -a0

Adapter: 0: EnclId-32 SlotId-9 state changed to OffLine.

Exit Code: 0x00

当磁盘 9 执行 OFFLINE 后, 热备会自动 REBUILD

[root@test_raid ~]# megacli -PDList -aALL |  grep -E "DISK\ GROUP|Slot\ Number|postion:|Firmware\ state:"

Drive's postion: DiskGroup: 3, Span: 0, Arm: 0
Firmware state: Online, Spun Up
Slot Number: 8
Drive's postion: DiskGroup: 3, Span: 0, Arm: 1
Firmware state: Online, Spun Up
Slot Number: 9
Firmware state: Unconfigured(good), Spun Up         <- offline 操作后状态会自动修改
Slot Number: 10
Drive's postion: DiskGroup: 3, Span: 0, Arm: 2
Firmware state: Rebuild                             <--- 自动进行 rebuild 状态

查询 rebuild 状态

[root@test_raid ~]# megacli -PDRbld -ProgDsply -PhysDrv [32:10] -aALL

    Rebuild progress of physical drives...

  Enclosure:Slot               Percent Complete                       Time Elps
       032 :10     ***********************00 %*********************** 00:03:44

把第九个磁盘重新作为热备使用

[root@test_raid ~]# megacli -PDHSP   -Set   -Dedicated  -Array3  -physdrv[32:9] -a0

Adapter: 0: Set Physical Drive at EnclId-32 SlotId-9 as Hot Spare Success.

Exit Code: 0x00

查询状态

Firmware state: Online, Spun Up
Slot Number: 7
Drive's postion: DiskGroup: 3, Span: 0, Arm: 0
Firmware state: Online, Spun Up
Slot Number: 8
Drive's postion: DiskGroup: 3, Span: 0, Arm: 1
Firmware state: Online, Spun Up
Slot Number: 9
Firmware state: Hotspare, Spun Up
Slot Number: 10
Drive's postion: DiskGroup: 3, Span: 0, Arm: 2
Firmware state: Rebuild

让故障磁盘闪灯

[root@test_raid ~]# megacli -PdLocate -start -physdrv[32:11]  -a0

Adapter: 0: Device at EnclId-32 SlotId-11  -- PD Locate Start Command was successfully sent to Firmware

Exit Code: 0x00

停止闪灯

[root@test_raid ~]# megacli -PdLocate -stop -physdrv[32:11]  -a0

Adapter: 0: Device at EnclId-32 SlotId-11  -- PD Locate Stop Command was successfully sent to Firmware

Exit Code: 0x00

启动管理

指定启动的 raid 组

megacli -AdpBootDrive -set -L0 -a0 



时间: 2024-10-01 21:18:31

dmdecode 与 megacli 命令用法参考的相关文章

《Ansible权威指南》一2.4 Ansible系列命令用法详解与使用场景介绍

2.4 Ansible系列命令用法详解与使用场景介绍 如何获取Ansible的系列命令呢?在终端键入ansible后连续按两次Tab键,会补全所有以ansible字母开头的命令,这些命令均是Ansible系列命令.本节我们来逐一介绍Ansible的系列命令使用. ansible ansible-galaxy ansible-pull ansible-doc ansible-playbook ansible-vault ansible-console 2.4.1 ansible 命令ansible

《Ansible权威指南 》一2.4 Ansible系列命令用法详解与使用场景介绍

ansible ansible-galaxy ansible-pull ansible-doc ansible-playbook ansible-vault ansible-console 2.4.1 ansible 命令ansible是日常工作中使用率非常高的命令之一,man中是如此定义其功能的:run a command somewhere else,可见其灵活性.ansible命令主要在如下场景使用: 非固化需求 临时一次性操作 二次开发接口调用 那么什么是非固化需求和临时一次性操作呢?简

《Ansible权威指南 》一Ansible命令用法详解

2.3 Ansible命令用法详解 Ansible命令行执行方式有Ad-Hoc.Ansible-playbook两种方式,Web化执行方式其官方提供了付费产品Tower(10台以内免费),个人的话可以基于其提供的API开发类似的Web化产品.关于命令行执行的两种方式Ad-Hoc和Ansible-playbooks.什么是Ad-Hoc及Ad-Hoc与Ansible-playbook的区别我们在第3章有详细介绍,这里不再赘述.需简要说明的是两者没有本质上的区别,Ad-Hoc主要用于临时命令的执行,A

《Ansible权威指南》一2.3 Ansible命令用法详解

2.3 Ansible命令用法详解 Ansible命令行执行方式有Ad-Hoc.Ansible-playbook两种方式,Web化执行方式其官方提供了付费产品Tower(10台以内免费),个人的话可以基于其提供的API开发类似的Web化产品.关于命令行执行的两种方式Ad-Hoc和Ansible-playbooks.什么是Ad-Hoc及Ad-Hoc与Ansible-playbook的区别我们在第3章有详细介绍,这里不再赘述.需简要说明的是两者没有本质上的区别,Ad-Hoc主要用于临时命令的执行,A

一天一个shell命令 linux文本操作系列-touch命令用法_linux shell

之前我们学过dd创建测试文件,如果不需要考虑文件大小,创建一个空白文件的话,不妨试试 touch: 将每个文件的访问时间和修改时间改为当前时间. 不存在的文件将会被创建为空文件,除非使用-c 或-h 选项. 入门例子: 1. 如果想生成100个空文件 for name in {1..100}.txt do touch $name done 2. 改进一下 touch test{1..20}.c 查看 --help 用法:touch [选项]... 文件... 将每个文件的访问时间和修改时间改为当

Linux下容易被忽视的那些命令用法

本文适合在linux下开发的同学阅读,需要具备基本的linux操作命令. 一.前言 工作中发现很多同学对于Linux下的命令不太熟悉,尤其是一些功能强大的工具,使用者很少.正所谓工欲善其事,必先利其器.本文总结了Linux下常用命令的用法,希望能够帮助大家提升日常开发的效率. 二.命令 1.strace strace用于跟踪程序执行过程中的系统调用,如跟踪test进程,只需要: strace -p [test_pid] 或直接strace ./test  但如果需要: 跟踪进程内的线程: -f

linux中scp命令和scp命令用法大全_linux shell

scp就是secure copy,是用来进行远程文件拷贝的.数据传输使用ssh1,并且和ssh1使用相同的认证方式,提供相同的安全保证.与rcp不同的是,scp会要求你输入密码如果需要的话. svn 删除所有的 .svn文件 find . -name .svn -type d -exec rm -fr {} \; linux之cp/scp命令+scp命令详解   名称:cp 使用权限:所有使用者 使用方式: cp [options] source dest cp [options] source

split命令用法(shell)

split命令用法 s p l i t用来将大文件分割成小文件.有时文件越来越大,传送这些文件时,首先将其分割可能更容易.使用v i或其他工具诸如s o r t时,如果文件对于工作缓冲区太大,也会存在一些问题. 因此有时没有选择余地,必须将文件分割成小的碎片. s p l i t命令一般格式: [Copy to clipboard] [ - ] CODE: split -output_file-size input-filename output-filename 这里o u t p u t -

嵌入式linux的tftp安装配置及tftp命令用法

TFTP协议简介 TFTP是用来下载远程文件的最简单网络协议,它其于UDP协议而实现.嵌入式linux的tftp开发环境包括两个方面:一是linux服务器端的tftp-server支持,二是嵌入式目标系统的tftp-client支持.因为u-boot本身内置支持tftp-client,所以嵌入式目标系统端就不用配置了.下面就详细介绍一下linux服务器端tftp-server的配置. 1.安装tftp服务器 需要安装xinetd.tftp和tftp-server 3个软件 1)如果能上网,通过y