Kroko Just another WordPress weblog

May 18, 2018

MEGACLI CHEATSHEET

Filed under: Linux — admin @ 11:35 am

Recently I’ve had to do extensive work with Dell PowerEdge servers, and specifically Dell’s that use the LSI MegaRAID controllers. Anyone who has ever had to work with the LSI RAID controllers knows that the MegaCLI provided by LSI is the most cryptic command line utility in existence. MegaCli is available for Linux, DOS, Windows, Netware and Solaris. You can get it from LSI’s website (search for MegaRAID SAS).

Inside the tarball or zip file you’ll find an RPM archive which contains the MegaCli and MegaCli64 binaries (will be installed to /opt/MegaRAID/MegaCli).

Please note:
This emergency cheat sheet is not exhaustive, but it should be sufficient in most cases. For a complete reference either call MegaCli -h or refer to the manual at: http://www.lsi.com/files/docs/techdocs/storage_stand_prod/sas/mr_sas_sw_ug.pdf (no longer available there)

Here is a local copy: https://blog.kroko.ro/wp-content/uploads/2018/05/mr-sas-sw-ug-en.pdf

While there are a lot of different parameters for MegaCli, some of them are always identical. These are described here in short.

Adapter parameter -aN
The parameter -aN (where N is a number starting with zero or the string ALL) specifies the PERC5/i adapter ID. If you have only one controller it’s safe to use ALL instead of a specific ID, but you’re encouraged to use the ID for everything that makes changes to your RAID configuration.

Physical drive parameter -PhysDrv [E:S]
For commands that operate on one or more pysical drives, the -PhysDrv [E:S] parameter is used, where E is the enclosure device ID in which the drive resides and S the slot number (starting with zero). You can get the enclosure device ID using “MegaCli -EncInfo -aALL”. The E:S syntax is also used for specifying the physical drives when creating a new RAID virtual drive.

Virtual drive parameter -Lx
The parameter -Lx is used for specifying the virtual drive (where x is a number starting with zero or the string all).

Controller information

MegaCli -AdpAllInfo -aALL
MegaCli -CfgDsply -aALL
MegaCli -AdpEventLog -GetEvents -f /dev/stdout -aALL

Enclosure information

MegaCli -EncInfo -aALL

Virtual drive information

MegaCli -LDInfo -Lall -aALL

Physical drive information

MegaCli -PDList -aALL
MegaCli -PDInfo -PhysDrv [E:S] -aALL

Battery backup information

MegaCli -AdpBbuCmd -aALL

Controller management

Silence active alarm

MegaCli -AdpSetProp AlarmSilence -aALL

Disable alarm

MegaCli -AdpSetProp AlarmDsbl -aALL

Enable alarm

MegaCli -AdpSetProp AlarmEnbl -aALL

Physical drive management

Set state to offline

MegaCli -PDOffline -PhysDrv [E:S] -aN

Set state to online

MegaCli -PDOnline -PhysDrv [E:S] -aN

Mark as missing

MegaCli -PDMarkMissing -PhysDrv [E:S] -aN

Prepare for removal

MegaCli -PdPrpRmv -PhysDrv [E:S] -aN

Replace missing drive

MegaCli -PdReplaceMissing -PhysDrv [E:S] -ArrayN -rowN -aN

The number N of the array parameter is the Span Reference you get using “MegaCli -CfgDsply -aALL” and the number N of the row parameter is the Physical Disk in that span or array starting with zero (it’s not the physical disk’s slot!).

Rebuild drive

MegaCli -PDRbld -Start -PhysDrv [E:S] -aN
MegaCli -PDRbld -Stop -PhysDrv [E:S] -aN
MegaCli -PDRbld -ShowProg -PhysDrv [E:S] -aN

Clear drive

MegaCli -PDClear -Start -PhysDrv [E:S] -aN
MegaCli -PDClear -Stop -PhysDrv [E:S] -aN
MegaCli -PDClear -ShowProg -PhysDrv [E:S] -aN

Bad to good (or back to good as I like to call it)

MegaCli -PDMakeGood -PhysDrv[E:S] -aN

This changes drive in state Unconfigured-Bad to Unconfigured-Good.

Walkthrough: Change/replace a drive

Set the drive offline, if it is not already offline due to an error

MegaCli -PDOffline -PhysDrv [E:S] -aN

Mark the drive as missing

MegaCli -PDMarkMissing -PhysDrv [E:S] -aN

Prepare drive for removal

MegaCli -PDPrpRmv -PhysDrv [E:S] -aN

Change/replace the drive

If you’re using hot spares then the replaced drive should become your new hot spare drive:

MegaCli -PDHSP -Set -PhysDrv [E:S] -aN

In case you’re not working with hot spares, you must re-add the new drive to your RAID virtual drive and start the rebuilding

MegaCli -PdReplaceMissing -PhysDrv [E:S] -ArrayN -rowN -aN
MegaCli -PDRbld -Start -PhysDrv [E:S] -aN

 

Script to find DiskGroup assigned to each slot in server:

for i in `seq 0 11`; do 
  echo '-----------------------';
  MegaCli -PDInfo -PhysDrv [32:$i] -aALL|grep position; 
  smartctl -d sat+megaraid,$i -a /dev/sda|egrep -i '(Offline_Uncorrectable|Pending_Sector|Reallocated_Sector_Ct|Model|Serial)'; 
done

March 24, 2018

Orange Romania DVB-C Muxes

Filed under: Uncategorized — admin @ 7:00 pm

Here are manual muxes settings for TvHeadend:

Orange Romania DVB-C:

Muxes:

682Mhz
690Mhz
698Mhz
706Mhz
714Mhz
722Mhz
730Mhz
738Mhz
746Mhz
754Mhz
762Mhz
770Mhz
778Mhz
786Mhz
794Mhz
802Mhz
810Mhz
826Mhz (Fail?)

Symbol rate (Sym/s) 6900000
Constellation : QAM/256
FEC: 3/5

Provider network name: Telekom Romania

October 9, 2017

Erori compilare mc pe macos 10.13 macports

Filed under: MacOS — admin @ 11:05 am

Urmati tutorialul de mai jos daca primiti acelasi mesaj ca si mine:

kroko:sources kroko$ sudo port install mc

—>  Computing dependencies for mc

—>  Fetching archive for mc

—>  Attempting to fetch mc-4.8.19_0+slang2.darwin_17.x86_64.tbz2 from https://packages.macports.org/mc

—>  Attempting to fetch mc-4.8.19_0+slang2.darwin_17.x86_64.tbz2 from http://nue.de.packages.macports.org/mc

—>  Attempting to fetch mc-4.8.19_0+slang2.darwin_17.x86_64.tbz2 from http://lil.fr.packages.macports.org/mc

—>  Fetching distfiles for mc

—>  Verifying checksums for mc

—>  Extracting mc

—>  Applying patches to mc

—>  Configuring mc

—>  Building mc

Error: Failed to build mc: command execution failed

Error: See /opt/local/var/macports/logs/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_sysutils_mc/mc/main.log for details.

Error: Follow https://guide.macports.org/#project.tickets to report a bug.

Error: Processing of port mc failed

 

FIX:

cd /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_sysutils_mc/mc/work/mc-4.8.19

editam fisierul: src/filemanager/file.c

cautam linia ”

get_times (const struct stat *sb, mc_timesbuf_t * times)"

si acolo vom gasi ceva de genul:

get_times (const struct stat *sb, mc_timesbuf_t * times)

{

#ifdef HAVE_UTIMENSAT

    (*times)[0] = sb->st_atim;

    (*times)[1] = sb->st_mtim;

#else

     times->actime = sb->st_atime;

     times->modtime = sb->st_mtime;

 

modificam liniile:

    (*times)[0] = sb->st_atim;

    (*times)[1] = sb->st_mtim;

cu:

    (*times)[0] = sb->st_atimespec;

    (*times)[1] = sb->st_mtimespec;

 

in final trebuie sa ramanem cu:

get_times (const struct stat *sb, mc_timesbuf_t * times)

{

#ifdef HAVE_UTIMENSAT

    (*times)[0] = sb->st_atimespec;

    (*times)[1] = sb->st_mtimespec;

#else

     times->actime = sb->st_atime;

     times->modtime = sb->st_mtime;

dupa ce terminam de editat lansam din nou comanda:

kroko:mc-4.8.19 kroko$ sudo port install mc

--->  Computing dependencies for mc

--->  Building mc

--->  Staging mc into destroot

--->  Installing mc @4.8.19_0+slang2

--->  Activating mc @4.8.19_0+slang2

--->  Cleaning mc

--->  Updating database of binaries

--->  Scanning binaries for linking errors

--->  No broken files found.

Great succes 🙂

« Newer PostsOlder Posts »

Powered by WordPress