<?xml version="1.0"?>
<?xml-stylesheet type="text/css" href="http://freebsdwiki.net/skins/common/feed.css?303"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
		<id>http://freebsdwiki.net/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=216.109.69.140</id>
		<title>FreeBSDwiki - User contributions [en]</title>
		<link rel="self" type="application/atom+xml" href="http://freebsdwiki.net/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=216.109.69.140"/>
		<link rel="alternate" type="text/html" href="http://freebsdwiki.net/index.php/Special:Contributions/216.109.69.140"/>
		<updated>2026-04-07T20:33:33Z</updated>
		<subtitle>User contributions</subtitle>
		<generator>MediaWiki 1.18.0</generator>

	<entry>
		<id>http://freebsdwiki.net/index.php/Megarc</id>
		<title>Megarc</title>
		<link rel="alternate" type="text/html" href="http://freebsdwiki.net/index.php/Megarc"/>
				<updated>2009-01-08T14:54:34Z</updated>
		
		<summary type="html">&lt;p&gt;216.109.69.140: /* Megarc port for FreeBSD */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:Ports and Packages]] [[Category:RAID]]&lt;br /&gt;
'''''{{PAGENAME}}''''' is a commandline utility that provides an interface to many of the configuration and reporting functions for LSI Logic's MegaRAID BIOS (http://www.lsilogic.com).   &lt;br /&gt;
&lt;br /&gt;
==Megarc port for FreeBSD==&lt;br /&gt;
The ''megarc'' utility ships as a binary, without any accompanying documentation, on the &amp;quot;Megaraid Universal Software Suite&amp;quot; CD which accompanies any boxed LSI Logic RAID storage adapter.  It is also found in the FreeBSD ports collection.&lt;br /&gt;
&lt;br /&gt;
* On the CD that comes with the storage adapter, the utility is found in two places.  It is part of a zipped bundle in &amp;lt;cd&amp;gt;:\SW_Components\Drivers\dr_freebsd_1.51.zip on our distribution.  The zip file contents are as follows:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  Length     Date   Time    Name&lt;br /&gt;
 --------    ----   ----    ----&lt;br /&gt;
   130448  04-18-05 14:10   MegaRC 1.04.zip&lt;br /&gt;
    12953  10-08-04 16:05   amr_x86_64_ver1_51FreeBSD5.3.tgz&lt;br /&gt;
   153600  03-17-05 15:19   code.tar&lt;br /&gt;
      535  02-10-05 11:02   FreeBSDDriverUpdate.txt&lt;br /&gt;
    12774  10-12-04 19:38   amr_i386_ver_1_51_FreeBSD5.3.tgz&lt;br /&gt;
 --------                   -------&lt;br /&gt;
   310310                   5 files&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* The utility is also found on the CD by itself, at &amp;quot;&amp;lt;cd&amp;gt;:\SW_Components\Utilities\ut_FreeBSD_MegaRC 1.04.zip&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
* It can be downloaded from LSI at http://www.lsi.com/DistributionSystem/AssetDocument/files/support/rsa/beta/drivers/dr_freebsd_1.51.zip&lt;br /&gt;
&lt;br /&gt;
* It can be also be installed from the [http://www.freebsd.org/cgi/cvsweb.cgi/ports/sysutils/megarc/ ports collection] at /usr/ports/sysutils/megarc.  The port extracts the binary from the bundled dr_freebsd_*.zip  Our example was installed from the ports collection on 6.1-PRERELEASE FreeBSD  amd64&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# file /usr/local/sbin/megarc&lt;br /&gt;
 /usr/local/sbin/megarc: ELF 32-bit LSB executable, Intel 80386,&lt;br /&gt;
 version 1 (FreeBSD), for FreeBSD 5.2.1, statically linked, stripped&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Documentation==&lt;br /&gt;
The documentation for megarc is limited to the output of its ?/help functions.  Since these [[RAID]] adapters are reasonably popular, and the commands are a bit scary and somewhat obscurely named, this page might prove helpful to someone even though it's not complete.  &lt;br /&gt;
&lt;br /&gt;
Megarc must be run with sufficient privileges, or the adapter will not be found.  &amp;quot;?&amp;quot; and &amp;quot;help&amp;quot; are not synonymous.  ''?'' (mis-named &amp;quot;complete help&amp;quot;) gives brief syntax hints.  ''help'' gives a fuller description of what the command does, and its arguments and usage.  &lt;br /&gt;
&lt;br /&gt;
* To see the commands available, as root type:&amp;lt;br /&amp;gt;&amp;lt;code&amp;gt;megarc ?&amp;lt;/code&amp;gt;&lt;br /&gt;
    First Parameter should be :&lt;br /&gt;
       -AllAdpInfo &lt;br /&gt;
       ... etc ...&lt;br /&gt;
*To see a list of commands and syntax, type:&amp;lt;br /&amp;gt; &amp;lt;code&amp;gt;megarc help&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 -------------------------------------------------------------------------&lt;br /&gt;
        * Convention Used:&lt;br /&gt;
           [Cmd = The name of the utility]&lt;br /&gt;
           opt1|opt2|opt3 =&amp;gt; Only one of these can be specified&lt;br /&gt;
&lt;br /&gt;
 -------------------------------------------------------------------------&lt;br /&gt;
 Cmd ?: Gives complete help&lt;br /&gt;
 Cmd -functionality ?: functionality specific help&lt;br /&gt;
 Example:&lt;br /&gt;
 Cmd -ctlrInfo ? :help on -ctlrinfo option&lt;br /&gt;
&lt;br /&gt;
 -------------------------------------------------------------------------&lt;br /&gt;
 Usage: Cmd -ctlrInfo  -aX &lt;br /&gt;
 ... etc ...&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
* '''Example:'''&amp;lt;br /&amp;gt; &amp;lt;code&amp;gt; megarc -ctlrInfo help &amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  **********************************************************************&lt;br /&gt;
&lt;br /&gt;
  usage :&lt;br /&gt;
  cmd -ctlrInfo -aX&lt;br /&gt;
  : Shows general adapter info of adapter&lt;br /&gt;
  **********************************************************************&lt;br /&gt;
  where :&lt;br /&gt;
    cmd : name of the utility&lt;br /&gt;
    -aX : adapter number X(max 12 adapters). X=0..11&lt;br /&gt;
 **********************************************************************&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Examples==&lt;br /&gt;
For the examples below, we are using an LSILogic 150-6 x64 SATA RAID adapter on a 32-bit PCI slot - &amp;quot;adapter 0&amp;quot; on the system - with a RAID 5 volume consisting of five (5) physical SATA drives of 400GB each.  The hot-spare belongs to target 00 but is being replaced at the time of this writing.&lt;br /&gt;
&lt;br /&gt;
Below are some brief descriptions of some of the commands, and some examples of output from a few of the information functions.  These command-options are not case-sensitive.&lt;br /&gt;
&lt;br /&gt;
===megarc -dispCfg -a0 ===&lt;br /&gt;
Display the configuration for adapter ''0''.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
          Logical Drive : 0( Adapter: 0 ):  Status: OPTIMAL&lt;br /&gt;
        ---------------------------------------------------&lt;br /&gt;
        SpanDepth :01     RaidLevel: 5  RdAhead : No  Cache: DirectIo&lt;br /&gt;
        StripSz   :064KB   Stripes  : 5  WrPolicy: WriteThru&lt;br /&gt;
&lt;br /&gt;
        Logical Drive 0 : SpanLevel_0 Disks&lt;br /&gt;
        Chnl  Target  StartBlock   Blocks      Physical Target Status&lt;br /&gt;
        ----  ------  ----------   ------      ----------------------&lt;br /&gt;
        0      01    0x00000000   0x2e936800   ONLINE&lt;br /&gt;
        0      02    0x00000000   0x2e936800   ONLINE&lt;br /&gt;
        0      03    0x00000000   0x2e936800   ONLINE&lt;br /&gt;
        0      04    0x00000000   0x2e936800   ONLINE&lt;br /&gt;
        0      05    0x00000000   0x2e936800   ONLINE&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===megarc -LogPhysInfo -a0 ===&lt;br /&gt;
Display the physical drive information for each of the logical drives on adapter ''0''.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
        Logical drive 0: RaidLevel 5&lt;br /&gt;
&lt;br /&gt;
        Physical Drive Information&lt;br /&gt;
        Channel 0&lt;br /&gt;
                381549MB drive ID 1&lt;br /&gt;
        CoerSZ: 781412352(Sectors) 381549(MB)  RawSZ: 781422255(Sectors)&lt;br /&gt;
                381549MB drive ID 2&lt;br /&gt;
        CoerSZ: 781412352(Sectors) 381549(MB)  RawSZ: 781422255(Sectors)&lt;br /&gt;
                381549MB drive ID 3&lt;br /&gt;
        CoerSZ: 781412352(Sectors) 381549(MB)  RawSZ: 781422255(Sectors)&lt;br /&gt;
                381549MB drive ID 4&lt;br /&gt;
        CoerSZ: 781412352(Sectors) 381549(MB)  RawSZ: 781422255(Sectors)&lt;br /&gt;
                381549MB drive ID 5&lt;br /&gt;
        CoerSZ: 781412352(Sectors) 381549(MB)  RawSZ: 781422255(Sectors)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===megarc -ScfgAndParm|-DfcfgAndParm|-RcfgAndParm -fFileName -a0 ===&lt;br /&gt;
Save, Display, or Restore the configuration and parameters for adapter ''0'', in ''FileName''.  ''FileName'' stores the same output provided by -dispCfg in a binary format, making it possible to directly load the stored configuration from the file.&lt;br /&gt;
&lt;br /&gt;
===megarc -physOn pd[c0:t0,c1:t1....] -a0===&lt;br /&gt;
&lt;br /&gt;
Set the state of the designated drive(s) to ''Online''.  ''pd[c:t]'' refers to at least one physical drive by channel and target.  ''-aN'' here as elsewere is the adapter number [required]&lt;br /&gt;
&lt;br /&gt;
If the physical drive does not exist or if it isn't in failed state, the utility exits with no harm done.&lt;br /&gt;
&lt;br /&gt;
An example of this command under our present configuration would be:  &lt;br /&gt;
 megarc -physOn -a0 pd[0:1]&lt;br /&gt;
&lt;br /&gt;
===megarc -phys -chAll -idAll -a0===&lt;br /&gt;
Show the physical drive description for each device on all channels managed by adapter ''0''&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
        Adapter 0, Channel 0, Target ID 1     &lt;br /&gt;
        Type: DISK                 Vendor      : WDC&lt;br /&gt;
        Product: WD4000KD-00NAB0   Revision    : 01.0&lt;br /&gt;
        Synchronous   : No         Wide-32     : No    Wide-16: No&lt;br /&gt;
        LinkCmdSupport: No         TagQ support: No    RelAddr: No&lt;br /&gt;
        Removable     : No         SoftReset   : No    AENC   : No&lt;br /&gt;
   etc...&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===megarc -physdrvSerialInfo -chAll -idAll -a0===&lt;br /&gt;
Show the serial number for each physical drive on each channel for all serial devices managed by adapter ''0'' (This doesn't look correct or helpful).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  Adapter 0, Channel 0, Target ID 1 &lt;br /&gt;
&lt;br /&gt;
  PhysDrvSerial#:      WD-W&lt;br /&gt;
&lt;br /&gt;
 etc ...&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===megarc -pdFailInfo -chAll -idAll -a0===&lt;br /&gt;
Show the failure history for each device on all channels managed by adapter ''0''.  &lt;br /&gt;
&lt;br /&gt;
===megarc -setRbldRate|-getRbldRate -a0 ===&lt;br /&gt;
Get the rebuild rate for adapter ''0''.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
# megarc -getRbldRate -a0&lt;br /&gt;
&lt;br /&gt;
 ...&lt;br /&gt;
&lt;br /&gt;
 **********************************************************************&lt;br /&gt;
 RebuildRate of Adapter-0 is 30&lt;br /&gt;
 **********************************************************************&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===megarc -ctlrInfo -a0===&lt;br /&gt;
Display information about adapter ''0''.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  **********************************************************************&lt;br /&gt;
  Information of Adapter-0 (#Adapter(s) on system: 1)&lt;br /&gt;
  **********************************************************************&lt;br /&gt;
&lt;br /&gt;
  Firmware Version : 713N         BIOS Version : G119&lt;br /&gt;
  Logical Drives : 01             DRAM : 64MB&lt;br /&gt;
  Rebuild Rate : 30%&lt;br /&gt;
  Flush Interval : 4 secs&lt;br /&gt;
  Number Of Chnls : 1             Bios Status : Enabled&lt;br /&gt;
  Alarm State : Enabled           Auto Rebuild : Enabled&lt;br /&gt;
  FW : SPAN-8, 40-LD              BIOS Config AutoSelection : USER&lt;br /&gt;
  BIOS Echos Mesg : ON            BIOS Stops On Error : ON&lt;br /&gt;
  Initiator Id : 16(Clustered Firmware)&lt;br /&gt;
  Board SN: -17179869&lt;br /&gt;
  **********************************************************************&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===megarc -getXFerRate|-setXFerRate -a0 -chAll===&lt;br /&gt;
Get or set the transfer rate for all channels on adapter ''0''.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# megarc -getXFerRate -a0 -ch0&lt;br /&gt;
&lt;br /&gt;
   **********************************************************************&lt;br /&gt;
   Transfer Rate of Adapter-0 Channel-0 is 160M&lt;br /&gt;
   **********************************************************************&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>216.109.69.140</name></author>	</entry>

	</feed>