lvm snapshot failed

Bug #122867 reported by Luc Paulin
4
Affects Status Importance Assigned to Milestone
lvm2 (Ubuntu)
New
Undecided
Unassigned

Bug Description

Most of the time I try to take a snapshot it failed with the following error message:

lpaulin@datastorb:~$ sudo lvcreate -L50G -s -n snap1 /dev/vg1/rsnapshot -v
File descriptor 5 left open
    Setting chunksize to 16 sectors.
    Finding volume group "vg1"
    Archiving volume group "vg1" metadata (seqno 34).
    Creating logical volume snap1
    Creating volume group backup "/etc/lvm/backup/vg1" (seqno 35).
    Found volume group "vg1"
    Creating vg1-snap1
    Loading vg1-snap1 table
    Resuming vg1-snap1 (254:2)
    Clearing start of logical volume "snap1"
    Found volume group "vg1"
  LV vg1/snap1 in use: not deactivating
  Couldn't deactivate new snapshot.

System is running feisty with kernel 2.6.20-16-generic
Problem seem to be related to https://bugs.launchpad.net/debian/+bug/38409

Revision history for this message
rfried (rfried) wrote :

Hello,

same thing here.

Environment Ubuntu 7.04:
----------------------------------
Linux titan 2.6.20-16-generic #2 SMP Thu Jun 7 20:19:32 UTC 2007 i686 GNU/Linux
ii dmsetup 1.02.08-1ubuntu10 The Linux Kernel Device Mapper userspace library
ii libdevmapper1.02 1.02.08-1ubuntu10 The Linux Kernel Device Mapper userspace library
ii libvolume-id0 108-0ubuntu4 volume identification library
ii lvm2 2.02.06-2ubuntu9 The Linux Logical Volume Manager
ii mdadm 2.5.6-7ubuntu5 tool to administer Linux MD arrays (software RAID)
ii udev 108-0ubuntu4 rule-based device node and kernel event manager
ii volumeid 108-0ubuntu4 volume identification tool

Example:
+ lvcreate -A n -s -n opt_0.backup -L 1G /dev/vgsys/opt
  LV vgsys/opt_0.backup in use: not deactivating
  Couldn't deactivate new snapshot.
+ sleep 1
+ lvremove -A n -f /dev/vgsys/opt_0.backup
+ lvcreate -A n -s -n opt_0.backup -L 1G /dev/vgsys/opt
=> one second after first lvcreate failed it worked fine

I had same problem with openSuSE 10.1 very often
(see https://bugzilla.novell.com/show_bug.cgi?id=178321),
with Ubuntu it's less often but from time to it also happens.

So I use this workaround in my backup script:
        i=$VGRETRYC
        sleepint=0
        while ! lvcreate -A n -s -n "$snapname" -L 1G "$VGBASE/$lvname"; do
                sleep $((sleepint=sleepint+1))
                lvremove -A n -f "$VGBASE/$snapname"
                let i-- || break
        done
        test $i -lt 0 && return 1

Kind regards,
Roland

Revision history for this message
Rico Sennrich (rico-sennrich) wrote :

Thank you for taking the time to report this bug and helping to make Ubuntu better. I'm marking this as a duplicate of bug #105936. Please look at the other bug report to see if there is any missing information that you can provide, or to see if there is a workaround for the bug. Additionally any further discussion regarding the bug should occur in the other report. Feel free to continue to report any other bugs you may find.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.