My understanding of LVM snapshots is that: when a block changes on the origin, the block is first copied (prior to the change) to the snapshot. The block is then changed on the origin as it would normally.
Theoretically, then, when a snapshot is first created, it should contain nothing. then as changes happen on the origin, these blocks start to fill up the snapshot.
However, if for testing purposes I create a small 1G LV, and I put a couple files on it; then I create a 200MB snapshot. As expected, lvs shows LSize of 200M for snap and 1G for origin. But when I mount the snapshot volume, df shows it with a size of 1G. When I examine its contents, I find it contains everything in the origin volume, even though the original files have not been changed.
Why is this? I'm assuming the "mount" command has some logic in it to do a comparison between the origin LV and the snapshot LV? Can someone explain how this works. If I look at the inode numbers for a file on each volume (origin and snap), they are different (as expected because each is its own unique filesystem), but I'm assuming there are some kind of "pointers" that the snapshot uses to reference unchanged blocks on the origin.
along this same vein, I assume that if I copy the snapshot logical volume itself to another location, I will get a subset of the origin's files - only those that have changed. ... But if I first mount the snapshot filesystem, and then do a fileystem-level copy (cp) I'll get everything on the origin as it was when the snapshot was created. Right?