File Level Restore in a Linux Environment 34 IBM Confidential File Level Restore in a Linux Environment File level restores using an TSM for VE image backup of a Linux server require the use of a Windows server running the Recovery Agent GUI as well as a Linux server running iSCSI. In a Linux environment care must be taken to determine if the snapshot volume is an LVM volume. The following recovery procedure starts identically for LVM and Non-LVM volumes. It then splits into a section for each type. 35 IBM Confidential File Level Restore in a Linux Environment On the Linux target server, determine the iSCSI initiator name. This can be found in /etc/iscsi/initiatorname.iscsi. Highlight the initiator name to copy it. 36 IBM Confidential File Level Restore in a Linux Environment On a Windows server running the Data Protection for VMware Recovery Agent, start the agent GUI. 37 IBM Confidential File Level Restore in a Linux Environment The first step is to select the type of TSM storage pool where the backup images reside. Click Settings 38 IBM Confidential File Level Restore in a Linux Environment From the Storage type pulldown select the type of TSM storage pool where the backup resides. 39 IBM Confidential File Level Restore in a Linux Environment Connect to the correct TSM server by selecting ‘New Tivoli Storage Manager server’ from the pull-down. 40 IBM Confidential File Level Restore in a Linux Environment Fill in the TSM server address and update the server port if necessary. Select the desired Node access method: Asnodename - requires you to know the TSM node password for the Datamover node. Fromnode - is generally used when access is limited to specific VMs. Direct - requires you to know the TSM node password for the Datacenter node. The Authentication area will change based on the Node access method that is chosen. This example uses Asnodename access. Enter the name of the datamover node name in the Authentiction node field. Enter the TSM node password for the datamover node in the Password field. Target Node is the datacenter node name. 41 IBM Confidential File Level Restore in a Linux Environment After the recovery agent authenticates, the Virtual machine pull-down becomes available. 42 IBM Confidential File Level Restore in a Linux Environment From the pull-down, select the virtual machine from which you want to restore a file. In this example the virtual machine name is CentOS-GUI. 43 IBM Confidential File Level Restore in a Linux Environment Once the Virtual machine is selected, the Snapshot pull-down becomes available. Select the snapshot from which you wish to restore the desired file. 44 IBM Confidential File Level Restore in a Linux Environment Once the Snapshot date is selected, the Disk pull-down becomes available. Select the disk where the desired file resided. 45 IBM Confidential File Level Restore in a Linux Environment When the selections have been completed, click the Mount button. 46 IBM Confidential File Level Restore in a Linux Environment Note the default selection is to mount the volume to the Windows server. Free drivers are available for Windows to allow reading of EXT2, EXT3, and EXT4 filesystems, however this document will not cover that option. 47 IBM Confidential File Level Restore in a Linux Environment Select the “Mount as an iSCSI target” option. Type in a name for the iSCSI target and paste in the Initiator name that you copied from the Linux initiatorname.iscsi file. Click OK. 48 IBM Confidential File Level Restore in a Linux Environment When the mount of the volume as an iSCSI target is complete the volume will appear in the Mounted Volumes window. 49 IBM Confidential File Level Restore in a Linux Environment On the Linux server, use the iscsiadm command to verify iSCSI target is exposed. Type the command: iscsiadm –m discovery –t sendtargets –p <address of server running the recovery agent> The command should return a line in the form of: <IP Address>:3260,1 <name of iSCSI target you entered in recovery agent> In this example, the address of the server running the recovery agent is 192.168.2.178. The target name entered for the mount was tsmvesnap. 50 IBM Confidential File Level Restore in a Linux Environment Issue the command ‘fdisk –l’ to display the current disk devices. The current devices in this example are /dev/sda1, /dev/sda2, and /dev/sdb1. Note the current devices as the next command will add the image backup snapshot as an additional device. 51 IBM Confidential File Level Restore in a Linux Environment Reissue the iscsiadm command, this time appending the ‘--login’ parameter. Verify that a successful login has occurred. iscsiadm –m discovery –t sendtargets –p <address of server running the recovery agent> --login 52 IBM Confidential File Level Restore in a Linux Environment Issue the ‘fdisk –l’ command again and note the additional device(s). In this example device /dev/sdc1 has been added. This is the image backup volume. Also note that this is not an LVM volume. This is indicated by the Id type of 83 and the System name of “Linux”. An LVM volume will have an Id type of 8e and a System name of “Linux LVM”. To restore an LVM volume, proceed to the section “Linux Restore Procedure for an LVM Volume”. 53 IBM Confidential File Level Restore in a Linux Environment Linux Restore Procedure for a Non-LVM Volume 54 IBM Confidential File Level Restore in a Linux Environment (Non-LVM Volume) A Non LVM volume can be mounted directly to a mount point. Create a mount point at the root level: mkdir /tsmvesnap Mount the volume using the new device name: mount /dev/sdc1 /tsmvesnap Change directory to the mount point to see the backup files. Copy the required files to the desired location. Use the --preserve=all option on the copy command to preserve file permissions. 55 IBM Confidential File Level Restore in a Linux Environment (Non-LVM Volume) When you have completed recovering the required files complete the following commands to disconnect the backup snapshot: 1) Unmount the filesystem: umount /tsmvesnap 2) End the iSCSI session: iscsiadm --mode node --logout 3) Verify that the session has ended: iscsiadm –m session 56 IBM Confidential File Level Restore in a Linux Environment (Non-LVM Volume) Return to the Recovery agent, highlight the volume and click dismount or click dismount all. 57 IBM Confidential File Level Restore in a Linux Environment Linux Restore Procedure for an LVM Volume 58 IBM Confidential File Level Restore in a Linux Environment (LVM Volume) In this example, the data to be restored resides on an LVM volume, indicated by the Id of “8e” and System of “Linux LVM”. The device name is /dev/sdc2. 59 IBM Confidential File Level Restore in a Linux Environment (LVM Volume) Special considerations must be taken for an LVM volume. In order to prevent introducing duplicate physical and logical volume ids, you must use the vgimportclone command to modify the snapshot disk. Issue the command in the following format: vgimportclone --basevgname /dev/vg-tsmvesnap <device name> Example: vgimportclone --basevgname /dev/vg-tsmvesnap /dev/sdc2 60 IBM Confidential File Level Restore in a Linux Environment (LVM Volume) Issue the command “lvm pvscan” to verify that the volume was imported under the new volume group name. In this example we see device /dev/sdc2 with volume group name vg-tsmvesnap. 61 IBM Confidential File Level Restore in a Linux Environment (LVM Volume) Issue the command “lvm lvs” to determine the logical volume names within the volume groups. In this example the logical volume name we want is lv_root. Issue the command “lvm lvchange ….” to mark the logical volume as active”. Example: lvm lvchange –a y /dev/vg-tsmvesnap/lv_root 62 IBM Confidential File Level Restore in a Linux Environment (LVM Volume) Create a directory for the mount point: mkdir /tsmvesnap Mount the volume. To determine the volume name, change directory to /dev/mapper and issue the “ls” command. In this example we see “vg--tsmvesnap-lv_root”. In this example we mount the volume to the mount point /tsmvesnap. The filesystem type is ext4. mount /dev/mapper/vg--tsmvesnap-lv_root /tsmvesnap –t ext4 63 IBM Confidential File Level Restore in a Linux Environment (LVM Volume) The files from the backup snapshot can now be accessed from the new mount point. Copy the required files to the desired location. Use the --preserve=all option on the copy command to preserve file permissions. 64 IBM Confidential File Level Restore in a Linux Environment (LVM Volume) When you have completed recovering the required files, unmount the filesystem: umount /tsmvesnap Remove the logical volume: lvm lvremove vg-tsmvesnap Remove the volume group: lvm vgremove vg-tsmvesnap 65 IBM Confidential File Level Restore in a Linux Environment (LVM Volume) Disconnect the iSCSI target: iscsiadm --mode node --logoutall=all or: iscsiadm --mode node --logout This command will disconnect all targets. If you want to disconnect from a specific target, add the –targetname <targetname> parameter to the command. 66 IBM Confidential File Level Restore in a Linux Environment (LVM Volume) Return to the Recovery agent, highlight the volume and click dismount or click dismount all. 67 IBM Confidential