Backing up VMs to a tape drive
Posted
by
Aljoscha Vollmerhaus
on Server Fault
See other posts from Server Fault
or by Aljoscha Vollmerhaus
Published on 2012-12-10T03:55:06Z
Indexed on
2012/12/10
5:07 UTC
Read the original article
Hit count: 541
I've got myself one of these fancy tape drives, HP LTO2 with 200/400 GB cartridges. The st driver reports it like this:
scsi 1:0:0:0: Sequential-Access HP Ultrium 2-SCSI T65D
I can store and retrieve files like a charm using tar, both
tar cf /dev/st0 somedirectory
and
tar xf /dev/st0
work flawless.
However, what I really would like to backup are LVM LVs. They contain entire virtual machines with varying partition layouts, so using mount and tar is not an option.
I've tried using something like
dd if=/dev/VG/LV bs=64k of=/dev/st0
to achieve this, but there seem to be various problems associated with this approach.
Firstly, I would like to be able to store more than 1 LV on a single tape. Now I guess I could seek to concatenate the data on the tape, but I think this would not work very well in an automated scenario with many different LVs of various sizes. Secondly, I would like to store a small XML file along with the raw data that contains some information about the VM contained in the LV.
I could dump everything to a directory and tar it up - not very desirable, I would have to set aside huge amounts of scratch space.
Is there an easier way to achieve this?
Thirdly, from googling around it seems like it would be wise to use something like mbuffer when writing to the tape, to prevent what wikipedia calls "shoe-shining" the tape. However, I can't get anything useful done with mbuffer. The mbuffer man page suggests this for writing to a tape device:
mbuffer -t -m 10M -p 80 -f -o $TAPE
So I've tried this:
dd if=/dev/VG/LV | mbuffer -t -m 10M -p 80 -f -d 64k -o /dev/st0
Note the added "-d 64k" to account for the 64k block size of the tape.
However, reading data back from a tape written in this way never seems to yield any useful results - dd has been running for ages now, and managed to transfer only 361M of data from the tape.
What's wrong here?
© Server Fault or respective owner