Boston Linux & Unix (BLU) Home | Calendar | Mail Lists | List Archives | Desktop SIG | Hardware Hacking SIG
Wiki | Flickr | PicasaWeb | Video | Maps & Directions | Installfests | Keysignings
Linux Cafe | Meeting Notes | Blog | Linux Links | Bling | About BLU

BLU Discuss list archive

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

[Discuss] Backing up LVM partitions using snapshots

A while back I was talking about using LVM, on the whole it seemed like 
a productive discussion. Anyway, I started a project about a year ago, 
but shelved it. I recently dusted it off and cleaned it up a bit.

What it does is read one or more files, split them up into chunks, 
compress them, optionally encrypt them, and save them to disk. Its sort 
of a two stage compression system. The chunks are identified, 
compressed, encrypted and only unique chunks are stored. The file 
structure is saved separately from the data. Multiple files can use the 
same data repository. (Its best if the files share some common base.)

The reason why I cleaned it off was LVM. As you know, backing up a large 
volume can take a while. compressors can only compress so fast, 
duplicate data is a waste of space (especially now that disks are 
getting expensive.)

I added a mode where you can take successive snapshots of an LVM volume 
and only backup the changes between the two snapshots. So, after the 
initial backup you can then backup the changes in minutes.

lvrename /dev/lvm/mysnap /dev/lvm/mysnap.old
lvcreate -s -c 64 -L1G -nmysnap /dev/lvm/myvol
bcebackup -C /dev/mapper/lvm-mysnap-old.cow -P $PREVTIME -t $CURTIME 
lvremove /dev/lvm/mysnap.old

The time stamps are standard unix time numbers and have to be managed by 
you, but you get the idea.

If you use LVM in your shop and could use a utility like this, I'd like 
to get some independent feedback. Also, if you use zfs or btrfs and 
would like to be able to do this with their snapshot system, I'm sure it 
can be adapted.

Any guinea pigs out there? Any suggestions? criticisms?

BLU is a member of BostonUserGroups
BLU is a member of BostonUserGroups
We also thank MIT for the use of their facilities.

Valid HTML 4.01! Valid CSS!

Boston Linux & Unix /