How To Install 3ware Tools on Debian Lenny

Problem

In order to manage the 3ware raid controller under Linux, an embedded web server needs to be installed. 3ware provides a download-able tarball on their site, however, the installation on Lenny is problematic. The following steps explain how to get the install and the configuration done.

Solution

  • Edit /etc/apt/sources.list and add the following lines:
    # 3Ware
    deb http://jonas.genannt.name/debian lenny restricted
  • # wget -O - http://jonas.genannt.name/debian/jonas_genannt.pub | apt-key add -
  • # apt-get update
  • # apt-cache search 3ware
  • # aptitude install 3ware-3dm2-binary 3ware-cli-binary
  • # cd /etc/3dm2
  • # cp 3dm2.conf 3dm2.conf-dist
  • Edit 3dm2.conf set :
    RemoteAccess 1
  • # /etc/init.d/3dm2 restart
  • Browse to https://yourhost:888/
  • Select 3DM 2 Settings and change the default password 3ware to something secure. If you lock yourself out, you can copy the original config file back in place as it has the default password.

References


OpenVZ shared directory mounting from host to guest systems

Problem

An OpenVZ host can share any part of its filesystem with any guest operating system running on it. This post describes how to manually mount a filesystem tree from the host OpenVZ box to a guest, and how to automate the process. We will also address an error that can happen with a correctly configured file preventing the automated mount process.

Solution

Manual mount

To mount a filesystem tree to any guest from the host, run the following:
mount --bind /path/to/tree/on/host ${VE_ROOT}/path/to/tree/on/guest

You need to replace ${VE_ROOT} with /var/lib/vz/root/<guest id>

Automate the mount

There is two options to automate the mount: automation for each guest and automation for a specific guest. The file looks the same either way. For setting up a mount on each guest, use vps.mount and vps.umount as the file names. To use automated mount for a specific guest, use the the filename that is <guest id>.mount and <guest id>.umount. For example, if your container id for your virtual private server (guest) is 123, then the specific files to set the mount and unmount code for are 123.mount and 123.umount. This is how the .mount file needs to look:

#!/bin/bash
source /etc/vz/vz.conf
source ${VE_CONFFILE}
echo "Starting ${VEID}.mount..."
mount --bind /path/to/tree/on/host ${VE_ROOT}/path/to/tree/on/guest
echo "...${VEID}.mount complete"

And this is how the .umount file needs to look:

#!/bin/bash
source /etc/vz/vz.conf
source ${VE_CONFFILE}
echo "Starting ${VEID}.umount..."
umount ${VE_ROOT}/path/to/tree/on/guest
echo "...${VEID}.umount done"

Note that the echo is necessairy, otherwise, the filesystem will most likely not mount correctly. This is due to the fact that on start and restart the vzctl program will call umount first, and if that script fails (returns a non zero exit code) the .mount script isn’t called. Thus, if the directory isn’t mounted and there isn’t an echo at the end of the script, the script returns the exit code of the last command which in this case is the exit code from the failed umount command.

References