[linux-lvm] Restore LVM snapshot without creating a full dumpto an "external" device?

Lars Ellenberg linux-lvm at linbit.com
Mon Mar 10 16:32:00 UTC 2008


On Mon, Mar 10, 2008 at 10:43:18AM -0000, Karl Wagner wrote:
> That is almost exactly what I was after.
> 
> Just one thing though... If I was to just take a backup of the COW
> device, assuming the underlying origin had not changed, would I just be
> able to restore this? (i.e. gzip < /path/to/cowdevice >
> /path/to/backupfile.gz and restore with zcat /path/to/backup/file.gz >
> /path/to/cowdevice, or similar.) Would this work with a newly created
> snapshot? (ie backup as above then lvcreate -s -n newsnapshot
> /path/to/origin; zcat /path/to/backup/file.gz > /path/to/new/cow/device)
> 
> I will just emphasize that the UNDERLYING ORIGIN WILL NEVER CHANGE, it
> is never mounted, never used for anything except as a snapshot origin.

won't work "just so."
just because you are messing with the storage does not mean the
in-kernel exception tables would be updated magically.

I mean, the equivalent is to dd back a file system image backup
below a mounted file system...

it may be possible to
lvcreate -s -n newsnapshot /path/to/origin
dmsetup table $that-new-snapshot
remember it.
dmsetup remove snapshot.
zcat image.gz > snapshot-cow
sync!!! maybe rather zcat | dd oflag=sync

dmsetup create snapshot with identical table again.

that in theory should make it read the
(just restored from backup) exeption table from storage again.

but I never tried.
and I think it is scary :-)

-- 
: Lars Ellenberg                           http://www.linbit.com :
: DRBD/HA support and consulting             sales at linbit.com :
: LINBIT Information Technologies GmbH      Tel +43-1-8178292-0  :
: Vivenotgasse 48, A-1120 Vienna/Europe     Fax +43-1-8178292-82 :




More information about the linux-lvm mailing list