creating a LUKS snapshot hangs the system

Bug #615911 reported by Darik Horn
12
This bug affects 2 people
Affects Status Importance Assigned to Milestone
lvm2 (Ubuntu)
Fix Released
Undecided
Unassigned

Bug Description

Binary package hint: lvm2

LVM cannot create a snapshot of a LUKS encrypted volume.

To reproduce:

  1. Install Ubuntu 10.04 Lucid Lynx to a LUKS root using the alternate installer.
  2. Run: lvcreate --snapshot /dev/vg00/root --size 2G --name backup --verbose

This hangs the system. Verbose lvcreate messages are normal. The last line printed is:

  Suspending vg00-root (252:1) with filesystem sync with device flush

The console error is:

  [360:540149] INFO: task flush-252:1:486 blocked for more than 120 seconds.
  [360:609736] INFO: task lvcreate:1320 blocked for more than 120 seconds.

These console messages periodically repeat, but lvcreate never returns and the system becomes unresponsive and requires a hard reset.

The snapshot volume is created and is visible after boot, but it seems to be corrupt:

  # mount /dev/vg00/backup /mnt
  mount: unknown filesystem type 'DM_snapshot_cow'

Revision history for this message
Darik Horn (dajhorn) wrote :
Revision history for this message
Darik Horn (dajhorn) wrote :

I tested a similar storage configuration on an external disk connected to the same computer; doing an LVM snapshot inside LUKS behaves correctly on an external disk.

Thus, this LVM glitch is probably limited to taking a snapshot of a root filesystem that is in LUKS.

Also note that nothing is being logged into the syslog or dmesg. The hang instantly stops all IO to the root filesystem.

Revision history for this message
Chris Demetriou (cgd) wrote :

Is your root partition an ext4 fs?

This sounds very similar to bug 595489.

(My guess is that once the flush task hangs, write accesses to the file system will eventually become ... very unhappy, but I'm no expert. I've only experienced this on a non-root FS.)

Revision history for this message
Darik Horn (dajhorn) wrote :

Chris, you're correct, this bug is a duplicate of bug 595489.

The kernel security update that was published today includes the fix-ext4.patch by Phillip Susi, which is a solution for this problem.

Changed in lvm2 (Ubuntu):
status: New → Fix Released
Revision history for this message
Peter Passchier (peter-passchier) wrote :

It's not strictly a duplicate, because it pertains to different versions of the kernel.

BTW, I have this on Lucid 10.04.4 fully updated as of 2013-01-01 with kernel:
2.6.32-45-pae-latest
2.6.35-32.28-pae

Which kernel should I use if I want to make an lvm2 snapshot of an ext4 root? Would I avoid this bug if I mount the root filesystem as ext3 instead??

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.