MCE Control Computer
Template:Hierarchy header The MCE Control Computer (MCC) is a single board computer (Advantech PCI-7030) mated to one or two PCI fibre cards.
It is available in two form-factors:
- a 2U-high rackmount, AC-in configuration for ground-based experiments (known as the "2U MCC")
- a small form-factor (35×27×5cm) DC-in configuration for balloon experiments (known as the "small MCC")
We encourage it's use as a MCE controller for all experiments.
Contents
Mechanical and electrical
I/O
A labelled schematic of main panel of the MCC is presented below.
- Small MCC:
- 2U MCC back panel:
A | PCI fibre card reset switch (unused) | J | RJ-45 1000-baseT Ethernet |
---|---|---|---|
B | PCI fibre card fibre receiver | K | VGA display port |
C | PCI fibre card red light (fibre detect) | L | Reset switch (small MCC only; 2U MCC has equivalent on front panel) |
D | PCI fibre card green light | M | Power LED (small MCC only; 2U MCC has equivalent on front panel) |
E | PCI fibre card fibre transmitter | N | Power LED (small MCC only; 2U MCC has equivalent on front panel) |
F | PCI fibre card DIO (unused) | O | 18-36 VDC Power in (small MCC only) |
G | PS/2 keyboard port | P | 115V/60 Hz AC Power in (2U MCC only) |
H | USB (x2) | Q | Mains Fuse (2U MCC only) |
I | USB (x4) (optional: typically installed in 2U MCC but omitted from small MCC) |
The two form-factors have the same basic external connections with the following exceptions:
- the reset switch (#L), LEDs (#M, #N) and DC-in power connector (#O) on the PC panel are populated on small MCC panel but not on the 2U MCE back panel (a blank is installed in their place). The 2U MCC has a reset switch, LEDs and a power switch on the front panel (not shown in diagram)
- the 2U MCC has a HP-style AC-in power connector and fuse on the back panel.
- Four of the six USB ports are optional (#I). They are typically not installed on a small MCC (simply for weight saving).
In MCCs with only one fibre card, typically Card #1 is missing, and the panel replaced with a blank.
Power
- The power consumption of a typical MCC is approximately 30-35 W (5 W less with only one fibre card).
- The 2U MCC takes 85-264V, 50-60Hz AC mains power over a 3-pin HP-style power connector. The small MCC requires 24-Volt nominal (18-36 V allowed) DC power.
- The 2U MCC has a front panel power switch. The small MCC has no power switch: DC-in must be switched externally.
- The small MCE power connector is an Amphenol PTC-2A-14-5P. Positive voltage is on pins B and C. Return is on pins D and E.
Operating system
The MCC comes pre-installed with all the software needed to run MCEs. It runs a stripped-down Ubuntu 12.04. The main operating system is installed on a compact-flash card on the computer and the Ubuntu root filesystem is, by default, mounted read-only. Data are written to one or two hard-drives also installed in the system (typically one hard drive is installed per fibre card). Both /home and the writable parts of /var are placed one of these hard drives; this should be kept in mind if swapping out the hardware. (See the mcc_init discussion below for ways to simplify this.)
Bookkeeping numbers and hostname
The MCC operating system is replicated from a master image of the CF card kept at UBC. The serial number of the particular image used for an install of the MCC operating system is available in /etc/mcc_serial. (The serial number corresponds only roughly to the date of the image's creation.)
When mastered, each MCC is assigned a installation number as well (for bookkeeping purposes). This number is available in /etc/mcc_id. The default hostname of an MCC is mcc## where ## is it's installation number. (For a convenient way to change the computer's hostname, see the mcc_init program below.)
Networking and security considerations
The normal interface to the MCC by other computers is over the 1000-baseT ethernet. By default it is set up to obtain its IP address via DHCP. Because the operating system is not typically kept up to date, the MCC network interface should be considered insecure: do not expose it to the wider Internet. By default the MCC exports its data hard drive(s) to the world via read-only NFS.
User accounts
There is only one user on the MCC, called 'mce', with full sudo rights. Password information is provided along with the MCC when shipped, or may be requested from UBC. It is rarely necessary to create more accounts.
Filesystem architecture
In addition to the standard Linux filesystem hierarchy, the following points should be noted.
- Data drives are mounted on /data0 and /data1. Data collected from PCI fibre card #0 are written to /data0/mce. Data collected from PCI fibre card #1 are written to /data1/mce. These are also aliased as /data/mce0 and /data/mce1 respectively.
- The parts of /var which must be writable are located under /data0/var.
- /tmp is a symlink to /data0/var/tmp.
- /home is a symlink to /data0/home.
- MAS and MCE script are installed in /data0/mas. This is symlinked as /usr/mce for backwards compatibility.
- The MAS configuration files are in /data0/mas/etc. This is symlinked as /etc/mce for backwards compatibility.
- The 'mce' user has checked-out and configured/build copies of MAS/trunk and MCE_script in ~/src/. A "make install" of either of these can be done as 'mce' without needed to use sudo.
- Because most of the root filesystem is mounted read-only, normal install of the MAS kernel driver and the MAS init and udev scripts aren't possible (even as root). The configuration of the default check-out copy of MAS disables the install of all of these. It is rarely necessary to update them.
Configuration
For simplicity, we generally recommend using DHCP, perhaps keyed to your MCC's MAC address, for network configuration. A static IP can be assigned. The mcc_init script can help with network configuration.
MAS configuration
Although the default installation does install MAS and MCE script, the configuration of MAS hasn't been matched to any particular MCE configuration. Before using the MCC to acquire data it is generally necessary to reinstall the mce0.cfg and mce1.cfg with ones appropriate to your MCEs. To do this:
- log into the MCC as 'mce'
- change directory to ~/src/mas
- edit config2/mce0.cin and config2/mce1.cin as appropriate for your systems.
- run make from ~/src/mas to build the .cfg files.
- run make install to install them.
MCE script configuration
MCE script expects to find configuration data in /data0/mas/config (aliased as /usr/mce/config). Either create this directory from the MCE script template directory or else check-out your experiment's files from the mce_config repository. You will also have to create the /data0/mce/array_id and /data1/mce/array_id files.
Using the MCC
If you've never used MAS on a computer with multiple fibre cards, you may want to read Multicard MAS.
mcc_init
A utility script, mcc_init is provided to simplify some common tasks associated with MCC configuration. This script is located at /root/mcc_init. The script was written to automate initial installation and configuration of the MCC, but can be useful in certain situations on a running system as well.
- Caveat utor: Given the right options, this script will do such potentially harmful things like mount and unmount volumes, repartition and format hard drives, all without user intervention. As a result, the script should be treated cautiously: cavalier use of mcc_init may result in data loss and/or render the MCC unbootable or the operating system unusable. (This is why we keep it out of the way in /root.)
The following restrictions are placed on running mcc_init:
- It must be run as root (usually via sudo)
- It must be run from /.
As a result, the script is usually invoked with something like:
$ cd / && sudo /root/mcc_init [options]
Running the script without any options will produce a usage summary. To further discourage inadvertant use of the script, unless installing a new system, the first option to the script must be reconfig. Other options indicating the desired operation may be given after this.
Available operations include:
- duplicate
- make /data1 a copy of /data0. (It's a partial copy: acquired data in /data0/mce is not copied.)
- hostname=HOSTNAME
- set the hostname to HOSTNAME;
- installmas
- install MAS and MCE script from the sources in ~/src. If they aren't found, they will be checked out, configured, and built, as necessary, beforehand;
- newkey
- generate a new SSH server key;
- remaster=0
- recreate the default /data0. This will delete everything on /data0 (Including mce's home directory)!
- remaster=1
- recreate the default /data1. This will delete everything on /data1!
- remaster=01
- recreate both hard drives
- noupdate
- normally the script checks whether an updated version of itself is available before running. This operation with skip this step.
See the maintenance section below for examples of use.
Maintenance
Reinstalling the system (returning to the "factory default")
The MCC can be reinitialised to it's original configuration in the field with the following procedure:
- Record your installation number (available in /etc/mcc_id.
- Remove the compact flash card from the single board computer.
- Download a mcc_image file from http://e-mode.phas.ubc.ca/mce/mcc/ . In general it's best to use the latest image.
- Re-image the compact flash card:
# dd if=mcc_image_######## of=/dev/sdX
where ######## is the image serial number and X is the device letter of the CF card. This will repartition the device, so be very certain you have the right device node.
- reinstall the CF card and boot the MCC.
The first time you boot the MCC after doing this, you may see a number of warning or error messages; they shouldn't be fatal.
- Log in as mce using the default password and use mcc_init to finish the installation:
$ cd / && sudo /root/mcc_init config id=N
where N is the installation number you recorded at the beginning.
- Optionally record the numbers mcc_init spits out at the end. (Notably: the SSH fingerprint will have been regenerated).
- Reboot the computer after mcc_init completes
You should now be back to the default installation.
Replacing hard drives without preserving /home
Because parts of the operating system are on the data drives, replacing them with semi-break the system. If you don't care about the contents of the old hard drives, simply replace the hardware and boot the MCC.
The first time you boot the MCC after doing this, you may see a number of warning or error messages; they shouldn't be fatal.
- Log in as mce and use mcc_init to remaster the new hard drives:
$ cd / && sudo /root/mcc_init reconfig remaster=01
- Reboot the computer after mcc_init completes.
Replacing hard drive with partial data preservation
It is possible to replace the hard drives in the MCC while preserving the current contents of /home and /usr/mce. It's a two step process:
- make a copy of /data0 on a new hard drive
- install the new hard drives in their correct locations
- NB: because there may be bugs, it's a good idea to back up your data regardless. This procedure doesn't preserve anything on /data1 nor does it preserve the acquired data in /data0/mce.
- Remove the old /data1 and install the hard drive you want to use as the new /data0 in it's place and boot the computer.
- Log in as mce and use mcc_init to duplicate /data0 on /data1:
$ cd / && sudo /root/mcc_init reconfig duplicate
- turn off the MCC again; remove the old /data0; move the new /data0 into the right place and install the second new drive as /data1. Boot the computer again.
- Log in as mce and use mcc_init to remaster /data1:
$ cd / && sudo /root/mcc_init reconfig remaster=1