[linux-lvm] LVM2 lockup while snapshotting root
hopper at omnifarious.org
Tue Oct 12 19:58:53 UTC 2004
I tried to snapshot LVM2 the root partition and (probably not to the
surprise of most of you) hung my system. In thinking about this
problem, I think there is a solution. I do not know precisely what
causes the problem, but it can only be one of two things.
First, it could be updates to /etc/lvm while the filesystem is
suspended. This shouldn't be done at all. First, a journal of what the
planned change is should be written to /etc/lvm, the filesystem
suspended, the change made, the filesystem unsuspended, then a marker
indicating that the change succeeded to /etc/lvm.
Second, it could be the fact that the LVM executable is demand paged.
It could be that a page of the executable is read in while the
filesystem is suspended. This is trickier to solve, and having the
problem is much more excusable than the first.
The second problem can be solved by creating a temporary ramdisk,
mounting it off of /tmp, copying lvm.static there, then forking and
execing that lvm.static to do what the person asked. When it finishes,
the original wakes back up to the new snapshotted reality (it was
sitting in a 'waitpid' call the whole time) and removes the ramdisk.
I may implement this (perhaps using a wrapper perl script), as I would
like to be able to snapshot my root filesystem. If anybody knows that
I'm wrong about something, please tell me before I start.
"It does me no injury for my neighbor to say there are twenty gods or no God.
It neither picks my pocket nor breaks my leg." --- Thomas Jefferson
"Go to Heaven for the climate, Hell for the company." -- Mark Twain
-- Eric Hopper (hopper at omnifarious.org http://www.omnifarious.org/~hopper) --
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Size: 189 bytes
Desc: not available
More information about the linux-lvm