2 basic LVM questions with RAMDISKs

David.Harding at brighthouse.co.uk David.Harding at brighthouse.co.uk
Mon Feb 7 06:03:13 CST 2011


Sunil,

No, I'm not saying that updates to the snapshot get written back to the 
original volume.
I may have mis-understood your reply to Hank "For the second point any 
change in snapshot will not go to the original  LVM it’s vice versa any 
new changes in LVM will be going to the snapshot. "
Hank's reason for using a snapshot was to backup the original LV. He was 
asking if he'd lose updates to the original LV when the snapshot was 
removed, your reply seemed to suggest that he would, where you said that 
"any new changes in LVM will be going to the snapshot".
This is not the case.
A snapshot will contain the original copies of updated extents. So, 
updates to the original LV will go to the original LV; how the affected 
extents looked before the update will go to the snapshot: Thus, when you 
backup the snapshot LV (for the purpose of backing up the original LV), 
you capture the original LV as it was when the snapshot was taken.

From the snapshotintro:
"LVM1 has read-only snapshots. Read-only snapshots work by creating an 
exception table, which is used to keep track of which blocks have been 
changed. If a block is to be changed on the origin, it is first copied to 
the snapshot, marked as copied in the exception table, and then the new 
data is written to the original volume. 
In LVM2, snapshots are read/write by default. Read/write snapshots work 
like read-only snapshots, with the additional feature that if data is 
written to the snapshot, that block is marked in the exception table as 
used, and never gets copied from the original volume."
(my underlining).
The answer to Hank's question is no, he will NOT lose updates when he 
removes the snapshot, as the updates go to the original LV.
My apologies if I've mis-understood your reply.

Cheers,
dave








<Sunil_Gupta2 at dell.com> 
Sent by: <linux-poweredge-bounces at dell.com>
07/02/2011 11:04

To
<David.Harding at brighthouse.co.uk>
cc
<linux-poweredge-bounces at lists.us.dell.com>, 
<linux-poweredge at lists.us.dell.com>
Subject
RE: 2 basic LVM questions with RAMDISKs






Hello Dave,
 
>>What Sunil describes, though, is the way VMWare does its Snapshots, but 
not LVM. 
 
Are you trying to say that a change in snapshot will be reflected in 
original lvm?
 
http://tldp.org/HOWTO/LVM-HOWTO/snapshotintro.html
 
http://docs.redhat.com/docs/en-US/Red_Hat_Enterprise_Linux/5/html-single/Logical_Volume_Manager_Administration/index.html#snapshot_volumes
 
I have never worked on vmware snapshots though.
 
Thanks,
Sunil
 
From: David.Harding at brighthouse.co.uk 
[mailto:David.Harding at brighthouse.co.uk] 
Sent: Monday, February 07, 2011 2:51 PM
To: Gupta2, Sunil
Cc: heskin at gmail.com; linux-poweredge-Lists; linux-poweredge-bounces-Lists
Subject: RE: 2 basic LVM questions with RAMDISKs
 

Sunil, Hank, 

I, also, cannot answer the question on the pvcreate error, and agree with 
Sunil that a full posting of the commands and error would be useful. 

However, I think I disagree with Sunil on the Snapshot question. 
Is not the whole purpose of a snapshot to capture a point-in-time copy of 
existing disk? Therefore, what is captured in the snapshot is the original 
copy of an extent before it is updated, yes? This is what allows you to 
use the snapshot for a backup, and why you can simply "drop" a snapshot 
LV. 
If it were that updates were written to the snapshot, you'd have to backup 
the original LV for your point-in-time backup, and you'd not be able to 
"drop" the snapshot without a complicated process to update the original 
LV from the snapshot (ie. apply all the updates). 
COW = Copy On Write; in this case, it is the Copy of the original extent 
to the snapshot before it is Written to in the original LV. 

What Sunil describes, though, is the way VMWare does its Snapshots, but 
not LVM. 

Cheers, 
dave 


<Sunil_Gupta2 at dell.com> 
Sent by: <linux-poweredge-bounces at dell.com> 
07/02/2011 07:23 


To
<heskin at gmail.com>, <linux-poweredge at lists.us.dell.com> 
cc

Subject
RE: 2 basic LVM questions with RAMDISKs
 








Hello Hank, 
  
I am not sure about the error on creation part it would be better if you 
paste the verbose output. For the second point any change in snapshot will 
not go to the original  LVM it’s vice versa any new changes in LVM will be 
going to the snapshot. 
  
Snapshots work on COW. 
  
Thanks, 
--Sunil 
  
From: linux-poweredge-bounces-Lists On Behalf Of Hank
Sent: Sunday, February 06, 2011 1:21 AM
To: linux-poweredge-Lists
Subject: 2 basic LVM questions with RAMDISKs 
 
Hello all, 
 
I have a PE2650 running CentOS 3 with an LVM  VG full with one LV.    I 
wanted to create a snapshot to backup this LV, but then realized that the 
VG has no free space (the LV takes up all that VG space). 
 
 I found this page that talks about extending the VG with a ramdisk in 
order to provide some free space for the snapshot.  : 
  
http://linuxsoftware.co.nz/blog/2008/03/11/lvm-snapshot-with-no-free-diskspace 

 
Two questions: 
 
1. When I try to use the "pvcreate /dev/ram1" command, I get an error: 
"pvcreate -- invalid physical volume "/dev/ram0" which I have no idea how 
to resolve (yes, a listing of /dev/ lists 20 ramdisks ram0 through ram19) 
 
2.  I just want to confirm that when the snapshot is created using the 
freespace of the ramdisk, that any changed LV snapshot blocks are written 
to the ramdisk and that the current (new) data is written to the original 
part of the LV.... so when I'm done with the snapshot and "vgreduce" the 
VG to remove the ramdisk, that the current (i.e. changed) blocks are not 
removed with it. 
 
Or if anyone has any other suggestions on how to create a short-term 
snapshot of a LV in a full VG, that also would be most helpful. 
 
Thanks, 
 
-Hank_______________________________________________
Linux-PowerEdge mailing list
Linux-PowerEdge at dell.com
https://lists.us.dell.com/mailman/listinfo/linux-poweredge
Please read the FAQ at http://lists.us.dell.com/faq 

-------------------------------------------------------------------------------------------
Caversham Finance Limited, registered in England No 0785922 Registered 
office:
Hercules Way, Leavesden Park, Watford WD25 7GS 
Caversham Trading Limited, registered in England No 05396147 Registered 
office:
Hercules Way, Leavesden Park, Watford WD25 7GS 
BrightHouse Limited, registered in England No 06073794 Registered office:
Hercules Way, Leavesden Park, Watford WD25 7GS 
_______________________________________________
Linux-PowerEdge mailing list
Linux-PowerEdge at dell.com
https://lists.us.dell.com/mailman/listinfo/linux-poweredge
Please read the FAQ at http://lists.us.dell.com/faq

<td class='Content'>
<br>
-------------------------------------------------------------------------------------------<br>
Caversham Finance Limited, registered in England No 0785922 Registered office:<br> 5 Hercules Way, Leavesden Park, Watford WD25 7GS
<br>
Caversham Trading Limited, registered in England No 05396147 Registered office:<br> 5 Hercules Way, Leavesden Park, Watford WD25 7GS
<br>
BrightHouse Limited, registered in England No 06073794 Registered office:<br> 5 Hercules Way, Leavesden Park, Watford WD25 7GS
</td>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.us.dell.com/pipermail/linux-poweredge/attachments/20110207/dcfe0e8b/attachment-0001.htm 


More information about the Linux-PowerEdge mailing list