How to image and restore LVM volumes
This article applies to:
There are two different ways to image LVMs with Acronis Backup & Recovery 10: at the physical volume level and at the logical volume level. Each of these methods has their benefits and drawbacks.
Imaging at the physical volume level will create a raw sector-by-sector image of the LVM and its structure. This provides for the easiest recovery method, but has a higher requirement on the storage location for the images.
Imaging at the logical volume level will create images of only the used space of the data contained within the logical volumes, so the storage requirements for the target image location is smaller. However, the recovery process requires that the LVM structure is pre-created prior to the actual recovery of data in order to maintain LVMs post-restore.
- Imaging and restoring physical volumes
- Imaging and restoring logical volumes
- Restoring LVM volumes on prepare LVMs
Imaging and restoring physical volumes
When creating an image of a system containing LVMs at the physical volume level, the selection must be made to image the physical partition where the LVM resides and not the logical volumes:
When performing the recovery, first select the partitions to recover including the partition containing the LVM structure:
After the selection has been made, select the Change link next to the partitions and select where to restore them:
Imaging and restoring logical volumes
The recovery process for this level of backup was a little more complex in previous versions and builds of Acronis Backup & Recovery 10 software than that of a physical volume level image as prior to the recovery the LVM structure must be recreated. Because of this there has been a utility added to Acronis Backup & Recovery 10 that will capture the structure and then also assist in the recreation of the LVM structure.
Build 11639 and higher
- Create an image of logical volumes as shown on the screenshot below.
- Once booted to the recovery environment please browse for the created image and you will be prompted to restore LVM structure:
Build 11345 or lower
To take advantage of this utility, prior to creating the image run the following command:
# trueimagecmd --dumpraidinfo
(!) The dumpraidinfo parameter is available only starting from Build 11345.
When imaging at the logical volume level select only physical partitions that do not contain the LVM structure in addition to the logical volumes:
If you want to create a backup policy for backing up the logical volumes only, set the following mask: /dev/VolGroup00/LogVol00:
As stated previously, the recovery process for this level of backup requires a bit of setup prior to starting the actual recovery. Once booted to the recovery environment and the network information has been set, press the key sequence Ctrl-Alt-F2 to obtain a Linux command prompt.
If the image is located on a network share then the share must first be mounted. To mount the network share, pass the following commands:
# mkdir /tmp/mnt
# asamba mount <machine> <IP> <sharename> /tmp/mnt <username> <password>
- <machine> is the name or IP Address of the machine where the network share is;
- <IP> is the IP Address of the machine where the network share is;
- <sharename> is the name of the share;
- <username> is the name of the user (Domain/username);
- <password> is the user password.
Once the image location has been mounted, give the following command to re-create the LVM structure:
# cd /tmp/mnt/
# /bin/restoreraids.sh <path> <filename>.tib
- <path> is the path to the image file from the root of the share;
- <filename> is the name of the image file.
You can also pass the direct path to your backup file without mounting the share with the 'asamba' tool:
# /bin/restoreraids.sh smb://hostname/share_name/remote_filename
hostname may be specified with the username and password as follows:
- domain\\username:password (if the target share is in a Windows domain
(!) Please pay attention to the double backslash (\\). It must be specified to make Linux shell treat the backslash correctly.
Here is an example of how to back up to a Windows domain share:
# /bin/restoreraids.sh smb://domain\\username:password@hostname/share_name/archive.tib
After the script runs and creates the LVM structure, press Ctrl-Alt-F1 to return to the GUI. If you use an advanced edition you can just exit the GUI and start the Acronis Management Console again.
(!) If you use a standalone edition, please reboot the machine to have GUI to reload the new disk configuration.
Once the GUI has loaded then perform the recovery process selecting the newly created logical volumes for the destination for the corresponding logical volumes contained in the image:
Restoring LVM volumes on prepared LVMs
Prepare the LVM volumes
Boot from Acronis Bootable Media;
Press F11 after the Starting Acronis Loader... message appears and you get to the selection screen of the program;
After you get the Linux Kernel Settings prompt, remove the word quiet and click OK;
Select the Full version menu item to boot. Wait for # prompt to appear;
List the partitions you have on the hard disk:
This will give not only the list of partitions on the hard drive, but also the name of the device associated with the hard disk.
Start creating partitions using fdisk:
where [device] is the name of the device associated with the hard disk
Create physical volumes for LVMs:
#lvm pvcreate [partition]
for example, #lvm pvcreate /dev/sda2
Create LVM group:
#lvm vgcreate [name] [device]
where [name] is a name of the Volume Group you create; and [device] is the name of the device associated with the partition you want to add to the Volume Group
for example, #lvm vgcreate VolGroup00 /dev/sda2
Create LVM volumes inside the group:
#lvm lvcreate –L[size] -n[name] [VolumeGroup]
where [size] is the size of the Volume being created (e.g. 4G); [name] is the name of the Volume being created; [VolumeGroup] is the name of the Volume Group where we want to place the volume
For example, #lvm lvcreate -L6G -nLogVol00 VolGroup00
Activate the created LVM:
#lvm vgchange -ay
Start Acronis product:
Restore partitions from your backup archive to the created LVM volumes.