Skip to contentSkip to conversation

more vg problems or oddities...not using dmsetup remove seems to be bad?

linux-lvm Linda A. Walsh 3 participants 8 messages Sep 12, 2011

lore
Share & tools
lore
#0 lore raw

tried to remove an unmounted active snapshot.

lvremove said it wouldn't remove an active snapshot.

Tried -an -- can't change active snapshot.

Tried turning off monitoring --monitor -n
It gave no message
tried removing again...can't remove active snap

tried --ignoremonitoring

no message but still can't remove

tried -- merging it...

Said it couldn't merge with open origin,
then merging with origin on next activation...

Now still can't remove, but says "
Can't remove merging snapshot logical volume "Home-2011.09.03-00.28.36"
...

decided to try dmsetup remove --

it couldn't remove it either -- resource/device busy...

So now I'm concerned...is it going to try to merge back any changes it recorded by reversing them?

i.e. put the original volume back the way it was when the snapshot started?

Says it couldn't do it on open volume -- does that mean it won't start this until I reboot, then it will take a long time to become active?

seems like the dmsetup remove of the parts was the safest way to kill off an active snapshot...but this feels contorted.

I'm wondering if I really want this 'merge' it wants to do...and if not, how do I abort it?

Thanks!

(hoping system stays up until I get this sorted out!)...

#1 lore raw
Quoted 5 lines · Linda A. Walsh

tried to remove an unmounted active snapshot.

lvremove said it wouldn't remove an active snapshot.

Tried -an -- can't change active snapshot.

This is an annoying bug (IMHO). Use lvremove -f (making sure it really isn't open).

Quoted 9 lines

Tried turning off monitoring --monitor -n
It gave no message
tried removing again...can't remove active snap

tried --ignoremonitoring

no message but still can't remove

tried -- merging it...

Ooops. You likely did not want that. That reverts the origin volume to the snapshot by copying the original data for updated sectors from the snapshot. This is an extremely useful feature, but *not* when you invoke it accidentally!

Quoted 3 lines

Now still can't remove, but says "
Can't remove merging snapshot logical volume "Home-2011.09.03-00.28.36"
...

Correct. You *don't* want to interrupt the merge. That will just corrupt stuff.

Quoted 1 line

So now I'm concerned...is it going to try to merge back any changes it recorded by reversing them?

Yes.

Quoted 1 line

i.e. put the original volume back the way it was when the snapshot started?

Yes.

Quoted 2 lines

Says it couldn't do it on open volume -- does that mean it won't start this until I reboot, then it will take a long time to become active?

Possibly. I've never tried it on an open volume.

Quoted 1 line

I'm wondering if I really want this 'merge' it wants to do...and if not, how do I abort it?

If it is really delayed until boot (or close), then you have a chance to abort it, but I don't know how. I hope an expert answers. Meanwhile, I'll peruse the man page to see if it talks about delayed merge.

--

	      Stuart D. Gathman <[email protected]>
    Business Management Systems Inc.  Phone: 703 591-0911 Fax: 703 591-6154

"Confutatis maledictis, flammis acribus addictis" - background song for a Microsoft sponsored "Where do you want to go from here?" commercial.

#2 lore raw
Quoted 9 lines · Stuart D. Gathman
Quoted 1 line · Linda A. Walsh

tried -- merging it...

Ooops. You likely did not want that. That reverts the origin volume to the snapshot by copying the original data for updated sectors from the snapshot. This is an extremely useful feature, but *not* when you invoke it accidentally!

Quoted 5 lines
Quoted 1 line

I'm wondering if I really want this 'merge' it wants to do...and if not, how do I abort it?

If it is really delayed until boot (or close), then you have a chance to abort it, but I don't know how. I hope an expert answers. Meanwhile, I'll peruse the man page to see if it talks about delayed merge.

The man page says:

If both the origin and snapshot volume are not open the merge will start
immediately. Otherwise, the merge will start the first time either the
origin or snap??? shot are activated and both are closed. Merging a snapshot into an origin that cannot be closed, for example a root filesystem, is deferred until the next time the origin volume is activated. When merging starts, the resulting logical volume will have the origin's name, minor number and UUID. While the merge is in progress, reads or writes to the origin appear as they were directed to the snapshot being merged. When the merge finishes, the merged snapshot is removed. Multiple snapshots may be specified on the commandline or a @tag may be used to specify multi??? ple snapshots be merged to their respective origin.

If you have space, I would copy your origin LV while you can. There is nothing about cancelling the merge. I suspect you could restore the metadata backup from before your merge. But make backups first!

--

	      Stuart D. Gathman <[email protected]>
    Business Management Systems Inc.  Phone: 703 591-0911 Fax: 703 591-6154

"Confutatis maledictis, flammis acribus addictis" - background song for a Microsoft sponsored "Where do you want to go from here?" commercial.

#3 lore raw

I might as well nuke the merge....I'd have to restore 2 images to restore all the files to this morning....if something went bad, but if I wait around...

I can't see it merging block diffs on an actively mounted file system...that would just be insane!

really seems like best thing would be to nuke the merge somehow, then wouldn't have to resort to backups...

Restoring a TB of data takes a bit of time...

The file system it's trying to merge to is my home dir... (where all my work goes...;-)...

But while past performance is no guarantee of future performance, currently my system's uptime stands at 44 days, so it could be a while before said merge happens, or ... could happen sooner if I 'try to fix it'....;-)
(power is on UPS, so usually reboots happen because I do something -- usually planned, but occasionally after shooting one's self in foot...)...

Since it can't start the merge...seems like there should be a way to stop it w/o causing problems.

**--case in point re:shooting self in foot -- merging 8 day old snap w/current vol in trying to work around bugs...*sigh*

You may be right...the force option may be less painful that fixing this merge thing if it goes south...

Quoted 56 lines · Stuart D. Gathman
Quoted 9 lines · Stuart D. Gathman
Quoted 1 line · Linda A. Walsh

tried -- merging it...

Ooops. You likely did not want that. That reverts the origin volume to the snapshot by copying the original data for updated sectors from the snapshot. This is an extremely useful feature, but *not* when you invoke it accidentally!

Quoted 5 lines
Quoted 1 line

I'm wondering if I really want this 'merge' it wants to do...and if not, how do I abort it?

If it is really delayed until boot (or close), then you have a chance to abort it, but I don't know how. I hope an expert answers. Meanwhile, I'll peruse the man page to see if it talks about delayed merge.

The man page says:

If both the origin and snapshot volume are not open the merge will
start
immediately. Otherwise, the merge will start the first time
either the
origin or snap??? shot are activated and both are closed. Merging a
snapshot
into an origin that cannot be closed, for example a root
filesystem, is
deferred until the next time the origin volume is activated. When
merging
starts, the resulting logical volume will have the origin's name, minor number and UUID. While the merge is in progress, reads or
writes to
the origin appear as they were directed to the snapshot being
merged. When
the merge finishes, the merged snapshot is removed. Multiple
snapshots may
be specified on the commandline or a @tag may be used to specify
multi??? ple
snapshots be merged to their respective origin.

If you have space, I would copy your origin LV while you can. There is nothing about cancelling the merge. I suspect you could restore the metadata backup from before your merge. But make backups first!

Signature · 11 lines
          Stuart D. Gathman <[email protected]>
    Business Management Systems Inc.  Phone: 703 591-0911 Fax: 703 
591-6154
"Confutatis maledictis, flammis acribus addictis" - background song for
a Microsoft sponsored "Where do you want to go from here?" commercial.

_______________________________________________
linux-lvm mailing list
[email protected]
https://www.redhat.com/mailman/listinfo/linux-lvm
read the LVM HOW-TO at http://tldp.org/HOWTO/LVM-HOWTO/
#4 lore raw
In reply to Stuart D. Gathman

Here's a sadistic (or masochistic, maybe both, if I do it to myself)... question...

If I start a snapshot today... (or if one is already running)...

And the merge happens, will the snapshot take today have the data to undo the merge?

Quoted 56 lines · Stuart D. Gathman
Quoted 9 lines · Stuart D. Gathman
Quoted 1 line · Linda A. Walsh

tried -- merging it...

Ooops. You likely did not want that. That reverts the origin volume to the snapshot by copying the original data for updated sectors from the snapshot. This is an extremely useful feature, but *not* when you invoke it accidentally!

Quoted 5 lines
Quoted 1 line

I'm wondering if I really want this 'merge' it wants to do...and if not, how do I abort it?

If it is really delayed until boot (or close), then you have a chance to abort it, but I don't know how. I hope an expert answers. Meanwhile, I'll peruse the man page to see if it talks about delayed merge.

The man page says:

If both the origin and snapshot volume are not open the merge will
start
immediately. Otherwise, the merge will start the first time
either the
origin or snap??? shot are activated and both are closed. Merging a
snapshot
into an origin that cannot be closed, for example a root
filesystem, is
deferred until the next time the origin volume is activated. When
merging
starts, the resulting logical volume will have the origin's name, minor number and UUID. While the merge is in progress, reads or
writes to
the origin appear as they were directed to the snapshot being
merged. When
the merge finishes, the merged snapshot is removed. Multiple
snapshots may
be specified on the commandline or a @tag may be used to specify
multi??? ple
snapshots be merged to their respective origin.

If you have space, I would copy your origin LV while you can. There is nothing about cancelling the merge. I suspect you could restore the metadata backup from before your merge. But make backups first!

Signature · 11 lines
          Stuart D. Gathman <[email protected]>
    Business Management Systems Inc.  Phone: 703 591-0911 Fax: 703 
591-6154
"Confutatis maledictis, flammis acribus addictis" - background song for
a Microsoft sponsored "Where do you want to go from here?" commercial.

_______________________________________________
linux-lvm mailing list
[email protected]
https://www.redhat.com/mailman/listinfo/linux-lvm
read the LVM HOW-TO at http://tldp.org/HOWTO/LVM-HOWTO/
#5 lore raw
In reply to Linda A. Walsh
Quoted 7 lines
Quoted 5 lines

tried to remove an unmounted active snapshot.

lvremove said it wouldn't remove an active snapshot.

Tried -an -- can't change active snapshot.

Use lvremove -f

What's directly in the LV? A partition perhaps? A raid block? If it says that it can't be removed because it's in active use, busy, it's probably telling you the truth. I've had this happen a couple of times. In one case, it held a virtual machine with a partition I had mapped using kpartx, so I had to use kpartx to unmap that partition. I think the other time the LV was itself a PV, or else it was shared using gnbd.

--force means, in my opinion at least, "Yes, I know what I'm doing. I understand why the system is saying I better not do this, but I want to force it to happen anyway". When it's used to mean "I don't understand what's going on, I don't know why this is a bad idea, but do it anyway", that sounds to me like a recipe for problems.

Signature · 16 lines
Ray Morris
[email protected]

Strongbox - The next generation in site security:
http://www.bettercgi.com/strongbox/

Throttlebox - Intelligent Bandwidth Control
http://www.bettercgi.com/throttlebox/

Strongbox / Throttlebox affiliate program:
http://www.bettercgi.com/affiliates/user/register.php




On Sun, 11 Sep 2011 17:44:48 -0700
Quoted 58 lines · Linda A. Walsh

tried to remove an unmounted active snapshot.

lvremove said it wouldn't remove an active snapshot.

Tried -an -- can't change active snapshot.

Tried turning off monitoring --monitor -n
It gave no message
tried removing again...can't remove active snap

tried --ignoremonitoring

no message but still can't remove

tried -- merging it...

Said it couldn't merge with open origin,
then merging with origin on next activation...

Now still can't remove, but says "
Can't remove merging snapshot logical volume
"Home-2011.09.03-00.28.36" ...

decided to try dmsetup remove --

it couldn't remove it either -- resource/device busy...

So now I'm concerned...is it going to try to merge back any changes it recorded by reversing them?

i.e. put the original volume back the way it was when the snapshot started?

Says it couldn't do it on open volume -- does that mean it won't start this until I reboot,
then it will take a long time to become active?

seems like the dmsetup remove of the parts was the safest way to kill off an active snapshot...but this feels contorted.

I'm wondering if I really want this 'merge' it wants to do...and if not, how do I abort
it?

Thanks!

(hoping system stays up until I get this sorted out!)...

_______________________________________________
linux-lvm mailing list
[email protected]
https://www.redhat.com/mailman/listinfo/linux-lvm
read the LVM HOW-TO at http://tldp.org/HOWTO/LVM-HOWTO/

#6 lore raw
Quoted 5 lines · Ray Morris

--force means, in my opinion at least, "Yes, I know what I'm doing. I understand why the system is saying I better not do this, but I want to force it to happen anyway". When it's used to mean "I don't understand what's going on, I don't know why this is a bad idea, but do it anyway", that sounds to me like a recipe for problems.

The problem is, when the snapshot is "active" (has an 'a' in the status in lvs), but not "open" (no 'o' in the status), lvremove still refuses to remove, complaining about the LV being "active".

There seems to be some confusion about terminology. Active means it is loaded into device mapper and mapped to /dev/vgname/lvname AFAIKT.

Fortunately, lvremove -f seems to complain when the LV is actually open.

In the OP problem, we don't know the exact error message, so perhaps the snapshot really was open. In any case, she needs to stop the merge from happening the next time the LV is activated.

--

	      Stuart D. Gathman <[email protected]>
    Business Management Systems Inc.  Phone: 703 591-0911 Fax: 703 591-6154

"Confutatis maledictis, flammis acribus addictis" - background song for a Microsoft sponsored "Where do you want to go from here?" commercial.

#7 lore raw

[linux-lvm] How to stop MERGE? (was Re: more vg problems or oddities...not using dmsetup remove seems to be bad?)

Quoted 4 lines · Stuart D. Gathman

In the OP problem, we don't know the exact error message, so perhaps the snapshot really was open. In any case, she needs to stop the merge from happening the next time the LV is activated.

---
I've only seen 1 error message ..

Ah....here are the two messages...this ****IS NOT*** a snapshot volume... it's a static volume!

Here's lvs. I'm going to remove the oldest static 'snap' (not an active snapshot, but a copy of one that existed back then. It's currently mounted, .. (lv Home-2011.07.20-13.43.15; you'll never guess when the snapshot was started or what the base LV was.. ;-) )...
It's currently mounted, and no 's' in status... (i.e. not an active snapshot).

NOTE, poor 'Home' has 'O' status -- thinks it is MERGing, but nothing for it to MERGE with! -- this is a problem waiting to happen that I need to ABORT.

# lvs
 LV                       VG         Attr   LSize  
 Backups                  Backups    -wi-ao  10.91t
 Home                     Home+Space Owi-ao   1.00t
 Home-2011.07.20-13.43.15 Home+Space -wi-ao 171.00g    <-about to remove
 Home-2011.07.25-16.24.53 Home+Space -wi-ao   1.88g
....     
 Home-2011.08.31-07.34.53 Home+Space -wi-ao   1.86g
 Home-2011.09.04-19.25.08 Home+Space swi-ao   1.00t Home     1.25
 Home.diff                Home+Space -wi-ao 512.00g
# lvremove /dev/Home+Space/Home-2011.07.20-13.43.15    # first w/o umounting it...
Can't remove open logical volume "Home-2011.07.20-13.43.15"
ok... so lets. unmount it...
# umount /home/snapdir/@GMT-2011.07.20-13.43.15
# lvremove /dev/Home+Space/Home-2011.07.20-13.43.15
Do you really want to remove active logical volume Home-2011.07.20-13.43.15? [y/n]: y
 Logical volume "Home-2011.07.20-13.43.15" successfully removed

^^^
This isn't helpful...as it's not *really* active in any way to the OS... though it might still be 'activated'...(that's why I'm trying to remove it...!)...

It was created w/lvcreate, so ... opposite of lvcreate would be lvremove, no?... there is no 'lvucreate'.. ;-/

FWIW...Home is even more confused...

Thought it was going to merge with a volume from 2011.09.03-xxxx, but dmsetup remove on /dev/Home+Space/Home-2011.09.03-xxxx suceeded w/o force as well as:
/dev/Home+Space/Home-2011.09.03-xxxx-cow

So now, /Home... what's it going to merge w/? (Garbage likely...)...

That's what I love about the M5 computer, er, LVM2 Merge option:
"No off switch"...

(last crewman who tried to pull the plug got zapped...didn't know lvm was so dangerous!...;-) ).