From Netsoc Wiki
Jump to: navigation, search

afacli is a somewhat cryptic utility that Dell used to provide for managing their hardware RAID controllers. It's the only way to interact with the hardware RAID on Spoon without a reboot. It's a bit fiddly.

We do not need to use afacli any more, arcconf works on spoon.

Executing afacli

Presumably because afacli wasn't compiled for x86_64, it's not possible to run it out-of-the-box (we have a 64-bit OS install on spoon). So, when it was set up, the admins of that time set up a 32-bit installation of Debian 3.0 ('sarge') in a chroot. This is located on a logical volume on the software RAID, called /dev/mapper/raid1-sarge--i386, and mounted on /var/chroot/sarge-i386 on boot. To use afacli, you have to chroot into this directory, and run it from there. The chroot shouldn't be used for anything other than running afacli.

To enter the chroot (need root):

[spoon] ~ > # chroot /var/chroot/sarge-i386

afacli doesn't like new-fangled TERMs like screen-256color, so you'll need to set to something more primitive, e.g.:

spoon:/# export TERM=linux

Now, running /usr/sbin/afacli should fire up a shell.

Note that /usr/local/spoon/sbin/afacli on / and /usr/local/sbin/afacli in the chroot will automate these steps for you, so assuming /usr/local/spoon/sbin is in your PATH, just typing afacli from a regular root shell should work.

Using the command shell

The command prompt initially looks like this:


Before you can do anything interesting, you need to open a connection to the RAID controller:

FASTCMD>open afa0

The prompt will change to reflect the name of the device you just opened:


To get an overview of the disks on the system, do disk list:

  AFA0> disk list
  Executing: disk list
  B:ID:L  Device Type     Blocks    Bytes/Block Usage            Shared Rate
  ------  --------------  --------- ----------- ---------------- ------ ----
  0:00:0   Disk            488281250 512         Initialized      NO     132 
  0:01:0   Disk            488281250 512         Initialized      NO     132 
  0:02:0   Disk            488281250 512         Initialized      NO     132 
  0:03:0   Disk            488281250 512         Initialized      NO     132 

disk show smart will show whatever S.M.A.R.T. information is available:

  AFA0> disk show smart
  Executing: disk show smart
          Smart    Method of         Enable 
          Capable  Informational     Exception  Performance  Error  
  B:ID:L  Device   Exceptions(MRIE)  Control    Enabled      Count
  ------  -------  ----------------  ---------  -----------  ------
  0:00:0     Y            0             Y           N             0
  0:01:0     Y            0             Y           N             0
  0:02:0     Y            0             Y           N             0
  0:03:0     Y            0             Y           N             0


afacli works by interacting with /dev/afa0. If this device file doesn't exist, you'll have to create it manually using MAKEDEV.

1. Make sure the procfs is mounted inside the chroot:

mount -t proc proc /proc

this ensures that MAKEDEV can access /proc/scsi for SCSI device information.

2. Make the device:

/dev/MAKEDEV afa0