<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
  <meta content="text/html;charset=US-ASCII" http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
Stuart D. Gathman wrote:
<blockquote
 cite="midPine.LNX.4.44.0805012041160.26700-100000@bmsred.bmsi.com"
 type="cite">
  <pre wrap="">ZZZZOn Thu, 1 May 2008, Charles Marcus wrote:

  </pre>
  <blockquote type="cite">
    <pre wrap="">In Gerry's scenario here, if the snapshot volume had NOT been on a ram 
disk, would he have had the problem he had or not?
    </pre>
  </blockquote>
  <pre wrap=""><!---->
Here is the snip from Fedora/RHEL for activating the VG containing
the root filesystem (note: kernel modules and lvm command are contained in
initrd filesystem, and do not depend on /lib/modules/...):

...
echo "Loading dm-mod.ko module"
insmod /lib/dm-mod.ko
echo "Loading dm-mirror.ko module"
insmod /lib/dm-mirror.ko
echo "Loading dm-zero.ko module"
insmod /lib/dm-zero.ko
echo "Loading dm-snapshot.ko module"
insmod /lib/dm-snapshot.ko
echo Making device-mapper control node
mkdmnod
mkblkdevs
echo Scanning logical volumes
lvm vgscan --ignorelockingfailure
  </pre>
</blockquote>
So right ^^^here^^^ is where we need to test if old snapshot was
read-only or read-write (how to do that? grep vgdisplay -v for some
value?)<br>
So maybe something like this?:<br>
<br>
set removemissing flag false<br>
if old snapshot is the only PV missing:<br>
--if old snapshot was read-write:<br>
------stop boot sequence<br>
------show user some info about old snapshot<br>
------prompt whether to remove the old snapshot from the VG so it can
be activated<br>
------if response yes:<br>
----------set removemissing flag true<br>
------else <br>
----------alert user that manual action is required to correct problem
related to old snapshot before VG can be activated<br>
----------abort boot<br>
--elsif old snapshot was read-only:<br>
------set removemissing flag true<br>
if removemissing flag true:<br>
----vgreduce --removemissing VG PV(old snapshot)<br>
<br>
Gerry<br>
<br>
<blockquote
 cite="midPine.LNX.4.44.0805012041160.26700-100000@bmsred.bmsi.com"
 type="cite">
  <pre wrap="">echo Activating logical volumes
lvm vgchange -ay --ignorelockingfailure  rootvg
...

This will fail if any of the physical volumes are missing.  More logic
in initrd is required to boot with missing PVs.

So yes, a ram disk is guaranteed to be missing on reboot, and thus to 
fail in the RH/Fedora distros.  There is no problem taking snapshots
of the root fs otherwise.  If there is a robust way to reduce 
missing PVs automagically in the above script from initrd, Fedora could
use the contribution.

  </pre>
</blockquote>
<br>
</body>
</html>