How to Backup Logical Volume Remotely using Samba Mounting Folder

Posted on

This is an article showing an alternative way on doing the backup process of a logical volume partition remotely. If there is a certain need on moving the virtual disk which is stored in form of logical volume from a server to another logical volume exist in another server. For an example, the process initiated is to mirror or to copy the logical volume into the  form of raw file format which is quite handy and convenient since it can be converted later on to another format such as qcow2 which is a virtual server image format supported by QEMU (Quick Emulator). It is obvious since qcow2 itself is an abbreviation of qemu copy on write version 2. But since the format which is used to backup, copy or mirror the logical volume is a raw file format, the size of the file will be similar with the size of the logical volume mirrored.

Usually  Virtual Server have its own virtual disk which one of it can be in form of logical volume disk partition on a Linux server. When that Linux server’s physical hard drive or storage is exhausted, it need to be replaced or upgraded, so in order for the already running Virtual Server can keep on running, it need to be relocated.

How to Backup Logical Volume Remotely
How to Backup Logical Volume Remotely

As it can be seen in the above image, there is an instance of Virtual Machine or Virtual Server running using virtual disk which is located or stored in form of a logical volume. In the above image, the logical volume which is a virtual disk exist in the storage server. The storage server itself contains logical volumes because it has been configured using LVM (Logical Volume Management) and the LVM which is currently used right now is LVM2 or LVM version 2 which acts as an extended version of LVM.

The method for backing up and mirroring the Logical Volume available into a raw file format is by using ‘dd’ command which is shown in the following command :

dd if=logical-volume-path of=/raw-file-path.raw bs=1M

Below is an example of executing the above command :

[root@hostname mnt]# dd if=/dev/fc_vms/devel-server of=/mnt/devel-server.raw bs=1M
307200+0 records in
307200+0 records out
322122547200 bytes (322 GB) copied, 2869,14 s, 112 MB/s
[root@hostname mnt]#

As shown in the above output generated from executing the command. There is a generated raw file image of logical volume named devel-server.raw which has the size of 322 GB. The logical volume mirrored in the above output example named ‘devel-server’.

But in the above context where is the remote part ?. Well, the process  is executed locally but using a resource which is available remotely because /mnt is actually mounted to another folder and file shared in another server provided by samba service.

2 thoughts on “How to Backup Logical Volume Remotely using Samba Mounting Folder

Leave a Reply