Skip to content

Linux with two eth interfaces with two default gateways

Let’s say you have a linux machine with two ethernet adapters inside it, connected to 2 ISPs. In this case you will need to add the gateway for both ISPs to your routing tables.

In this example we will use the following subnets for the two ISPs:

ISP1: 192.168.0.0/24
IP: 192.168.0.5
GW: 192.168.0.1

ISP2: 192.168.10.0/24
IP: 192.168.10.5
GW: 192.168.10.1

We set up the first ISP as usual, GW in /etc/sysconfig/network and IP address + netmask… in /etc/sysconfig/network-scripts/ifcfg-eth0

For the second GW we add one custom table in /etc/iproute2/rt_tables, which should look like this:

[root@server ~]# cat /etc/iproute2/rt_tables
#
# reserved values
#
255	local
254	main
253	default
0	unspec
#
# local
#
#1	inr.ruhep
200	my_custom_table

In our case the above custom table my_custom_table is created.

After this we need to add our secondary ISP subnet to that table:

ip rule add from 192.168.10.0/24 lookup my_custom_table

Last we need to add the default GW for the secondary IP address:

ip route add default via 192.168.10.1 dev eth1 table my_custom_table

With the above setup you should be able to setup two GWs on your system for two different ISPs.

The GW of the first ISP will still take precedence over the second one, however this can be overridden by either changing the number preceding the my_custom_table in /etc/iproute2/rt_tables or by adding different networks to that table to set them to be routed through it.

If you need to reach some IP address or subnet through the secondary interface you should just add:

ip rule add from IP.IP.IP.IP/MASK lookup my_custom_table

Mac OS X Iterm2 Shortcuts

Open Iterm2 -> Preferences -> Profiles -> Keys

Click the + button to add a new shortcut:

1.Delete entire word with Cmd + Backspace:

screen-shot-2016-12-06-at-10-21-47

2.Move cursor word by word with Alt + Left/Right Arrows:

screen-shot-2016-12-06-at-10-25-24

screen-shot-2016-12-06-at-10-26-43

3. Move cursor to the beginning and end of the line with Shift + Left/Right Arrows:

screen-shot-2016-12-06-at-10-28-59
screen-shot-2016-12-06-at-10-29-20

MegaCLI Commands to StorCLI Command Conversion

MegaCLI Commands to StorCLI Command Conversion

 Description MegaCLI Command StorCLI Command Real StorCLI Example
 System Commands
Show the software version.  MegaCLI -v storcli -v storcli -v
 Show help information.  MegaCLI -help|-h|?  storcli -help|-h|? storcli -h
 Show the number of controllers connected  MegaCLI -adpCount  storcli show ctrlcount storcli show ctrlcount
Controller Commands
Show the status of properties related
to the controllers.
MegaCli -AdpGetProp
<PropertyName>-aN|-a0,1,2|-aALL
The following properties can be used with this
command:
abortcconerror
alarmdsply
autodetectbackplanedsbl
autoenhancedimportdsply
autosnapshotspace
batwarndsbl
bgirate
bootwithpinnedcache
cachebypass
ccrate
clusterenable
coercionmode
copybackdsbl
defaultldpspolicy
defaultsnapshotspace
defaultviewspace
disableldpsinterval
disableldpstime
disableocr
dsbl
eccbucketcount
eccbucketleakrate
eccbucketsize
enableeghsp
enableesmarter
enableeug|
enablejbod
enblspindownunconfigdrvs
loadbalancemode
maintainpdfailhistoryenbl
ncqdsply
patrolreadrate
perfmode
predfailpollinterval
rebuildrate
reconrate
rstrhotspareoninsert
smartcpybkenbl
spindowntime
spinupdelay
spinupdrivecount
spinupencdelay
/cx show <propertyName>
The following properties can be used with this
command:
activityforlocate
alarm
backplane
batterywarning
bgirate
bootwithpinnedcache
cachebypass
cacheflushint
cc
ccrate
clusterenable
coercion
copyback
directpdmapping
ds
eccbucketleakrate
eccbucketsize
enableeghsp
enableesmarter
enableeug
exposeencldevice
jbod
loadbalancemode
maintainpdfailhistory
migraterate
ncq
perfmode
pr
prcorrectunconfiguredareas
prrate
rebuildrate
rehostinfo
restorehotspare
safeid
smartpollinterval
spinupdelay
spinupdrivecount
stoponerror
time
usefdeonlyencrypt
storcli /c0 show activityforlocate
            storcli /c0 show alarm
storcli /c0 show backplane
storcli /c0 show batterywarning
storcli /c0 show bgirate
storcli /c0 show bootwithpinnedcache
storcli /c0 show cachebypass
storcli /c0 show cacheflushint
storcli /c0 show cc
storcli /c0 show ccrate
storcli /c0 show clusterenable
storcli /c0 show coercion
storcli /c0 show copyback
 Show the status of properties related to the controllers (continued). spinupencdrvcnt
ssdsmartcpybkenbl
usediskactivityforlocate
usefdeonlyencrypt
None
Set properties on the selected
controllers.
Megacli -AdpSetProp
<propertyname>-an|-a0,1,2|-aall
The following properties can be set using this
command:
abortcconerror
alarmdsply
autodetectbackplanedsbl
autoenhancedimportdsply
autosnapshotspace
batwarndsbl
bgirate
bootwithpinnedcache
cachebypass
ccrate
clusterenable
coercionmode
copybackdsbl
defaultldpspolicy
defaultsnapshotspace
defaultviewspace
disableldpsinterval
disableldpstime
disableocr
dsbl
eccbucketcount
eccbucketleakrate
eccbucketsize
enableeghsp
enableesmarter
enableeug|
enablejbod
enblspindownunconfigdrvs
loadbalancemode
maintainpdfailhistoryenbl
ncqdsply
patrolreadrate
perfmode
predfailpollinterval
rebuildrate
reconrate
rstrhotspareoninsert
smartcpybkenbl
spindowntime
spinupdelay
spinupdrivecount
spinupencdelay
/cx set <property1>
The following properties can be set using this command:
abortcconerror=<on|off>
activityforlocate=<on|off>
alarm=<value>
autorebuild=<on|off>
backplane=<value>
batterywarning=<on|off>
bgirate=<value>
bootwithpinnedcache=<on|off>
cachebypass=<on|off>
flush|flushcache
cacheflushinterval=<value>
ccrate=<value>
coercion=<value>
clusterenable=<value>
copyback=<on|off>
type=<smartssd|smarthdd|all>
dimmerswitch=<on|off>
directpdmapping=<enable|disable>
eccbucketleakrate=<value>
eccbucketsize=<value>
enableeghsp=<value>
enableesmarter=<value>
enableeug=<value>
exposeencldevice=<on|off>
foreignautoimport=<on|off>
jbod=<on|off>
loadbalancemode=<value>
maintainpdfailhistory=<on|off>
migraterate=<value>
ncq=<on|off>
perfmode=<value>
prcorrectunconfiguredareas=<on|off>
prrate=<value>
rebuildrate=<value>
restorehotspare=<on|off>
smartpollinterval=<value>
spinupdelay=<value>
spinupdrivecount=<value>
stoponerror=<on|off>
usefdeonlyencrypt=<on|off>
time=yyyymmdd hh:mm:ss|systemtime
usefdeonlyencrypt=<on|off>
/c0 set abortcconerror=on
 Set properties on the selected
controllers.
autocarve=<on|off>
autodetect=<on|off >
disk=<p:-p>|all
autorebuild=<on|off>
carvesize=<1024..32768>
dpmstat=<on|off>
ondegrade=<cacheoff|follow>
rebuild=<enable|disable|><1..5>
rebuildmode=<adaptive|lowlatency>
rebuildrate=<1..5>
selftest=<enable|disable>
spinup=<value>
stagger=<value>
verify=advanced|basic|<1..5>
verify=basic [pref=ddd:hh]where
hh={00..23} and
ddd={mon|tue|wed|thu|fri|sat|sun}
verify=enable|disable|<1..5>
verifymode=<adaptive|lowlatency>
verifyrate=<1..5>
spinupencdrvcnt
sdsmartcpybkenbl
usediskactivityforlocate
usefdeonlyencrypt
abortcconerror=<on|off>
activityforlocate=<on|off>
alarm=<value>
autorebuild=<on|off>
backplane=<value>
batterywarning=<on|off>
bgirate=<value>
bootwithpinnedcache=<on|off>
cachebypass=<on|off>
flush|flushcache
cacheflushinterval=<value>
ccrate=<value>
coercion=<value>
clusterenable=<value>
copyback=<on|off>
type=<smartssd|smarthdd|all>
directpdmapping=<enable|disable>
eccbucketleakrate=<value>
eccbucketsize=<value>
enableeghsp=<value>
enableesmarter=<value>
enableeug=<value>
exposeencldevice=<on|off>
foreignautoimport=<on|off>
jbod=<on|off>
loadbalancemode=<value>
maintainpdfailhistory=<on|off>
migraterate=<value>
ncq=<on|off>
perfmode=<value>
prcorrectunconfiguredareas=<on|off>
prrate=<value>
rebuildrate=<value>
restorehotspare=<on|off>
smartpollinterval=<value>
spinupdelay=<value>
spinupdrivecount=<value>
stoponerror=<on|off>
usefdeonlyencrypt=<on|off>
time=yyyymmdd hh:mm:ss|systemtime
usefdeonlyencrypt=<on|off>
Show the number of controllers
connected.
MegaCLI -adpCount storcli show ctrlcount storcli show ctrlcount
Show all information about the
adapter, such as cluster state, BIOS,
alarm, firmware, version, and so on.
MegaCli -AdpAllInfo
-aN|-a0,1,2|-aALL
 storcli /cx show all storcli /c0 show all
Show the freespace available in the
controller.
MegaCLI -CfgFreeSpaceinfo
-aN|-a0,1,2|-aALL
 storcli /cx show freespace storcli /c0 show freespace
 Download the controller firmware MegaCli -AdpFwFlash -f filename
[-NoSigChk] [-NoVerChk]
-aN|-a0,1,2|-aALL
storcli /cx download file=<filepath>
[fwtype=<val>] [nosigchk] [noverchk]
storcli /c0 download file=mr2208.rom
 Show the preserved cache status. MegaCLI-GetPreservedCacheList
-aN|-a0,1,2|-aALL
 storcli /cx show preservedcache storcli /c0 show preservedcache
 Set the controller time MegaCLI –AdpSetTime yyyymmdd
hh:mm:ss -aN|-a0,1,2|-aALL
storcli /c(x|all) set time=<yyyymmdd
hh:mm:ss | systemtime>
storcli /c0 set time=systemtime
 Show the controller time.  MegaCLI –AdpGetTime -aN  storcli /cx show time storcli /c0 show time
 RAID Configuration commands
Create a RAID configuration of RAID
type 0, 1, 5, and 6.
MegaCli –CfgLDAdd
-R0|-R1|-R5|-R6[E0:S0,E1:S1,…]
[WT | WB] [NORA | RA | ADRA]
[Direct | Cached]
[CachedBadBBU|NoCachedBadBBU]
[-szXXXXXXXX [-szYYYYYYYY [… ]]]
[-strpszM] [–Hsp[E5:S5,…]]
[–afterLdX] -aN
storcli /cx add vd
type=raid[0|1|5|6]
[Size=<VD1_Sz>,<VD2_Sz>,..|*all]
[name=<VDNAME1>,..]
drives=e:s|e:s-x|e:s-x,y;e:s-x,y,z
[PDperArray=x]
[SED] [pdcache=on|off|*default][pi]
[DimmerSwitch(ds)=default|automatic
(auto)|*none|maximum(max)
|MaximumWithoutCaching(maxnocache)]
[wt|*wb] [nora|*ra] [*direct|cached]
[CachedBadBBU|*NoCachedBadBBU]
[Stripe=<8|16|32|64|128|256|512|102
4] [AfterVd=X]
[Spares=[e:]s|[e:]s-x|[e:]s-x,y]
[force]
 storcli /c0 add vd type=road1 drives=252:0,252:1
(hint:  use storcli /c0 show to view available enclosure/slot e:s drives)
 Create a CacheCade virtual drive MegaCLI -CfgCacheCadeAdd [-rX]
-Physdrv[E0:S0,…] {-Name
LdNamestring} [WT|WB|ForcedWB]
[-assign -LX|L0,2,5..|LALL]
-aN|-a0,1,2|-Aall
storcli /cx add VD cachecade|cc
Type=[0,1,10]
drives=[e:]s|[e:]s-x|[e:]s-x,y
[ < WT| WB> ] [assignvds=0,1,2]
 storcli /c0 add vd type=road1 drives=252:2,252:3
Create a RAID configuration of RAID
type 10, 50, and 60.
MegaCli –CfgSpanAdd
-aN|-a0,1,2|-aALL
-R10|-R50|R60
–Array0[E0:S0,E1:S1,…]
–Array1[E0:S0,E1:S1,…] […]
[WT | WB] [NORA | RA | ADRA]
[Direct | Cached]
[CachedBadBBU|NoCachedBadBBU]
[-szXXXXXXXX [-szYYYYYYYY [… ]]]
[-strpszM] [–afterLdX] -aN
storcli /cx add vd
type=raid[10|50|60]
[Size=<VD1_Sz>,<VD2_Sz>,..|*all]
[name=<VDNAME1>,..]
drives=e:s|e:s-x|e:s-x,y;e:s-x,y,z
[PDperArray=x]
[SED] [pdcache=on|off|*default][pi]
[DimmerSwitch(ds)=default|automatic
(auto)|*none|maximum(max)
|MaximumWithoutCaching(maxnocache)]
[wt|*wb] [nora|*ra] [*direct|cached]
[CachedBadBBU|*NoCachedBadBBU]
[Stripe=<8|16|32|64|128|256|512|102
4] [AfterVd=X]
[Spares=[e:]s|[e:]s-x|[e:]s-x,y]
[force]
 Delete a virtual drive MegaCli -CfgClr [-Force]
-aN|-a0,1,2|-aALL
 storcli /cx/vx delete or storcli /cx/vall (to delete all virtual drives) storcli /c0/v0 delete (warning:  there is no warning given; using /c0/vall will delete all logical drives and data with no warning)
Show the topology information of
the drive group
MegaCLI -CfgDsply
-aN|-a0,1,2|-Aall
 storcli /cx/dall show [all] storcli /cx0/d0 show
Show information for a CacheCade
virtual drive
MegaCLI -CfgCacheCadeDsply
-aN|-a0,1,2|-Aall
 storcli /cx/dall show CacheCade(cc)  storcli /cx0/d0 show cc
Delete a virtual drive hosting the
operating system
MegaCLI -CfgLdDel
-LX|-L0,2,5…|-LALL [-Force]
-aN|-a0,1,2|-aALL
 storcli /cx/vx[all] delete -force storcli /c0/v0 del -force
 Delete a CacheCade virtual drive MegaCLI -CfgCacheCadeDel
-LX|-L0,2,5…|-LALL
-aN|-a0,1,2|-Aall
storcli /cx/vx[all] delete
CacheCade(cc)
storcli /c0/vx del cc
Show, delete, and import the foreign
configuration commands.
MegaCli –CfgForeign –Scan |
{-Preview | –Dsply| -Import |
-Clear[FID]} -aN|-a0,1,2|-aALL”
storcli /cx/f(x|all) show [all]
[securityKey=xxx]
storcli /cx/f(x|all) del|delete
[securityKey=xxx]
storcli /cx/f(x|all) import
[preview] [securityKey=xxx]”
storcli /c0/fall show
 Patrol Read Commands
 Show the patrol read status and
patrol read parameters, if any in
progress.
MegaCli -AdpPR -info
-aN|-a0,1,2|-aALL
 /cx show patrolRead /c0 show patrolread
 Set the patrol read options on a
single adapter, multiple adapters, or
all adapters (x = single controller).
MegaCli -AdpPR
–Dsbl|EnblAuto|EnblMan|Start|Stop|
Info|Suspend|Resume|Stop|
SSDPatrolReadEnbl |
SSDPatrolReadDsbl
|{SetDelay Val}|{-SetStartTime
yyyymmdd hh}|{maxConcurrentPD Val}
-aN|-a0,1,2|-aALL
 /cx set patrolread {=on
mode=<auto|manual>}|{off}
/cx set patrolread [starttime=<
yyyy/mm/dd hh>]
[maxconcurrentpd=<value>]
[includessds=<on|off>]
[uncfgareas=on|off]
/cx set patrolread delay=<value>
/c0 set patrolread mode=manual
 Disable patrol read. MegaCli -AdpPR -Dsbl
-aN|-a0,1,2|-aALL
 storcli /cx set patrolread=off storcli /c0 set patrolread=off
 Enable automatic patrol read. MegaCli -AdpPR -EnblAuto
-aN|-a0,1,2|-aALL
storcli /cx set patrolread=on
mode=auto
storcli /cx set patrolread=off
mode=auto
 Enable manual patrol read. MegaCli -AdpPR -EnblMan
-aN|-a0,1,2|-aALL
storcli /cx set patrolread=on
mode=manual
storcli /c0 set patrolread=on
mode=manual
 Start patrol read. MegaCli -AdpPR -Start
-aN|-a0,1,2|-aALL
 storcli /cx start patrolRead storcli /c0 start patrolRead
 Suspend a running patrol read MegaCli -AdpPR -Suspend
-aN|-a0,1,2|-aALL
 storcli /cx suspend patrolread storcli /c0 suspend patrolread
 Resume a suspended patrol read MegaCli -AdpPR -Resume
-aN|-a0,1,2|-aALL
 storcli /cx resume patrolread  storcli /c0 resume patrolread
 Stop a running patrol read MegaCli -AdpPR -Stop
-aN|-a0,1,2|-aALL
 storcli /cx stop patrolRead storcli /c0 stop patrolRead
 Include SSD drives in patrol read MegaCli -AdpPR -SSDPatrolReadEnbl
-aN|-a0,1,2|-aALL
storcli /cx set patrolRead
includessds=on | onlymixed
storcli /c0 set patrolRead
includessds=on
 Exclude SSD drives in patrol read  MegaCli -AdpPR -SSDPatrolReadDsbl
-aN|-a0,1,2|-aALL
storcli /cx set patrolRead
includessds=off
storcli /c0 set patrolRead
includessds=off
 Delay a patrol read MegaCli -AdpPR -SetDelay Val
-aN|-a0,1,2|-aALL
storcli /cx set patrolread
delay=<value>
note: <value> unit of time is in hours
storcli /c0 set patrolread
delay=1
 Schedule a patrol read MegaCli -AdpPR -SetStartTime
yyyymmdd hh -aN|-a0,1,2|-aALL
storcli /cx set patrolread=on
starttime=YYYY/MM/DD HH
Set the value for maximum
concurrent physical drives for the
patrol read.
MegaCli -AdpPR -maxConcurrentPD Val
-aN|-a0,1,2|-aALL
storcli /cx set patrolread
maxconcurrentpd=xx
storcli /c0 set patrolread
maxconcurrentpd=255
 Consistency Check Commands
 Schedule a consistency check MegaCLI -AdpCcSched -Dsbl|-Info|
{-ModeConc | -ModeSeq [-ExcludeLD
-LN|-L0,1,2] [-SetStartTime yyyymmdd
hh ] [-SetDelay val ] }
-aN|-a0,1,2|-aALL
storcli /cx set
consistencycheck|cc=[off|seq|conc]
[delay=value] starttime=yyyy/mm/dd
hh [excludevd=x-y,z]
storcli /c0 set cc=off
Show consistency check status and consistency parameters, in progress,
if any.
 MegaCLI -AdpCcSched -Info  storcli /cx show cc/ConsistencyCheck  storcli /c0 show cc
 OPROM BIOS Commands
 Schedule a consistency check MegaCli -AdpBIOS -Dsply
-aN|-a0,1,2|-aALL
 storcli /cx show bios  storcli /c0 show bios
Show consistency check status and
consistency parameters, if any in
progress.
MegaCli -AdpBootDrive -{-Set {-Lx |
-physdrv[E0:S0]}} -aN|-a0,1,2|-aALL
 storcli /cx/ex/sx set
bootdrive=on|off
storcli /cx/vx set bootdrive=on|off
storcli /c0/v0 set bootdrive=on
Sets the BIOS properties for the
controller.
MegaCli -AdpBIOS -Enbl | -Dsbl |
-Dsply | SOE | BE
EnblAutoSelectBootLd |
DsblAutoSelectBootLd
-aN|-a0,1,2|-aALL
storcli /cx set bios=<on|off>
storcli /cx set
stoponerror|soe=<on|off>
storcli /cx set
autobootselect(abs)=<on|off>
storcli /c0 set bios=on
 Battery (BBU) Commands
 Show battery-related information  MegaCli -AdpBbuCmd -aN|-a0,1,2|-aALL storcli /cx/bbu show
storcli /cx/bbu show all
storcli /c0/bbu show
 Show the battery learn properties MegaCli -AdpBbuCmd -GetBbuProperties
-aN|-a0,1,2|-aALL
 storcli /cx/bbu show properties  storcli /c0/bbu show properties
Show the battery information,
firmware status, and the gas gauge
status.
MegaCli -AdpBbuCmd -GetBbuStatus
-aN|-a0,1,2|-aALL
 storcli /cx/bbu show status storcli /c0/bbu show status
 Show battery capacity information MegaCli -AdpBbuCmd
-GetBbuCapacityInfo
-aN|-a0,1,2|-aALL
 storcli /cx/bbu show all storcli /c0/bbu show all
 Show battery design information MegaCli -AdpBbuCmd -GetBbuDesignInfo
-aN|-a0,1,2|-aALL
storcli /cx/bbu show all storcli /c0/bbu show all
 Set battery properties MegaCli -AdpBbuCmd -SetBbuProperties
-f <fileName> -aN|-a0,1,2|-aALL
storcli /cx/bbu set
learnDelayInterval=<value>
storcli /cx/bbu set bbuMode=<value>
storcli /cx bbu set
autolearnmode=<value>,
where x= 0 – Enabled, 1 – Disabled, 2 – Warn though
event.
storcli /c0/bbu set bbumode=5
 Start battery learn cycle MegaCli -AdpBbuCmd -BbuLearn
-aN|-a0,1,2|-aALL
 storcli /cx/bbu start learn  storcli /co/bbu start learn
Set the battery to low power storage
mode.
MegaCli -AdpBbuCmd -BbuMfgSleep
-aN|-a0,1,2|-aALL
storcli /cx/bbu set powermode=sleep
Seal the gas gauge EEPROM write
access
MegaCli -AdpBbuCmd -BbuMfgSeal
-aN|-a0,1,2|-aALL
storcli /cx/bbu set
writeaccess=sealed
 Security Commands
 Set the key ID for the controller. MegaCli -CreateSecurityKey
-SecurityKey sssssssssss |
[-Passphrase sssssssssss] |
[-KeyID kkkkkkkkkkk] -aN
storcli /cx set SecurityKey=XXXXXX
[passphrase=yyyyy] [keyId=zzzz]
Change the security key for the
controller.
MegaCli -ChangeSecurityKey
-OldSecurityKey sssssssssss |
-SecurityKey sssssssssss|
[-Passphrase sssssssssss] |
[-KeyID kkkkkkkkkkk] -aN
storcli /cx set SecurityKey=XXXXXX
OldSecurityKey=yyyyy
Compare and verify the security key
for the controller
Compare and verify the security key
for the controller
Compare and verify the security key
for the controller
 Delete the security key MegaCLI -DestroySecurityKey |
[-Force] -aN
 storcli /cx delete SecurityKey
 Set the security key for the controller MegaCli -SetKeyID -KeyID kkkkkkkkkkk
-aN
storcli /cx set SecurityKey
KeyId=xxxx
Virtual Drive Commands
Show the virtual drive information MegaCli –LDInfo –Lx|-L0,1,2|-Lall
-aN|-a0,1,2|-aALL
storcli /cx/v(x|all) show
storcli /cx/v(x|all) show all
Set virtual drive properties MegaCli –LDSetProp WT | WB|NORA |RA
| ADRA|-Cached|Direct|
CachedBadBBU|NoCachedBadBBU} |
-RW|RO|Blocked |
{-Name nameString} |
-EnDskCache|DisDskCache –Lx|
-L0,1,2|-Lall -aN|-a0,1,2|-aALL
storcli /cx/v(x|all) set
wrcache=WT|WB|AWB
storcli /cx/v(x|all) set
rdcache=RA|NoRA
storcli /cx/v(x|all) set
iopolicy=Cached|Direct
storcli /cx/v(x|all) set
accesspolicy=RW|RO|Blocked|RmvBlkd
storcli /cx/v(x|all) set
pdcache=On|Off|Default
storcli /cx/v(x|all) set
name=<NameString>
Set power-saving (dimmer switch)
properties.
MegaCli -LDSetPowerPolicy -Default|
-Automatic| -None| -Maximum|
-MaximumWithoutCaching
-Lx|-L0,1,2|-Lall -aN|-a0,1,2|-aALL
storcli /cx/v(x|all) set
ds=Default|Auto|None|Max|MaxNoCache
Show virtual drive expansion
information
MegaCli -getLdExpansionInfo
-Lx|-L0,1,2|-Lall -aN|-a0,1,2|-aALL
 storcli /cx/v(x|all) show expansion
Expand the virtual drive within the
existing array; also use if you replace
the drives with larger drives, beyond
the size of the existing array.
MegaCli -LdExpansion -pN
-dontExpandArray -Lx|-L0,1,2|-Lall
-aN|-a0,1,2|-aALL
storcli /cx/v(x|all) expand
Size=<value> [expandarray]
 Secure the virtual drive. MegaCLI –LDMakeSecure
-Lx|-L0,1,2,…|-Lall –An
 storcli /cx/vx set security=on
Show specific properties of virtual
drives.
MegaCli –LDGetProp -Cache | -Access
| -Name | -DskCache
-Lx|-L0,1,2|-Lall -aN|-a0,1,2|-aALL
storcli /cx/vx show
Start virtual drive initialization MegaCli –LDInit –Start [Fast|Full]
-Lx|-L0,1,2|-Lall -aN|-a0,1,2|-aALL
storcli /cx/v(x|all) start
init[Full]
Stop a running virtual drive
initialization.
MegaCli –LDInit -Abort
-Lx|-L0,1,2|-Lall -aN|-a0,1,2|-aALL
 storcli /cx/v(x|all) stop init
 Show the initialization progress MegaCli –LDInit –ShowProg
-Lx|-L0,1,2|-Lall -aN|-a0,1,2|-aALL
 storcli /cx/v(x|all) show init
Start a consistency check on an
uninitialized virtual drive
MegaCli –LDCC –Start
–Lx|-L0,1,2|-Lall -aN|-a0,1,2|-aALL
 storcli /cx/v(x|all) start cc[Force]
Start, stop, suspend, resume, and
show the progress of a consistency
check operation
MegaCli -LDCC -Start|-Abort|
-Suspend|-Resume|-ShowProg|
-ProgDsply -Lx|-L0,1,2|-LALL
-aN|-a0,1,2|-aALL
storcli /cx/v(x|all) start cc
storcli /cx/v(x|all) stop cc
storcli /cx/v(x|all) pause cc
storcli /cx/v(x|all) resume cc
storcli /cx/v(x|all) show cc
Enable/disable automatic
background initialization. Show, stop,
pause, resume, and show the
progress of the background
initialization.
MegaCLI -LDBI -Enbl|-Dsbl|
-getSetting|-Abort|-Suspend|
-Resume|-ShowProg|-ProgDsply
-Lx|-L0,1,2|-LALL -aN|-a0,1,2|-Aall
storcli /cx/v(x|all) set
autobgi=On|Off
storcli /cx/v(x|all) show autobgi
storcli /cx/v(x|all) stop bgi
storcli /cx/v(x|all) pause bgi
storcli /cx/v(x|all) resume bgi
storcli /cx/v(x|all) show bgi
Start and show progress for a migrate
operation.
MegaCli –LDRecon {–Start –Rx [Add
| Rmv PhysDrv[E0:S0,E1:S1,…] ] }
| –ShowProg|-ProgDsply –Lx –aN
storcli /cx/vx start migrate
type=raidx [option=add|remove
drives=[e:]s|[e:]s-x|[e:]s-x,y]
[Force]
storcli /cx/v(x|all) show migrate
 Delete preserved cache MegaCLI -DiscardPreservedCache
-Lx|-L0,1,2|-Lall -force
-aN|-a0,1,2|-aALL
storcli /cx/v(x|all) delete
preservedcache[force]
 Assign the CacheCade virtual drive MegaCLI -Cachecade -assign|-remove
-Lx|-L0,1,2|-LALL -aN|-a0,1,2|-aALL
storcli /cx/vx|all set
ssdCaching=on|off
 Physical Drive Commands
 Show drive information MegaCli -pdInfo –
PhysDrv[E0:S0,E1:S1,…]
-aN|-a0,1,2|-aALL
storcli /cx/ex/sx show
storcli /cx/ex/sx show all
Start, stop, suspend, or resume an
ongoing rebuild operation.
MegaCLI PDRbld -Start|-Stop
|-Suspend|-Resume|-ShowProg
|-ProgDsply -PhysDrv
[E0:S0,E1:S1,…]
-aN|-a0,1,2|-aALL
storcli /cx/ex/sx start rebuild
storcli /cx/ex/sx stop rebuild
storcli /cx/ex/sx pause rebuild
storcli /cx/ex/sx resume rebuild
storcli /cx/ex/sx show rebuild
Start, stop, pause, resume, or show
the progress of a copyback operation
MegaCLI PDCpyBk -Start|-Stop
|-Suspend|-Resume|-ShowProg
|-ProgDsply -PhysDrv
[E0:S0,E1:S1,…]
-aN|-a0,1,2|-aALL
storcli /cx/ex/sx start copyback
target=exx:sxx
storcli /cx/ex/sx stop copyback
storcli /cx/ex/sx pause copyback
storcli /cx/ex/sx resume copyback
storcli /cx/ex/sx show copyback
Mark a drive as missing MegaCli -PdMarkMissing
-physdrv[E0:S0,E1:S1,…]
-aN|-a0,1,2|-aALL
 storcli /cx/ex/sx set missing
 Show missing drive information MegaCli -PdGetMissing
-aN|-a0,1,2|-aALL
storcli /cx/ex/sx show all
NOTE This information is shown as part of the show all
command.
Replace the configured drive that is
identified as missing, and then start
an automatic rebuild.
MegaCli -PdReplaceMissing
-physdrv[E0:S0] -arrayA, -rowB
-aN
 storcli /cx/ex/sx insert array=x row=y
Set the drive state to online MegaCli –PDOnline –
PhysDrv[E0:S0,E1:S1….]
-aN|-a0,1,2
 storcli /cx/ex/sx set online
Set the drive state to offline MegaCli –PDOffline
-PhysDrv[E0:S0,E1:S1….]
-aN|-a0,1,2|-aALL
 storcli /cx/ex/sx set offline
Set the drive state to JBOD MegaCli –PDMakeGood
-PhysDrv[E0:S0,E1:S1….]
-aN|-a0,1,2|-aALL
storcli /cx/ex/sx set good [force]
or
storcli /cx/ex/sx set jbod
 Add and delete hotspare drives MegaCli –PDHSP {–Set
[{-Dedicated -ArrayN |
-Array0,1…}] [-EnclAffinity]
[-nonRevertible] } |
-Rmv -PhysDrv[E0:S0,E1:S1,…]
-aN|-a0,1,2|-aALL
storcli /cx/ex/sx add hotsparedrive
[dgs=<N|0,1,2..>] enclaffinity
nonrevertible
storcli /cx/ex/sx delete hotsparedrive
Start, stop, pause, resume or show
the progress of an initialization
process.
MegaCli –PDClear -Start |-Stop|
-ShowProg |-ProgDsply
– PhysDrv[E0:S0,E1:S1….]
-aN|-a0,1,2|-aALL
storcli /cx/ex/sx start initialization
storcli /cx/ex/sx stop initialization
storcli /cx/ex/sx pause initialization
storcli /cx/ex/sx resume initialization
storcli /cx/ex/sx show initialization
Start a drive locate and activate (blink) the
drive’s LED or stop a drive locate (LED blinking) and
deactivate the drive’s LED
MegaCli –PDLocate {[-start] |
-stop} -physdrv[E0:S0,E1:S1,…]
-aN|-a0,1,2|-aALL
storcli /cx/ex/sx start locate
storcli /cx/ex/sx stop locate
Spin down an unconfigured drive
and prepare it for removal or spin up
spun-down drive and mark the drive
state as unconfigured good.
MegaCli –PDPrpRmv [-Undo]
– PhysDrv[E0:S0,E1:S1….]
-aN|-a0,1,2|-aALL
storcli /cx/ex/sx spindown
storcli /cx/ex/sx spinup
Show physical drive information of all
connected drives.
MegaCli –PDList
-aN|-a0,1..|-aAll
storcli /cx/eall/sall show [all]
NOTE This command does not show drives whose enclosure device ID is not available.
 Flash the physical drive firmware MegaCLI PdFwDownload[offline]
[ForceActivate] {[-SataBridge]
-PhysDrv[0:1]}|{-EncdevId[devId1
]} -f <filename>
-aN|-a0,1,2|-Aall
storcli /cx[/ex]/sx download
src=<filepath> [satabridge]
storcli /cx/ex download src=<filepath>
[forceActivate]
Erase the drive’s security
configuration and securely erase data on a drive.
MegaCli -PDInstantSecureErase
-PhysDrv[E0:S0,E1:S1,…] |
[-Force] -aN|-a0,1,2|-aALL
 storcli /cx/ex/sx secureerase [force]
Show the security key for secured physical drives MegaCli -GetKeyID
[-PhysDrv[E0:S0]] -aN
storcli /cx/ex/sx show securitykey
keyid
Start, stop, and show the progress of
a secure erase operation
MegaCli -SecureErase Start[
Simple|
[Normal [ |ErasePattern
ErasePatternA|ErasePattern
ErasePatternA ErasePattern
ErasePatternB]]|[Thorough [
|ErasePattern
ErasePatternA|ErasePattern
ErasePatternA ErasePattern
ErasePatternB]]]
| Stop| ShowProg| ProgDsply
[-PhysDrv [E0:S0,E1:S1,…] |
-Lx|-L0,1,2|-LALL]
-aN|-a0,1,2|-aALL
storcli /cx[/ex]/sx start erase
[simple| normal| thorough]
[erasepatternA=<val>]\n[erasepatternB=<
val>]
Examples:
storcli /cx/ex/sx start erase simple
storcli /cx/ex/sx start erase normal
erasepatterna=10101010
storcli /cx/ex/sx start erase thorough
erasepatterna=10101010
erasepatternb=10101111
storcli /cx/ex/sx stop erase
Enable/disable the direct physical
drive mapping mode.
Show the current state of the direct physical drive mapping.
MegaCLI DirectPdMapping
-Enbl|-Dsbl|-Dsply
-aN|-a0,1,2|-Aall
storcli /cx set directpdmapping=<on |
off>
storcli /cx show directpdmapping
 Enclosure Commands
Show enclosure information MegaCli –EncInfo
-aN|-a0,1,2|-aALL
storcli /cx/ex show
storcli /cx/ex show all
Show enclosure status MegaCli –EncStatus
-aN|-a0,1,2|-aALL
 /cx/ex show status
Download enclosure firmware. /cx/ex download src=filepath
[offline] [forceActivate
 PHY Commands
 Show PHY information MegaCli –PHYInfo -phyM
-aN|-a0,1,2|-aALL
storcli /cx/px(x|all) show
storcli /cx/px(x|all) show all
 Set PHY link speed MegaCLI PhySetLinkSpeed -phyM
-speed -aN|-a0,1,2|-aALL
storcli /cx/px(x|all) set
linkspeed=1.5|3|6|12|auto
 Show the PHY error counters.  Megacli PhyErrorCounters -An storcli /cx/px(x|all) show
storcli /cx/px(x|all) show all
 Alarm Commands
 Show alarm properties MegaCli -AdpGetProp AlarmDsply
-aN|-a0,1,2|-aALL
 storcli /cx(x|all) show alarm
 Set alarm properties MegaCli -AdpSetProp AlarmEnbl |
AlarmDsbl | AlarmSilence
-aN|-a0,1,2|-aALL
storcli /cx(x|all) set
alarm=<on|off|silence>
 Event Log Properties Commands
Show event logs. MegaCli -AdpEventLog
-GetEventLogInfo
-aN|-a0,1,2|-aALL
 /cx show eventloginfo
Show the specified type of event
logs.
MegaCli -AdpEventLog -GetEvents
{-info -warning -critical
-fatal} {-f <fileName>}
-aN|-a0,1,2|-aALL
storcli /cx show events
[type=[latest=x|ccincon
vd=|[sincereboot|sinceshutdown|included
eleted|latest|ccincon]]]
[filter=[info|warning|critical|fatal]]
file=xyz.txt
Show the specified event logs MegaCli -AdpEventLog
-GetSinceShutdown {-info
-warning -critical -fatal}
{-f <fileName>}
-aN|-a0,1,2|-aALL
storcli /cx show events
[type=[latest=x|ccincon
vd=|[sincereboot|sinceshutdown|included
eleted|latest|ccincon]]]
[filter=[info|warning|critical|fatal]]
file=xyz.txt
 Delete the event logs. MegaCli -AdpEventLog -Clear
-aN|-a0,1,2|-aALL
 storcli /cx delete events
 Premium Feature Key Commands
 Show the Safe ID of the controller  MegaCli -ELF -GetSafeId -a0  storcli /cx(x|all) show safeid
Show the Advanced Software
Options that are enabled on the
controller, including the ones in trial mode.
MegaCli -ELF –ControllerFeatures
-a0
MegaCli -ELF –ControllerFeatures
-a0
Apply the Activation Key in preview mode. MegaCli -ELF -Applykey key –val
-preview -a0
storcli /cx(x|all) set aso key=<key
value> preview
 Apply the Activation Key MegaCli -ELF -Applykey key –val
-a0
storcli /cx(x|all) set aso key=<key
value>
 Deactivate the trial key MegaCli -ELF
–DeactivateTrialKey -a0
storcli /cx(x|all) set aso
deactivatetrialkey
Show the re-host information and, if re-hosting is necessary, show the controller and key vault serial
numbers.
 MegaCli -ELF -ReHostInfo -a0  storcli /cx(x|all) show rehostinfo
Indicate to the controller that the
re-host is complete
 MegaCli -ELF -ReHostComplete -a0 storcli /cx(x|all) set aso
rehostcomplete

 

 

3ware CLI Commands to StorCLI Command Conversion

&nnbsp;

 Description 3ware CLI Command StorCLI Command Real StorCLI Example
 System Commands
Show general summary of all
detected controllers.
 tw_cli show show
show ctrlcount
Controller Commands
Show all information about the
adapter, such as cluster state, BIOS, alarm, firmware, version, and so on.
tw_cli /cx show all /cx show all
 Download the firmware to all
compatible controllers that can be
flashed with the image. By default,
CLI checks for signature and version.
/cx update fw=filename_with_path
[force]
/cx download src=filepath [nosigchk]
[noverchk]
Show the status of properties related
to the Controllers.
/cx show <PropertyName>
The following properties can be used with this command:
a0,1,2|-aALL
achip
AENs [reverse]
alarms [reverse]
allunitstatus
autocarve
autorebuild
bios
carvesize
ctlbus diag
dpmstat [type=<inst|ra|ext>
driver
drivestatus
events [reverse]
exportjbod firmware
memory
model
monitor
numdrives
numports
numunits
ondegrade
pcb
pchip
phy
rebuild
rebuildmode
rebuildrate
selftest
serial
spinup
stagger
unitstatus
verify
verifymode
verifyrate
abortcconerror=<on|off>
activityforlocate=<on|off>
alarm=<value>
autorebuild=<on|off>
backplane=<value>
batterywarning=<on|off>
bgirate=<value>
bootwithpinnedcache=<on|off>
cachebypass=<on|off>
flush|flushcache
cacheflushinterval=<value>
ccrate=<value>
coercion=<value>
clusterenable=<value>
copyback=<on|off>
type=<smartssd|smarthdd|all>
directpdmapping=<enable|disable>
eccbucketleakrate=<value>
eccbucketsize=<value>
enableeghsp=<value>
enableesmarter=<value>
enableeug=<value>
exposeencldevice=<on|off>
foreignautoimport=<on|off>
jbod=<on|off>
loadbalancemode=<value>
maintainpdfailhistory=<on|off>
migraterate=<value>
ncq=<on|off>
perfmode=<value>
prcorrectunconfiguredareas=<on|off>
prrate=<value>
rebuildrate=<value>
restorehotspare=<on|off>
smartpollinterval=<value>
spinupdelay=<value>
spinupdrivecount=<value>
stoponerror=<on|off>
usefdeonlyencrypt=<on|off>
time=yyyymmdd hh:mm:ss|systemtime
usefdeonlyencrypt=<on|off>
 Set properties on the selected
controllers.
autocarve=<on|off>
autodetect=<on|off >
disk=<p:-p>|all
autorebuild=<on|off>
carvesize=<1024..32768>
dpmstat=<on|off>
ondegrade=<cacheoff|follow>
rebuild=<enable|disable|><1..5>
rebuildmode=<adaptive|lowlatency>
rebuildrate=<1..5>
selftest=<enable|disable>
spinup=<value>
stagger=<value>
verify=advanced|basic|<1..5>
verify=basic [pref=ddd:hh]where
hh={00..23} and
ddd={mon|tue|wed|thu|fri|sat|sun}
verify=enable|disable|<1..5>
verifymode=<adaptive|lowlatency>
verifyrate=<1..5>
abortcconerror=<on|off>
activityforlocate=<on|off>
alarm=<value>
autorebuild=<on|off>
backplane=<value>
batterywarning=<on|off>
bgirate=<value>
bootwithpinnedcache=<on|off>
cachebypass=<on|off>
flush|flushcache
cacheflushinterval=<value>
ccrate=<value>
coercion=<value>
clusterenable=<value>
copyback=<on|off>
type=<smartssd|smarthdd|all>
directpdmapping=<enable|disable>
eccbucketleakrate=<value>
eccbucketsize=<value>
enableeghsp=<value>
enableesmarter=<value>
enableeug=<value>
exposeencldevice=<on|off>
foreignautoimport=<on|off>
jbod=<on|off>
loadbalancemode=<value>
maintainpdfailhistory=<on|off>
migraterate=<value>
ncq=<on|off>
perfmode=<value>
prcorrectunconfiguredareas=<on|off>
prrate=<value>
rebuildrate=<value>
restorehotspare=<on|off>
smartpollinterval=<value>
spinupdelay=<value>
spinupdrivecount=<value>
stoponerror=<on|off>
usefdeonlyencrypt=<on|off>
time=yyyymmdd hh:mm:ss|systemtime
usefdeonlyencrypt=<on|off>
 Set properties on the selected
controllers.
autocarve=<on|off>
autodetect=<on|off >
disk=<p:-p>|all
autorebuild=<on|off>
carvesize=<1024..32768>
dpmstat=<on|off>
ondegrade=<cacheoff|follow>
rebuild=<enable|disable|><1..5>
rebuildmode=<adaptive|lowlatency>
rebuildrate=<1..5>
selftest=<enable|disable>
spinup=<value>
stagger=<value>
verify=advanced|basic|<1..5>
verify=basic [pref=ddd:hh]where
hh={00..23} and
ddd={mon|tue|wed|thu|fri|sat|sun}
verify=enable|disable|<1..5>
verifymode=<adaptive|lowlatency>
verifyrate=<1..5>
abortcconerror=<on|off>
activityforlocate=<on|off>
alarm=<value>
autorebuild=<on|off>
backplane=<value>
batterywarning=<on|off>
bgirate=<value>
bootwithpinnedcache=<on|off>
cachebypass=<on|off>
flush|flushcache
cacheflushinterval=<value>
ccrate=<value>
coercion=<value>
clusterenable=<value>
copyback=<on|off>
type=<smartssd|smarthdd|all>
directpdmapping=<enable|disable>
eccbucketleakrate=<value>
eccbucketsize=<value>
enableeghsp=<value>
enableesmarter=<value>
enableeug=<value>
exposeencldevice=<on|off>
foreignautoimport=<on|off>
jbod=<on|off>
loadbalancemode=<value>
maintainpdfailhistory=<on|off>
migraterate=<value>
ncq=<on|off>
perfmode=<value>
prcorrectunconfiguredareas=<on|off>
prrate=<value>
rebuildrate=<value>
restorehotspare=<on|off>
smartpollinterval=<value>
spinupdelay=<value>
spinupdrivecount=<value>
stoponerror=<on|off>
usefdeonlyencrypt=<on|off>
time=yyyymmdd hh:mm:ss|systemtime
usefdeonlyencrypt=<on|off>
 Alarm Commands
 Set alarm properties. /cx/ex/almx set
alarm=<mute|unmute|off>
NOTE The 3ware controllers have enclosure alarms.
/cx set alarm=<on|off|silence>
NOTE The StorCLI controllers have controller alarms
Show alarm properties. /cx/ex show alarms
NOTE This command applies for only 9750 and
9690SA controllers.
 /cx show alarm
 Patrol Read and Consistency Check Commands
 Show patrol read status and patrol
read parameters, if any in progress.
 /cx/ux show  /cx show patrolRead
 Set the patrol read options on a
single adapter, multiple adapters, or
all adapters (x = single controller).
/cx/ux start verify
/cx/ux set autoverify=<on|off>
&nbsnbsp;           /cx add verify=dddh:hh:duration
 /cx set patrolread {=on
mode=<auto|manual>}|{off}
/cx set patrolread [starttime=<
yyyy/mm/dd hh>]
[maxconcurrentpd=<value>]
[includessds=<on|off>]
[uncfgareas=on|off]
/cx set patrolread delay=<value>
 /cx set patrolread {=on
mode=<auto|manual>}|{off}
/cx set patrolread [starttime=<
yyyy/mm/dd hh>]
[maxconcurrentpd=<value>]
[includessds=<on|off>]
[uncfgareas=on|off]
/cx set patrolread delay=<value>
 /cx/ux show  /cx/vx show cc
/cx show ccrate
 Set consistency check options on a
single adapter, multiple adapters, or
all adapters (x = single controller).
/cx/ux start verify
/cx/ux set autoverify=<on|off>
/cx add verify=ddd:hh:duration
 storcli /cx set
consistencycheck|cc=[off|seq|conc]
[delay=value]
[starttime=yyyy/mm/dd hh]
[excludevd=x-y,z]
 BBU Commands
Show complete BBU information,
such as status, capacity information,
design information, and properties.
 /cx/bbu show all  /cx/bbu show all
 Show BBU summary information.  /cx/bbu show  /cx/bbu show
 Show BBU properties. /cx/bbu show batinst
/cx/bbu show bootloader
/cx/bbu show fw
/cx/bbu show lasttest
/cx/bbu show pcb
/cx/bbu show serial
/cx/bbu show status
/cx/bbu show temp
/cx/bbu show tempstat
/cx/bbu show tempval
/cx/bbu show volt
/cx/bbu show properties
/cx/bbu show status
NOTE Not all the properties shown in the 3Ware CLI
are shown in the StorCLI.
Show BBU capacity information.  /cx/bbu show cap  /cx/bbu show all
Start the learning cycle on the BBU. /cx/bbu test [quiet]  /cx/bbu start learn
Virtual Drive Commands
Show cache and access policies of the
virtual drive.
/cx/ux show [all]
/cx/ux show autoverify
/cx/ux show cache
/cx/ux show identify
/cx/ux show ignoreECC
/cx/ux show name
/cx/ux show parit
/cx/ux show qpolicy
/cx/ux show rapidrecovery
/cx/ux show rdcache
/cx/ux show rebuildstatus
/cx/ux show serial
/cx/ux show status initializestatus
/cx/ux show storsave
/cx/ux show verifystatus
/cx/ux show volumes
/cx/ux show wrcache
/cx/vx show all
NOTE The StorCLI does not have commands to
show individual virtual drive properties.
Start initialization (writing 0s) on the
virtual drive.
/cx/ux start verify
NOTE Only the bios can do a foreground
initialization. A background initialization does
otherwise. A verify starts a back ground initialization.
 /cx/vx start init [Full]
Stop an ongoing initialization on the
virtual drive.
/cx/ux stop verify
NOTE Only the bios can do a foreground
initialization. A background initialization does
otherwise. A verify starts a back ground initialization
 /cx/vx stop init
Show a snapshot of the ongoing
initialization, if any.
/cx/ux show [all]
NOTE Only the bios can do a foreground
initialization. A background initialization does
otherwise. A verify starts a back ground initialization
 /cx/vx show init
Start a consistency check on the
virtual drive.
 /cx/ux start verify  /cx/vx start cc
 Stop a consistency check on the
virtual drive.
 /cx/ux stop verify  /cx/vx stop cc
Reconstruct the selected virtual disk
to a new RAID level.
/cx/ux migrate type=<RaidType>
[disk=<p:-p..>] [stripe=<size>]
[noscan] [nocache] [autoverify]
[group=<3|4|5|6|7|8|9|10|11|12|13|1
4|15|16>]
RaidType={ raid0, raid1, raid5,
raid10, raid50, single, raid6 }
/cx/vx start migrate
<type=raidlevel> [option=<add |
remove> disk=<e1:s1,e2:s2 ..> ]
/cx/vx show migrate
Change the power-saving setting on
the virtual drive.
/cx/ux set powersavestandbytimer=<5
to 999>
/cx/vx set ds=<default | Auto | None
| Max | MaxNoCache>
 Physical Drive Commands
 Show physical disk information.  /cx/px show [all]  /cx[/ex]/sx show [all]
Start, stop, suspend, or resume an
ongoing rebuild operation.
/cx/ux start rebuild disk=<p:-p…>
[ignoreECC]
NOTE Rebuilds cannot be stopped or paused.
/cx[/ex]/sx start rebuild
/cx[/ex]/sx stop rebuild
/cx[/ex]/sx pause rebuild
/cx[/ex]/sx resume rebuild
Mark the configured physical disk
drive as missing for the selected
adapter.
 /cx/px remove [quiet]  /cx[/ex]/sx set missing
Change the physical disk drive state
to offline.
 /cx/px remove [quiet]  /cx[/ex]/sx set offline
 Add jbod. /cx add type=jbod disk=<p>
(where p = port or drive number)
/cx[/ex]/sx set jbod
Change the physical disk drive
hotspare state and associate the
drive to an enclosure and virtual disk.
/cx add type=spare
disk=<p:p|p-p|p:p-p>
(where p = port or drive number)
/cx[/ex]/sx add hotsparedrive
[{dgs=<N|0,1.2…n,,>]
[EnclAffinity][nonRevertible]
Locate the physical disk drive and
activate the physical disk activity LED.
 /cx/px set identify=on|off  /cx[/ex]/sx start | stop locate
Prepare the unconfigured physical
drive for removal.
 /cx/px remove [quiet]  /cx[/ex]/sx spindown
Show information about all physical
disk drives and other devices
connected to the selected adapters;
includes drive type, size, serial
number, and firmware version.
 /cx/px show [all]  /cx/eall/sall show [all]
Download drive or expander
firmware.
 /cx/px update fw=image.name [force] /cx[/ex]/sx download src=filepath
[satabridge]
 Enclosure Commands
Show information about the
enclosure for the selected adapter
 /cx/ex show [all]  /cx/ex show [all]
Show the status of the enclosure
connected to the selected adapter.
/cx/ex show [all]
/cx/ex show controllers
/cx/ex show slots
/cx/ex show fans
/cx/ex show temp
/cx/ex show pwrs
/cx/ex show alms
 /cx/ex show status
Download enclosure firmware.  /cx/ex update fw=image.name [force] /cx/ex download src=filepath
[offline] [forceActivate
 Events and Logs
Show the total number of events,
newest and oldest sequence number,
shutdown sequence number, reboot
sequence number, clear sequence
number, and 10 (TBD) most recent
events.
/cx show alarms
NOTE This command shows AENs since last
controller reset.
 /cx show eventloginfo
Show the total event entries available
at the firmware since last clear, and
details of each entries of error log.
/cx show alarms
NOTE This command shows AENs since last
controller reset.
/cx show events filter=<Info |
warning| critical| fatal >
file=<path of the file>
Show the count of events starting
from specified seqNum and
matching category and severity
/cx show alarms
NOTE This command shows AENs since last
controller reset.
/cx show events type=<sinceShutDown
| sinceReboot |ccincon vd=<0,1,2…>
| includeDeleted | latest=x
filter=<Info | warning| critical|
fatal > file=<path of the file>
 Show TTY firmware terminal log
entries with details on given
adapters. The information is shown as
total number of entries available on
the firmware side.
 /cx show diag /cx show TermLog
[type=contents|Config]
Miscellaneous Commands
Show help for all show commands at
server level.
tw_cli ?
tw_cli /cx ?
tw_cli /cx/ux ?
tw_cli /cx/px ?
tw_cli /cx/phyx ?
tw_cli /cx/bbu ?
tw_cli /cx/ex ?
tw_cli /ex
NOTE 3 Ware CLI shows context sensitive help
 show help
Show PHY connection information
for physical PHY medium on the
adapters.
 /cx/phyx show  /cx/px show
 Set PHY link speed.  /cx/phyx set link=<auto|1.5|3.0|6.0> /cx/px set
linkspeed=1.5|3|6|12|auto

 

Compile Python2 & Python3 with custom openssl.

First off, thanks to Scott Frazer and his post on:
http://stackoverflow.com/questions/23548188/how-do-i-compile-python-3-4-with-custom-openssl
which helped me build my Python2 and Python3 with openssl-1.0.2, thus supporting TLSv1.1 and TLSv1.2

The below is a modified version of the above URL, which worked for me.

# OpenSSL 1.0.2d
./config shared --prefix=/my/path/for/openssl --openssldir=/my/path/for/openssl/openssl
make
make install

# Python 2.7.10 and 3.4.3 Works with both
export LDFLAGS="-L/my/path/for/openssl/lib/ -Wl,-rpath=/my/path/for/openssl/lib/"
export LD_LIBRARY_PATH="/my/path/for/openssl/lib/"
export CPPFLAGS="-I/my/path/for/openssl/include -I/my/path/for/openssl/include/openssl"

Before starting the installation of Python I edited the Modules/Setup.dist uncommenting the following lines (not sure if it was necessary, but was suggested on several threads I came across):

SSL=/my/path/for/openssl/lib
_ssl _ssl.c \
    -DUSE_SSL -I$(SSL)/include -I$(SSL)/include/openssl \
    -L$(SSL)/lib -lssl -lcrypto

Finally:

./configure --prefix=/my/path/for/python
make
make install

…and you have your Python compiled with custom openssl.

[Solved] Large Fonts after NVIDIA Driver installation Ubuntu

In order to correct the large fonts bug after you have installed your NVIDIA Driver on your Ubuntu you need to edit your /etc/lightdm/lightdm.conf.d/10-xubuntu.conf and put the following line on the bottom of the file:

xserver-command=X -dpi 90

You need to restart X after that and your fonts should look OK.

If this does not work you can try setting the DPI to 75.

[Solved] Large Fonts after NVIDIA Driver installation Centos

In order to correct the large fonts bug after you have installed your NVIDIA Driver on your CentOS you need to edit your /etc/X11/xorg.conf and put the following line in the Monitor part:

Option "DPI" "96 x 96"

My conf looks as follows:

# nvidia-xconfig: X configuration file generated by nvidia-xconfig                                                                                                                           
# nvidia-xconfig:  version 340.58  (buildmeister@swio-display-x86-rhel47-09)  Fri Oct 31 17:40:05 PDT 2014                                                                                   
                                                                                                                                                                                             
Section "ServerLayout"                                                                                                                                                                       
    Identifier     "Layout0"                                                                                                                                                                 
    Screen      0  "Screen0"                                                                                                                                                                 
    InputDevice    "Keyboard0" "CoreKeyboard"
    InputDevice    "Mouse0" "CorePointer"
EndSection

Section "Files"
    FontPath        "/usr/share/fonts/default/Type1"
EndSection

Section "InputDevice"
    # generated from default
    Identifier     "Mouse0"
    Driver         "mouse"
    Option         "Protocol" "auto"
    Option         "Device" "/dev/input/mice"
    Option         "Emulate3Buttons" "no"
    Option         "ZAxisMapping" "4 5"
EndSection

Section "InputDevice"
    # generated from data in "/etc/sysconfig/keyboard"
    Identifier     "Keyboard0"
    Driver         "kbd"
    Option         "XkbLayout" "us"
    Option         "XkbModel" "pc105"
EndSection

Section "Monitor"
    Identifier     "Monitor0"
    VendorName     "Unknown"
    ModelName      "Unknown"
    HorizSync       28.0 - 33.0
    VertRefresh     43.0 - 72.0
    Option         "DPMS"
    Option         "DPI" "96 x 96"
EndSection

Section "Device"
    Identifier     "Device0"
    Driver         "nvidia"
    VendorName     "NVIDIA Corporation"
EndSection

Section "Screen"
    Identifier     "Screen0"
    Device         "Device0"
    Monitor        "Monitor0"
    DefaultDepth    24
    SubSection     "Display"
        Depth       24
    EndSubSection
EndSection

Restart X server after that and your fonts should be back to their normal size.

If this does not work you can try setting the DPI to 75 x 75.

[SOLVED] Run vlc as root

In order to run vlc as root on your linux box you need to open the binary file /usr/bin/vlc with vi and replace geteuid with getppid

vi `which vlc`

How to add timestamp to bash history entries

If your bash history has no timestamp and you wish to add one you need to add the following to the .bashrc file in your home directory:

export HISTTIMEFORMAT="%F %T "

You can alternatively add the above line to the /etc/bashrc file to have timestamp for the bash history of all users on the server.

Install FFMPEG on CentOS Ubuntu

In order to install FFMPEG with support for many codecs first we need to install the following packages:

yum install autoconf automake gcc gcc-c++ git libtool make nasm pkgconfig zlib-devel

After that we can begin the installation of the separate codec packages:

mkdir ~/ffmpeg_sources

cd ~/ffmpeg_sources
curl -O http://www.tortall.net/projects/yasm/releases/yasm-1.2.0.tar.gz
tar xzvf yasm-1.2.0.tar.gz
cd yasm-1.2.0
./configure --prefix="$HOME/ffmpeg_build" --bindir="$HOME/bin"
make
make install
make distclean
. ~/.bash_profile

cd ~/ffmpeg_sources
git clone --depth 1 git://git.videolan.org/x264
cd x264
./configure --prefix="$HOME/ffmpeg_build" --bindir="$HOME/bin" --enable-static
make
make install
make distclean

cd ~/ffmpeg_sources
git clone --depth 1 git://git.code.sf.net/p/opencore-amr/fdk-aac
cd fdk-aac
autoreconf -fiv
./configure --prefix="$HOME/ffmpeg_build" --disable-shared
make
make install
make distclean

cd ~/ffmpeg_sources
curl -L -O http://downloads.sourceforge.net/project/lame/lame/3.99/lame-3.99.5.tar.gz
tar xzvf lame-3.99.5.tar.gz
cd lame-3.99.5
./configure --prefix="$HOME/ffmpeg_build" --bindir="$HOME/bin" --disable-shared --enable-nasm
make
make install
make distclean

cd ~/ffmpeg_sources
curl -O http://downloads.xiph.org/releases/opus/opus-1.0.3.tar.gz
tar xzvf opus-1.0.3.tar.gz
cd opus-1.0.3
./configure --prefix="$HOME/ffmpeg_build" --disable-shared
make
make install
make distclean

cd ~/ffmpeg_sources
curl -O http://downloads.xiph.org/releases/ogg/libogg-1.3.1.tar.gz
tar xzvf libogg-1.3.1.tar.gz
cd libogg-1.3.1
./configure --prefix="$HOME/ffmpeg_build" --disable-shared
make
make install
make distclean

cd ~/ffmpeg_sources
curl -O http://downloads.xiph.org/releases/vorbis/libvorbis-1.3.3.tar.gz
tar xzvf libvorbis-1.3.3.tar.gz
cd libvorbis-1.3.3
./configure --prefix="$HOME/ffmpeg_build" --with-ogg="$HOME/ffmpeg_build" --disable-shared
make
make install
make distclean

cd ~/ffmpeg_sources
git clone --depth 1 http://git.chromium.org/webm/libvpx.git
cd libvpx
./configure --prefix="$HOME/ffmpeg_build" --disable-examples
make
make install
make clean

tar -zxvf lame-3.98.4.tar.gz 
cd lame-3.98.4
./configure
make
make install

mkdir /tmp2
chmod 777 /tmp2
export "TMPDIR=/tmp2"

cd ~/ffmpeg_sources
git clone --depth 1 git://source.ffmpeg.org/ffmpeg
cd ffmpeg
PKG_CONFIG_PATH="$HOME/ffmpeg_build/lib/pkgconfig"
export PKG_CONFIG_PATH
./configure --prefix="$HOME/ffmpeg_build" --extra-cflags="-I$HOME/ffmpeg_build/include" --extra-ldflags="-L$HOME/ffmpeg_build/lib" --bindir="$HOME/bin" --extra-libs="-ldl" --enable-gpl --enable-nonfree --enable-libfdk_aac --enable-libmp3lame --enable-libopus --enable-libvorbis --enable-libvpx --enable-libx264
make
make install
make distclean
hash -r
. ~/.bash_profile

Reset / Reinstall Softaculous on a cPanel server

In order to reset Softaculous settings to default and reinstall it you need to execute the following commands:

# REMOVE
/usr/local/cpanel/bin/unregister_cpanelplugin /usr/local/cpanel/whostmgr/docroot/cgi/softaculous/softaculous.cpanelplugin
rm -rf /etc/cron.d/softaculous
rm -rf /var/softaculous
rm -rf /usr/local/cpanel/whostmgr/cgi/softaculous
rm -rf /usr/local/cpanel/whostmgr/cgi/addon_softaculous.php
rm -rf /usr/local/cpanel/whostmgr/cgi/addon_softaculous.cgi
rm -rf /usr/local/cpanel/base/frontend/x3/dynamicui/dynamicui_softicons.conf

# INSTALL
wget -N http://files.softaculous.com/install.sh
chmod 755 install.sh
./install.sh