How to recover your iscsi data from an Openfiler disaster.

First, stop panicking.   Openfiler is not magic.  It is based on widely used open source software.   The key to recovering your data is to understand the foundation of Openfiler.

A well designed system has separate drives for the operating system and the data.  If you have followed these principles and can no longer boot your Openfiler system, it does not necessarily mean that your data is lost.    Let’s consider the following case.

Your Openfiler system contains data drives in a redundant RAID configuration, and a non-redundant drive for the OS.   The disk for your OS stops working because it reaches the end of its life.  It happens.  But your data drives are still in-tact.   How do you recover?  Follow these steps.

  1. Swap out the OS drive with a replacement blank drive.
  2. Install OpenFiler to the blank drive.   DO NOT format any of the data disks while installing.  If possible, install OpenFiler on the blank drive while it is connected to a different machine, just to ensure that it cannot possibly erase your data.
  3. Boot the new OpenFiler drive in the server that could not previously boot up.
  4. Login to the terminal and type the following:  lvdisplay | grep “Name”
  5. Make a note of each LV Name and subsequent VG Name pair.
  6. Type: nano /opt/openfiler/etc/volumes.xml
  7. Below <volumes> type the following:  <volume id=”LV Name” name=”LV Name” mountpoint=”” vg=”VG Name” fstype=”iscsi” />  Note:  The words LV Name and VG Name should be replaced by the actual pair of words that you documented in step #5.  This syntax for fstype=”iscsi” is only valid if the volume was an iSCSI volume to begin with.   If you were using it as NFS storage or a Samba share, then you need to use different syntax.
  8. Save the XML file when you are done, and browse to the Openfiler URL.
  9. When you click to display the volumes and refresh your screen you should see the volumes show up again.  This is a good sign.  You’re almost done.
  10. Enable the iscsi target from the services tab and ensure that it starts.
  11. Click back to volumes and then click on iscsi targets.   Create new targets for your servers, and then re-map the targets to the volumes that you added.
  12. Once you finish configuring your network ACLs, you should be back online again.  Congratulations!   You have just recovered your iscsi data!