Linux operating systems

Manually configuring an iSCSI device on a Linux system

This procedure describes how to configure a Linux system that is used during an iSCSI mount operation. The VM snapshot is mounted from Tivoli® Storage Manager server storage.

Before you begin

During an iSCSI mount, an iSCSI target is created on the Tivoli Storage Manager recovery agent system. Microsoft iSCSI Initiator is not required on the Tivoli Storage Manager recovery agent system.
Tip: Open-iSCSI Initiator is provided with Red Hat Enterprise Linux and SUSE Linux Enterprise Server.
Review the following iSCSI requirements before you proceed with this task:
  • You can connect to the iSCSI target from any system to create a volume that contains the backup data. You can mount this volume from another system.
  • An iSCSI initiator is required on any system that must connect to the iSCSI target.
  • An iSCSI initiator must be installed on the system where the data is to be restored.
  • If a volume spans several disks, you must mount all the required disks. When mirrored volumes are used, mount only one of the mirrored disks. Mounting one disk prevents a time-consuming synchronization operation.

About this task

Complete these steps to configure the Linux system that is used during an iSCSI mount operation:

Procedure

  1. Record the iSCSI initiator name on the system where data is to be restored. The iSCSI initiator name is located in the /etc/iscsi/initiatorname.iscsi file. If the InitiatorName= value is empty, create an initiator name with the following command:
    twauslbkpoc01:~ # /sbin/iscsi-iname
    Here is an example initiator name:
    iqn.2005-03.org.open-iscsi:3f5058b1d0a0
  2. Add the initiator name to the /etc/iscsi/initiatorname.iscsi file.
    1. Edit the /etc/iscsi/initiatorname.iscsi file with vi command. For example:
      twauslbkpoc01:~ # vi /etc/iscsi/initiatorname.iscsi
    2. Update the InitiatorName= parameter with the initiator name. For example:
      InitiatorName=iqn.2005-03.org.open-iscsi:3f5058b1d0a0
  3. Complete the following steps on the system where the Tivoli Storage Manager recovery agent (or iSCSI target) is installed:
    1. Start the Tivoli Storage Manager recovery agent. Complete the Select TSM server and Select snapshot dialogs and click Mount.
    2. In the Choose mount destination dialog, select Mount an iSCSI target.
    3. Create a target name. Make sure that it is unique and that you can identify it from the system that runs the iSCSI initiator. For example:
      iscsi-mount-tsm4ve
    4. Enter the iSCSI Initiator name that was recorded in Step 1 and click OK.
    5. Verify that the volume you just mounted is displayed in the Mounted Volumes field.
  4. Locate and start the iSCSI Initiator program on the initiator system that was selected in Step 1:
    1. Verify that the iSCSI service is running by issuing this command:
      Red Hat Enterprise Linux:
      service iscsi status

      SUSE Linux Enterprise Server:
      service open-iscsi status
      If the service is not running, issuing this command to start the service:
      Red Hat Enterprise Linux:
      service iscsi start

      SUSE Linux Enterprise Server:
      service open-iscsi start
    2. Connect to the iSCSI target by issuing this command:
      iscsiadm -m discovery -t sendtargets -p <IP/hostname of Tivoli Storage Manager recovery agent  system> --login
    3. Verify that a new raw device is available by issuing this command:
      fdisk -l
  5. Mount the file system:
    For a non-LVM volume, issue the following commands. In this example, the new device is /dev/sdb1:
    mkdir /mountdir
    mount /dev/sdb1 /mountdir

    For an LVM volume, complete the following tasks on the Linux guest:
    1. Make sure that the vgimportclone script is available on the Linux system. This script is not shipped in the base (default) LVM package. As a result, you might need to update the LVM package to a level which provides this script.
    2. Issue the vgimportclone command and include a new base volume group name (VolGroupSnap01). For example:
      vgimportclone --basevgname /dev/VolGroupSnap01 /dev/sdb1
    3. Issue the lvchange command to mark the logical volume as active. For example:
      lvchange -a y /dev/VolGroupSnap01/LogVol00
    4. Issue these commands to mount the volume:
      mkdir /mountdir 
      mount -o ro /dev/VolGroupSnap01/LogVol00 /mountdir
  6. After the file restore operation completes, issue these commands:
    • For a non-LVM volume, issue the following commands:
      1. Unmount the file system:
        umount /dev/sdb1 /mountdir
      2. Remove the volume. If the volume is part of a volume group, first remove the volume from the volume group by issuing the following command:
        vgreduce <your_volume_group> /dev/sdb1
        Then issue this command to remove the volume:
        pvremove /dev/sdb1
      3. Log out of a single target:
        iscsiadm --mode node --targetname <target_name> --logout 
      4. Log out of all targets:
        iscsiadm --mode node --logout 
    • For an LVM volume, complete the following tasks on the Linux guest:
      1. Unmount the file system:
        unmount /mountdir
      2. Remove the logical volume:
        lvm lvremove LogVol00
      3. Remove the volume group:
        lvm vgremove VolGroupSnap01
      4. Log out of a single target:
        iscsiadm --mode node --targetname <target_name> --logout 
      5. Log out of all targets:
        iscsiadm --mode node --logout