[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: slow backup using lvm snapshots and tar

On 09-11-05 01:18:48, Israel Garcia wrote:
> Hi list:
> I'm using this command to create s snapshot of every LV's server,
> mount the LV, make a TGZ to a shared folder (NFS),  then umount LV
> image and remove snapshot LV. The problem is tar backup is extremely
> slow (it takes 3 hours to make backup of all servers).
> This is the command I'm using:
> for vps in `cat vps`; do lvcreate -L10G -s -n "$vps"snapshot
> /dev/vg0/"$vps".domain-disk && mount /dev/vg0/"$vps"snapshot
> /mnt/vmbackup && cd /mnt/vmbackup && nice -n 19 tar pczf
> /shared/lvbackups/"$vps"_`date +%F` . && cd ; umount /mnt/vmbackup &&
> lvremove -f /dev/vg0/"$vps"snapshot;done
> My question is:
> How can I make TAR backup faster? is it possible? Is there other
> command faster than TGZ in this case?

Lower compression levels will be faster.  Either set the GZIP 
environment variable to a lower level (than 6) or pipe tar to gzip and 
use gzips "-5" or some such option.

Possibly xz will be faster at the same compressed size.

I don't think 3 hours is slow.

You might want to actually slow the process more by adding some error 
recovery data using something like dvdisaster.  Currently an entire 
backup can be made useless by a single-bit error.

TonyN.:'                       <mailto:tonynelson@georgeanelson.com>
      '                              <http://www.georgeanelson.com/>

Reply to: