Skip to contentSkip to conversation

retry:snapshots: COW drive capacity and monitoring space usage

DISCUSSION J. Hart 2 participants 2 messages Oct 8, 2009 Device mapper

lore
Share & tools
lore

J. Hart

author
#0 lore raw

Greetings All,

I didn't see anything come back, so I'm giving it one last try. I apologize if this is a duplicate.

After having built my own distro up from source code (just to see if I could), I've got snapshotting set up successfully on my system using the kernel device mapping facility, dmsetup, and a COW drive. I understand from my reading that it is possible for the COW drive to run out of space while it is in use. Since it is not mounted and does not use a filesystem as far as I know, I am wondering how one might go about deciding on how big a drive to use, and monitoring space usage. Any information on this would be most appreciated.

J. Hart

#1 lore raw
Quoted 5 lines · J. Hart

Greetings All,

I didn't see anything come back, so I'm giving it one last try. I apologize if this is a duplicate.

Quoted 7 lines

After having built my own distro up from source code (just to see if I could), I've got snapshotting set up successfully on my system using the kernel device mapping facility, dmsetup, and a COW drive. I understand from my reading that it is possible for the COW drive to run out of space while it is in use. Since it is not mounted and does not use a filesystem as far as I know, I am wondering how one might go about deciding on how big a drive to use, and monitoring space usage.

You need to size your snapshot proportional to the rate of change you expect during the life of the snapshot. This change can happen to either the origin device or directly to the snapshot device. Regardless of which one; if you expect excessive change you want to size the snapshot larger, or vice-versa if you expect little change.

As for monitoring, LVM2 provides dmeventd-based snapshot usage monitoring that is enabled by default as of LVM2 2.02.53.

When you're low on space you'll see messages like the following in /var/log/messages:

Sep 16 21:15:05 really-raw dmeventd[12522]: dmeventd ready for processing.
Sep 16 21:15:11 really-raw lvm[12522]: Monitoring snapshot test-testlv_snap
Sep 16 21:15:15 really-raw lvm[12522]: Snapshot test-testlv_snap is now 92% full.

Mike