0

I inadvertently created a situation where I deleted an LVM snapshot that was pending a merge (yes - bonehead move). Now I can neither finish the merge nor create a new snapshot on the original logical volume. When I try to create a snapshot I get the following:

root@ubuntu:~# lvcreate -s -n snap -L 15g /dev/sysvg/syslv
   Snapshots of an origin that has a merging snapshot is not supported

and in dmesg I see the following logs:

Nov 21 20:32:47 ubuntu kernel: [  721.210733] device-mapper: snapshots: Snapshot is marked invalid.
Nov 21 20:32:47 ubuntu kernel: [  721.211641] device-mapper: snapshots: Snapshot is invalid: can't merge
Nov 21 20:32:47 ubuntu kernel: [  721.233283] Buffer I/O error on device dm-4, logical block 16
Nov 21 20:32:47 ubuntu kernel: [  721.233289] Buffer I/O error on device dm-4, logical block 16

This is not surprising as I did an lvremove of the snapshot (oops). If I do an lvscan I get the following output:

root@ubuntu:~# lvscan
  ACTIVE            '/dev/uservg/userlv' [931.50 GiB] inherit
  inactive Original '/dev/sysvg/syslv' [152.77 GiB] inherit

And lvdisplay shows

root@ubuntu:/# lvdisplay /dev/sysvg/syslv 
  --- Logical volume ---
  LV Path                /dev/sysvg/syslv
  LV Name                syslv
  VG Name                sysvg
  LV UUID                stuff here
  LV Write Access        read/write
  LV Creation host, time hades, 2014-07-09 14:56:49 +0000
  LV snapshot status     source of
                         pre-x [INACTIVE]
  LV Status              available
  # open                 0
  LV Size                152.77 GiB
  Current LE             39108
  Segments               1
  Allocation             inherit
  Read ahead sectors     auto
  - currently set to     256
  Block device           252:3

So the snapshot status is INACTIVE and is trying to merge but I have no idea how to make LVM try to stop attempting the merge. I can mount and use the logical volume without apparent problem, but I really would like to be able to take a snapshot (which is why I wanted to use LVM in the first place!)

I think that I need to us a lower level tool like dmsetup to accomplish this but I am not sure how to use this tool and would prefer not to blow away root if possible (not the end of the world, but would prefer not too). With dmsetup I have the following info:

root@ubuntu:/# dmsetup status /dev/sysvg/syslv 
0 320372736 snapshot-merge Invalid

and

root@ubuntu:/# dmsetup info /dev/sysvg/syslv 
Name:              sysvg-syslv
State:             ACTIVE
Read Ahead:        256
Tables present:    LIVE
Open count:        0
Event number:      0
Major, minor:      252, 3
Number of targets: 1
UUID: stuff here

I have looked extensively on the intertubes and either my google kung-fu is slipping or I have reached toxic levels of caffeine (or both) and can't find much. Does anyone have any advice about how to restore LVM snapshoting for me?

System:

root@hades:~$ uname -a
Linux hades 3.13.0-39-generic #66-Ubuntu SMP Tue Oct 28 13:30:27 UTC 2014 x86_64 x86_64 x86_64 GNU/Linux

LVM info:

root@ubuntu:/# lvm version
  LVM version:     2.02.98(2) (2012-10-15)
  Library version: 1.02.77 (2012-10-15)
  Driver version:  4.27.0

TIA.

  • chooks
  • gave up and got rid of LVM altogether – Zanna Mar 7 '17 at 14:26
2

No one, including the LVM mailing list, was able to offer even a single suggestion, so I "solved" my problem with LVM by getting rid of it. I switched to btrfs when I upgraded my root hard drives.

I thought LVM was pretty stable and maybe it is, but being able to break a key feature on casual use with no one seeming to know how to fix it really turned me off to the technology. I am sure it works great for lots of people. Not sure if btrfs is much more stable, but the impression I get is the community is much more responsive and at least I don't have to screw around with installing mdadm and rescanning physical/logical volumes if I need to boot from USB.

For the record, upgrade/migration to btrfs was super smooth and I had a mirrored raid configuration up in no time. My /home was on a separate drive so once I used aptik to reload all my software everything came back up with a few very minor hiccups (e.g. needing to downgrade a package). All in all, one of the easiest migrations I have ever done.

So sorry to end it LVM. It's not you, it's me. I know that btrfs is younger and maybe sexier and there's a chance that she will go crazy and leave me with a big hole in my data at some point. But we're happy together and that's important to me. I know that you have a ton of guys wanting you out there, so I'm sure you'll bounce back. After one or two good, meaningless fsck's you'll forget we even had a thing. Au revior, ma cherie.

-1

Try

# vgscan
# vgchange -ay

The problem can occur when lvm2-monitor.service is disabled.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.