Comment 12 for bug 38409

Reinhard Tartler (siretart) wrote :

Often, lvm snapshots are created sucessfully:

root@hades:~ # lvcreate -s -n sid_snap /dev/hades_stripe/chroot_sid -L2g -v
    Setting chunksize to 16 sectors.
    Finding volume group "hades_stripe"
    Archiving volume group "hades_stripe" metadata (seqno 200).
    Creating logical volume sid_snap
    Creating volume group backup "/etc/lvm/backup/hades_stripe" (seqno 201).
    Found volume group "hades_stripe"
    Loading hades_stripe-sid_snap
    Zeroing start of logical volume "sid_snap"
    Found volume group "hades_stripe"
    Removing hades_stripe-sid_snap
    Found volume group "hades_stripe"
    Found volume group "hades_stripe"
    Found volume group "hades_stripe"
    Loading hades_stripe-chroot_sid-real
    Loading hades_stripe-sid_snap-cow
    Loading hades_stripe-sid_snap
    Loading hades_stripe-chroot_sid
    Creating volume group backup "/etc/lvm/backup/hades_stripe" (seqno 202).
  Logical volume "sid_snap" created

Sometimes, however (approx 30% of the time), it fails like this:
root@hades:~ # lvcreate -s -n sid_snap /dev/hades_stripe/chroot_sid -L2g -v
    Setting chunksize to 16 sectors.
    Finding volume group "hades_stripe"
    Archiving volume group "hades_stripe" metadata (seqno 203).
    Creating logical volume sid_snap
    Creating volume group backup "/etc/lvm/backup/hades_stripe" (seqno 204).
    Found volume group "hades_stripe"
    Loading hades_stripe-sid_snap
    Zeroing start of logical volume "sid_snap"
    Found volume group "hades_stripe"
  LV hades_stripe/sid_snap in use: not removing
  Couldn't deactivate new snapshot.

It is there, and I need to remove it before recreating it for use:
root@hades:~ # lvremove /dev/hades_stripe/sid_snap -f
  Logical volume "sid_snap" successfully removed

then I retry it and often, it succeeds.

This behaviour completly confuses schroot, which provides chroots on lvm snapshots.

This happens on my dapper/amd64 machine. I wonder why it doesn't on my x86 laptop. Perhaps this is arch dependant?