linux-lvm.redhat.com archive mirror
 help / color / mirror / Atom feed
* RE: [linux-lvm] Restore LVM snapshot without creating a full dumpto an "external" device?
@ 2008-03-10 10:43 Karl Wagner
  2008-03-10 16:32 ` Lars Ellenberg
  0 siblings, 1 reply; 2+ messages in thread
From: Karl Wagner @ 2008-03-10 10:43 UTC (permalink / raw)
  To: LVM general discussion and development

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.

-----Original Message-----
From: linux-lvm-bounces@redhat.com [mailto:linux-lvm-bounces@redhat.com]
On Behalf Of Bas van Schaik
Sent: 10 March 2008 09:59
To: LVM general discussion and development
Subject: Re: [linux-lvm] Restore LVM snapshot without creating a full
dumpto an "external" device?

Lars Ellenberg wrote:
> On Sun, Mar 09, 2008 at 11:05:45PM +0100, Bas van Schaik wrote:
>   
>> Hi all,
>>
>> When I started to use LVM snapshots, I presumed that it was easy to
>> restore a system to such a snapshot. As far as I can see now, this
>> presumption was incorrect... People on the internet write that I
should
>> dump the whole snapshot using dd and then write it over the original
>> volume. This actually implies that I need another device with at
least
>> the size of the original volume available to dump to. In my
situation,
>> this means that I need about 2 TB free space to recover this
snapshot!
>>
>> Isn't there a more sophisticated way to restore the snapshot than
just
>> dumping it?
>>  1) create snapshot of /dev/myvolumegroup/myvolume to
>> /dev/myvolumegroup/mysnapshot
>>  2) dd if=/dev/myvolumegroup/mysnapshot of=/tmp/mysnapshot.dd
>>  3) lvremove /dev/myvolumegroup/mysnapshot
>>  4) dd if=/tmp/mysnapshot.dd of=/dev/myvolumegroup/myvolume
>>     
>
> you got (size-of-your-volume) free space in /tmp?
> pretty large /tmp, or pretty small volume, I guess.
>
>   
>> Something like:
>>  1) lvrevert /dev/myvolumegroup/mysnapshot
/dev/myvolumegroup/myvolume
>>
>> I'd like to hear your thoughts on this, because I think it should be
>> fairly easy to restore a COW snapshot. Or am I wrong and missing
something?
>>     
>
> you may want to investigate the status of
> http://fedoraproject.org/wiki/StatelessLinux/CachedClient
> were it says "The LVM and device-mapper code to allow merging is
> awaiting upstream review."
>   
Interesting project, interesting information, but it was last updated
2007-10-19. I'll try Googling for a more recent status, if that is
available...

> or you can try, at your own risk, the hack below.
>
> (... lots of excellent details ...)
Sounds very plausible, but there are some risks involved here ;). Thanks
anyhow, I'll really consider using your perl script when the situation
gets critical here...

  -- Bas

_______________________________________________
linux-lvm mailing list
linux-lvm@redhat.com
https://www.redhat.com/mailman/listinfo/linux-lvm
read the LVM HOW-TO at http://tldp.org/HOWTO/LVM-HOWTO/


 This has been checked by www.blackspider.com 


_________________________________________________________

Zetex Semiconductors - Solutions for an analog world.

http://www.zetex.com
http://www.zetex.cn

E-MAILS are susceptible to interference.  You should not assume that
the contents originated from the sender or the Zetex Group or that they 
have been accurately reproduced from their original form.
Zetex accepts no responsibility for information, errors or omissions in
this e-mail nor for its use or misuse nor for any act committed or
omitted in connection with this communication.
If in doubt, please verify the authenticity with the sender.
_________________________________________________________

 

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [linux-lvm] Restore LVM snapshot without creating a full dumpto an "external" device?
  2008-03-10 10:43 [linux-lvm] Restore LVM snapshot without creating a full dumpto an "external" device? Karl Wagner
@ 2008-03-10 16:32 ` Lars Ellenberg
  0 siblings, 0 replies; 2+ messages in thread
From: Lars Ellenberg @ 2008-03-10 16:32 UTC (permalink / raw)
  To: linux-lvm

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 :

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2008-03-10 16:32 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-03-10 10:43 [linux-lvm] Restore LVM snapshot without creating a full dumpto an "external" device? Karl Wagner
2008-03-10 16:32 ` Lars Ellenberg

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).