Skip to contentSkip to conversation

Can't remove snapshot at first

linux-lvm Alexander Skwar 3 participants 7 messages Aug 25, 2010

lore
Share & tools
lore
#0 lore raw

Hi.

I noticed, that rather often, I'm unable to remove an unused snapshot volume at first command execution. See this:

--($ ~)-- sudo /sbin/lvremove /dev/Sys/Home-Backup_Snapshot
Can't remove open logical volume "Home-Backup_Snapshot"

--($ ~)-- sudo /sbin/lvremove /dev/Sys/Home-Backup_Snapshot
Do you really want to remove active logical volume Home-Backup_Snapshot? [y/n]:

Between those two commands, I did not do anything at all! I ran the commands directly after each other in like 5 seconds or so.

Why's that so?

--($ ~)-- sudo /sbin/lvm version
LVM version: 2.02.70(2) (2010-07-06)
Library version: 1.02.52 (2010-07-06)
Driver version: 4.17.0

--($ ~)-- uname -a
Linux winnb000546 2.6.35-ARCH #1 SMP PREEMPT Sat Aug 21 07:23:08 UTC 2010 i686 Intel(R) Core(TM)2 Duo CPU T7300 @ 2.00GHz GenuineIntel GNU/Linux

This is a Arch Linux system.

Thanks,
Alexander

#1 lore raw
Quoted 11 lines · Alexander Skwar

--($ ~)-- sudo /sbin/lvremove /dev/Sys/Home-Backup_Snapshot
Can't remove open logical volume "Home-Backup_Snapshot"

--($ ~)-- sudo /sbin/lvremove /dev/Sys/Home-Backup_Snapshot
Do you really want to remove active logical volume Home-Backup_Snapshot? [y/n]:

Between those two commands, I did not do anything at all! I ran the commands directly after each other in like 5 seconds or so.

Why's that so?

Do you have "udisks" installed? There's a problem we track already and this seems to be the same:

https://bugzilla.redhat.com/show_bug.cgi?id=577798

Peter

#2 lore raw

Hi.

2010/8/25 Peter Rajnoha <[email protected]>

Quoted 8 lines · Alexander Skwar
Quoted 6 lines

--($ ~)-- sudo /sbin/lvremove /dev/Sys/Home-Backup_Snapshot Can't remove open logical volume "Home-Backup_Snapshot"

--($ ~)-- sudo /sbin/lvremove /dev/Sys/Home-Backup_Snapshot
Do you really want to remove active logical volume Home-Backup_Snapshot? [y/n]:

Quoted 7 lines
Quoted 5 lines

Between those two commands, I did not do anything at all! I ran the commands directly after each other in like 5 seconds or so.

Why's that so?

Do you have "udisks" installed?

TBH, I don't know what udisks is, but, yes, it's installed.

--($ /.backup/lib)-- pacman -Q udisks
udisks 1.0.1-5

And it's running as well...

root 9604 0.0 0.1 13708 3088 ? Sl 07:47 0:10
/usr/lib/udisks/udisks-daemon

Quoted 4 lines

There's a problem we track already and
this seems to be the same:

 https://bugzilla.redhat.com/show_bug.cgi?id=577798

I removed that line from the udev rule, and now the problem seems to be gone.

Alexander
--
↯    Lifestream (Twitter, Blog, …) ↣ http://alexs77.soup.io/     ↯ ↯ Chat (Jabber/Google Talk) ↣ [email protected] , AIM: alexws77  ↯

#3 lore raw
In reply to Alexander Skwar
Quoted 11 lines · Alexander Skwar

I noticed, that rather often, I'm unable to remove an unused snapshot volume at first command execution. See this:

--($ ~)-- sudo /sbin/lvremove /dev/Sys/Home-Backup_Snapshot
Can't remove open logical volume "Home-Backup_Snapshot"

--($ ~)-- sudo /sbin/lvremove /dev/Sys/Home-Backup_Snapshot
Do you really want to remove active logical volume Home-Backup_Snapshot? [y/n]:

Between those two commands, I did not do anything at all! I ran the commands directly after each other in like 5 seconds or so.

I t is possible that udev run some async scan in reaction to even (during snap manipulation).

Distro maintainers should probably update lvm udev rules (and possibly udisks rules etc) to work relieably.

Upstream lvm2 with combination of recent udev and udisks package should have this fixed (hopefully).

Milan

#4 lore raw
Quoted 6 lines · Milan Broz
Quoted 3 lines · Alexander Skwar

--($ ~)-- sudo /sbin/lvremove /dev/Sys/Home-Backup_Snapshot
Can't remove open logical volume "Home-Backup_Snapshot"

Upstream lvm2 with combination of recent udev and udisks package should have this fixed (hopefully).

Well, not completely in this exact case. It's hard to cover this situation with "nowatch"/dm udev flags here because someone could change the contents of the volume and so the snapshot volume and original volume can differ.

Anyone scanning for those changes in udev rules could miss the change of a symlink name based on some changed attribute or some other call that notifies about changes in general.

We can rule out the mirror's _mimage, snapshot's -cow/-real etc. scanning, but the top-level snapshot - unfortunately not.

So for now, it would be better to just try to comment out that watch rule in udisks udev rules so we can see that is the case.

If yes, we can make our argument that this really causes problems even stronger and try to persuade people who use the watch rule to be inclined to some other alternative solution that is less problematic to support.

Peter

#5 lore raw

Hi.

2010/8/25 Peter Rajnoha <[email protected]>:

Quoted 2 lines

So for now, it would be better to just try to comment out that watch rule in udisks udev rules so we can see that is the case.

Sorry, I guess I was "a bit" too hasty, when I said that removing the line helped... I'm still getting the error in my OP.

Alexander
--
↯    Lifestream (Twitter, Blog, …) ↣ http://alexs77.soup.io/     ↯ ↯ Chat (Jabber/Google Talk) ↣ [email protected] , AIM: alexws77  ↯

#6 lore raw
In reply to Milan Broz

Hello!

2010/8/25 Milan Broz <[email protected]>:

Quoted 10 lines · Alexander Skwar
Quoted 9 lines

I noticed, that rather often, I'm unable to remove an unused snapshot volume at first command execution. See this:

--($ ~)-- sudo /sbin/lvremove /dev/Sys/Home-Backup_Snapshot Can't remove open logical volume "Home-Backup_Snapshot"

--($ ~)-- sudo /sbin/lvremove /dev/Sys/Home-Backup_Snapshot
Do you really want to remove active logical volume Home-Backup_Snapshot? [y/n]:

Quoted 7 lines
Quoted 2 lines

Between those two commands, I did not do anything at all! I ran the commands directly after each other in like 5 seconds or so.

I t is possible that udev run some async scan in reaction to even (during snap manipulation).

Distro maintainers should probably update lvm udev rules (and possibly udisks rules etc) to work relieably.

Guess so.

Quoted 2 lines

Upstream lvm2 with combination of recent udev and udisks package should have this fixed (hopefully).

Hm. I have udisks 1.0.1 installed.
http://cgit.freedesktop.org/DeviceKit/DeviceKit-disks/
lists 1.0.1 as the most recent, so what should Arch Linux do in this case?

Same for udev - http://www.kernel.org/pub/linux/utils/kernel/hotplug/?C=M;O=D
lists udev-161 as the latest and I do have udev-161 installed.

But LVM2 is indeed out of date - I've got 2.02.70. Would've .71 or .73 have fixed this?

BTW: I'm on kernel 2.6.35.3-1. Well, I guess that should be 2.6.35.3, but should the
uname -a output show 2.6.35.3?

Alexander
--
↯    Lifestream (Twitter, Blog, …) ↣ http://alexs77.soup.io/     ↯ ↯ Chat (Jabber/Google Talk) ↣ [email protected] , AIM: alexws77  ↯