Discussion:
[linux-lvm] Restoring snapshot gone bad
Mauricio Tavares
2017-09-22 06:03:18 UTC
Permalink
I have a lv, vmzone/desktop that I use as drive for a kvm guest;
nothing special here. I wanted to restore its snapshot so like I have
done many times before I shut guest down and then

lvconvert --merge vmzone/desktop_snap_20170921
Logical volume vmzone/desktop is used by another device.
Can't merge over open origin volume.
Merging of snapshot vmzone/desktop_snap_20170921 will occur on next activation
of vmzone/desktop.

What is it really trying to tell me? How to find out which other
device is using it?

lvdisplay tells me that

lvdisplay /dev/vmzone/desktop
--- Logical volume ---
LV Path /dev/vmzone/desktop
LV Name desktop
VG Name vmzone
LV UUID 3hcB1L-rIRf-PHZQ-I55F-ZXhT-SnSZ-vThO8U
LV Write Access read/write
LV Creation host, time duocismj01e9se, 2017-06-29 15:07:12 -0400
LV snapshot status source of
desktop_snap_20170921 [active]
LV Status available
# open 2
LV Size 100.00 GiB
Current LE 25600
Segments 1
Allocation inherit
Read ahead sectors auto
- currently set to 256
Block device 252:6

When I do plain old lvs (or lvs -a -o +devices), the attribute entry
for the desktop looks like

desktop vmzone Owi-aos--- 100.00g

According to https://linux.die.net/man/8/lvs the "O" in Owi-aos--- means it
is merging a snapshot. But, what is its status? Based on how long it
has been that way, I think it is hung but I do not know what is
causing this hangup.

Suggestions?
Xen
2017-09-22 08:30:15 UTC
Permalink
Post by Mauricio Tavares
I have a lv, vmzone/desktop that I use as drive for a kvm guest;
nothing special here. I wanted to restore its snapshot so like I have
done many times before I shut guest down and then
lvconvert --merge vmzone/desktop_snap_20170921
Logical volume vmzone/desktop is used by another device.
Can't merge over open origin volume.
Merging of snapshot vmzone/desktop_snap_20170921 will occur on next activation
of vmzone/desktop.
What is it really trying to tell me? How to find out which other
device is using it?
Other people will have better answers but I think it will be hard to see
unless it is used by the device mapper for some target.

I hope there is a better answer.

But obviously the "o" means open volume (ie. mounted or something else)
and that means that if you can't find a way to close it next time you
boot the machine it will get merged?

I hope there is a good way to get your usage information (apart from
something like "lsof").

Regards.
Zdenek Kabelac
2017-09-22 08:11:27 UTC
Permalink
Post by Mauricio Tavares
I have a lv, vmzone/desktop that I use as drive for a kvm guest;
nothing special here. I wanted to restore its snapshot so like I have
done many times before I shut guest down and then
lvconvert --merge vmzone/desktop_snap_20170921
Logical volume vmzone/desktop is used by another device.
Can't merge over open origin volume.
Merging of snapshot vmzone/desktop_snap_20170921 will occur on next activation
of vmzone/desktop.
What is it really trying to tell me? How to find out which other
device is using it?
Hi


When you want merge a snapshot - origin must be an unused volume (so not
opened/mounted anywhere).

Merging process 'copies/restores' modified blocks in your origin volume - thus
i.e. filesystem would not be able to handle 'changes' happening underneath its
hands..

So if there are not condition which let you start snapshot merge, the
operation is delayed - likely your 'next' activation of your origin volume in
which case it's pretty sure there is no user so the merge can be started
(or you can 'lvchange --refresh')
Post by Mauricio Tavares
lvdisplay tells me that
lvdisplay /dev/vmzone/desktop
--- Logical volume ---
LV Path /dev/vmzone/desktop
LV Name desktop
VG Name vmzone
LV UUID 3hcB1L-rIRf-PHZQ-I55F-ZXhT-SnSZ-vThO8U
LV Write Access read/write
LV Creation host, time duocismj01e9se, 2017-06-29 15:07:12 -0400
LV snapshot status source of
desktop_snap_20170921 [active]
LV Status available
# open 2
^^^^
here you can see 'non-zero' open count
Post by Mauricio Tavares
LV Size 100.00 GiB
Current LE 25600
Segments 1
Allocation inherit
Read ahead sectors auto
- currently set to 256
Block device 252:6
When I do plain old lvs (or lvs -a -o +devices), the attribute entry
for the desktop looks like
desktop vmzone Owi-aos--- 100.00g
According to https://linux.die.net/man/8/lvs the "O" in Owi-aos--- means it
is merging a snapshot. But, what is its status? Based on how long it
has been that way, I think it is hung but I do not know what is
causing this hangup.
Nothing is hanging - it's just postponed for next opportunity...
Progress of merging can be checked easily with command 'lvs'.
Note: while the merging is in progress - you can already use 'merged origin'
so i.e. if you merge snapshot of you 'root' volume - on reboot and next
activation you can already use 'merged' result while actually copying is
processed in the background and you can check its progress percentage.

Regards

Zdenek

Loading...