Hi guys:
the lv can't remove ,it reports it has opened , but lvdisplay show open count is zero
junwork:/etc/kvm/vm # lvremove -f /dev/domu/atta Can't remove open logical volume "atta"
junwork:/etc/kvm/vm # lvdisplay /dev/domu/atta --- Logical volume --- LV Name /dev/domu/atta VG Name domu LV UUID 27XK8j-7Ay7-Rsv3-M3SI-y9Nw-aIT6-i8Kjrl LV Write Access read/write LV Status available # open 0 LV Size 1.00 GiB Current LE 256 Segments 1 Allocation inherit Read ahead sectors auto - currently set to 1024 Block device 253:5
junwork:/etc/kvm/vm # lsof /dev/domu/atta junwork:/etc/kvm/vm #
junwork:/etc/kvm/vm # pvs PV VG Fmt Attr PSize PFree /dev/sda8 domu lvm2 a- 32.25g 3.25g
W dniu 01.01.2013 13:54, Jun Hu pisze:
Hi guys:
the lv can't remove ,it reports it has opened , but lvdisplay show open count is zero
junwork:/etc/kvm/vm # lvremove -f /dev/domu/atta Can't remove open logical volume "atta"
junwork:/etc/kvm/vm # lvdisplay /dev/domu/atta --- Logical volume --- LV Name /dev/domu/atta VG Name domu LV UUID 27XK8j-7Ay7-Rsv3-M3SI-y9Nw-aIT6-i8Kjrl LV Write Access read/write LV Status available # open 0 LV Size 1.00 GiB Current LE 256 Segments 1 Allocation inherit Read ahead sectors auto
- currently set to 1024
Block device 253:5
junwork:/etc/kvm/vm # lsof /dev/domu/atta junwork:/etc/kvm/vm #
junwork:/etc/kvm/vm # pvs PV VG Fmt Attr PSize PFree /dev/sda8 domu lvm2 a- 32.25g 3.25g
Did you tried to make this lv non-available firts (lvchange -a n)? The lsof command you used may not work this way. Try also something like this:
lsof /dev/mapper/domu-atta
or use:
fuser -vm /dev/domu/atta
--- Stefan
Hi Stefan:
Sorry, I can't reproduce it now because I have rebooted it.
now , I can remove the activated LV.
junwork:~/Desktop # fuser -vm /dev/domu/btrfs USER PID ACCESS COMMAND /dev/dm-4: root kernel swap /dev/sda9 root kernel mount /dev root 1 F.... systemd root 285 F.... systemd-journal root 316 F.... udevd root 613 F.... mount.ntfs-3g root 614 F.... mount.ntfs-3g root 615 F.... mount.ntfs-3g root 625 F.... haveged avahi 633 f.... avahi-daemon root 640 f.... rpcbind root 647 f.... systemd-logind root 670 F.... agetty root 673 F.... agetty root 687 F.... rsyslogd messagebus 701 f.... dbus-daemon root 704 F.... acpid root 780 F.... xenstored root 787 F.... xenconsoled root 898 F.... xend root 901 F.... blktapctrl root 993 F.... xend root 1386 F.... ifplugd root 4237 f.... cron root 4239 f.... libvirtd root 4286 f.... sshd root 4309 f.... xinetd root 4312 F.... vpnagentd root 4313 F.... collectd root 4333 F.... smbd root 4341 F.... smbd root 4345 f.... cupsd root 4350 F.... rpc.idmapd root 4467 F.... rpc.mountd statd 4474 F.... rpc.statd ntp 5497 F.... ntpd root 5509 f.... gdm root 5510 f.... gdm-simple-slav root 5514 F...m Xorg root 5548 f.... accounts-daemon root 5552 F.... polkitd root 5555 f.... console-kit-dae root 5645 F.... upowerd rtkit 5699 f.... rtkit-daemon root 5744 f.... gdm-session-wor root 6239 f.... gnome-keyring-d root 6258 F.... gnome-session root 6269 F.... scim-launcher root 6273 F.... scim-helper-man root 6274 F.... scim-panel-gtk root 6276 F.... scim-launcher root 6317 F.... dbus-launch root 6318 F.... dbus-daemon root 6320 F.... gvfsd root 6322 F.... gvfs-fuse-daemo root 6335 f.... gnome-settings- root 6343 F.... at-spi-bus-laun root 6347 F.... dbus-daemon root 6350 F.... at-spi2-registr root 6353 f.... gsd-printer root 6358 F.... gvfs-udisks2-vo root 6360 F.... udisksd root 6366 F.... gvfs-gphoto2-vo root 6368 F.... gvfs-afc-volume root 6372 f.... metacity root 6374 f.... gsd-locate-poin root 6380 f.... gnome-panel root 6385 F.... gconfd-2 root 6387 F.... dconf-service root 6388 f.... gnome-sound-app root 6392 f.... gnome-screensav root 6393 F.... bluetooth-apple root 6395 f.... notification-da root 6398 f.... tracker-store root 6401 F.... pulseaudio root 6409 f.... applet.py root 6410 f.... gnome-fallback- root 6414 f.... tracker-miner-f root 6419 f.... nautilus root 6421 f.... evolution-alarm root 6424 f.... nm-applet root 6428 F.... gconf-helper root 6437 f.... zeitgeist-datah root 6438 f.... polkit-gnome-au root 6445 F.... zeitgeist-daemo root 6452 F.... evolution-calen root 6454 F.... gvfsd-trash root 6468 F.... gvfsd-metadata root 6473 F.... zeitgeist-fts root 6485 F.... mission-control root 6494 F.... goa-daemon root 6501 F.... evolution-addre root 6534 F.... gnome-terminal root 6540 f.... gnome-pty-helpe root 6541 F.... bash root 7015 F.... dhclient6 root 8095 F.... dhcpcd root 9087 F.... opera root 9088 F.... gedit root 9089 F.... evolution root 9091 F.... firefox root 9158 F.... pxgsettings root 9383 F.... udevd root 9384 F.... udevd junwork:~/Desktop # lsof /dev/domu/btrfs junwork:~/Desktop # junwork:~/Desktop # lvremove /dev/domu/btrfs Do you really want to remove active logical volume btrfs? [y/n]: y Logical volume "btrfs" successfully removed
On Wed, 2013-01-02 at 07:51 +0100, Stefan Lijewski wrote:
W dniu 01.01.2013 13:54, Jun Hu pisze:
Hi guys:
the lv can't remove ,it reports it has opened , but lvdisplay show open count is zero
junwork:/etc/kvm/vm # lvremove -f /dev/domu/atta Can't remove open logical volume "atta"
junwork:/etc/kvm/vm # lvdisplay /dev/domu/atta --- Logical volume --- LV Name /dev/domu/atta VG Name domu LV UUID 27XK8j-7Ay7-Rsv3-M3SI-y9Nw-aIT6-i8Kjrl LV Write Access read/write LV Status available # open 0 LV Size 1.00 GiB Current LE 256 Segments 1 Allocation inherit Read ahead sectors auto
- currently set to 1024
Block device 253:5
junwork:/etc/kvm/vm # lsof /dev/domu/atta junwork:/etc/kvm/vm #
junwork:/etc/kvm/vm # pvs PV VG Fmt Attr PSize PFree /dev/sda8 domu lvm2 a- 32.25g 3.25g
Did you tried to make this lv non-available firts (lvchange -a n)? The lsof command you used may not work this way. Try also something like this:
lsof /dev/mapper/domu-atta
or use:
fuser -vm /dev/domu/atta
Stefan
Hi stefan:
man fuser say: m mmap'ed file or shared library
I think it shouldn't been a valid option in my scene because fuser -vm output very much process ,but I can remove the device still.
On Thu, 2013-01-03 at 07:48 +0800, Jun Hu wrote:
Hi Stefan:
Sorry, I can't reproduce it now because I have rebooted it.
now , I can remove the activated LV.
junwork:~/Desktop # fuser -vm /dev/domu/btrfs USER PID ACCESS COMMAND /dev/dm-4: root kernel swap /dev/sda9 root kernel mount /dev root 1 F.... systemd root 285 F.... systemd-journal root 316 F.... udevd root 613 F.... mount.ntfs-3g root 614 F.... mount.ntfs-3g root 615 F.... mount.ntfs-3g root 625 F.... haveged avahi 633 f.... avahi-daemon root 640 f.... rpcbind root 647 f.... systemd-logind root 670 F.... agetty root 673 F.... agetty root 687 F.... rsyslogd messagebus 701 f.... dbus-daemon root 704 F.... acpid root 780 F.... xenstored root 787 F.... xenconsoled root 898 F.... xend root 901 F.... blktapctrl root 993 F.... xend root 1386 F.... ifplugd root 4237 f.... cron root 4239 f.... libvirtd root 4286 f.... sshd root 4309 f.... xinetd root 4312 F.... vpnagentd root 4313 F.... collectd root 4333 F.... smbd root 4341 F.... smbd root 4345 f.... cupsd root 4350 F.... rpc.idmapd root 4467 F.... rpc.mountd statd 4474 F.... rpc.statd ntp 5497 F.... ntpd root 5509 f.... gdm root 5510 f.... gdm-simple-slav root 5514 F...m Xorg root 5548 f.... accounts-daemon root 5552 F.... polkitd root 5555 f.... console-kit-dae root 5645 F.... upowerd rtkit 5699 f.... rtkit-daemon root 5744 f.... gdm-session-wor root 6239 f.... gnome-keyring-d root 6258 F.... gnome-session root 6269 F.... scim-launcher root 6273 F.... scim-helper-man root 6274 F.... scim-panel-gtk root 6276 F.... scim-launcher root 6317 F.... dbus-launch root 6318 F.... dbus-daemon root 6320 F.... gvfsd root 6322 F.... gvfs-fuse-daemo root 6335 f.... gnome-settings- root 6343 F.... at-spi-bus-laun root 6347 F.... dbus-daemon root 6350 F.... at-spi2-registr root 6353 f.... gsd-printer root 6358 F.... gvfs-udisks2-vo root 6360 F.... udisksd root 6366 F.... gvfs-gphoto2-vo root 6368 F.... gvfs-afc-volume root 6372 f.... metacity root 6374 f.... gsd-locate-poin root 6380 f.... gnome-panel root 6385 F.... gconfd-2 root 6387 F.... dconf-service root 6388 f.... gnome-sound-app root 6392 f.... gnome-screensav root 6393 F.... bluetooth-apple root 6395 f.... notification-da root 6398 f.... tracker-store root 6401 F.... pulseaudio root 6409 f.... applet.py root 6410 f.... gnome-fallback- root 6414 f.... tracker-miner-f root 6419 f.... nautilus root 6421 f.... evolution-alarm root 6424 f.... nm-applet root 6428 F.... gconf-helper root 6437 f.... zeitgeist-datah root 6438 f.... polkit-gnome-au root 6445 F.... zeitgeist-daemo root 6452 F.... evolution-calen root 6454 F.... gvfsd-trash root 6468 F.... gvfsd-metadata root 6473 F.... zeitgeist-fts root 6485 F.... mission-control root 6494 F.... goa-daemon root 6501 F.... evolution-addre root 6534 F.... gnome-terminal root 6540 f.... gnome-pty-helpe root 6541 F.... bash root 7015 F.... dhclient6 root 8095 F.... dhcpcd root 9087 F.... opera root 9088 F.... gedit root 9089 F.... evolution root 9091 F.... firefox root 9158 F.... pxgsettings root 9383 F.... udevd root 9384 F.... udevd junwork:~/Desktop # lsof /dev/domu/btrfs junwork:~/Desktop # junwork:~/Desktop # lvremove /dev/domu/btrfs Do you really want to remove active logical volume btrfs? [y/n]: y Logical volume "btrfs" successfully removed
On Wed, 2013-01-02 at 07:51 +0100, Stefan Lijewski wrote:
W dniu 01.01.2013 13:54, Jun Hu pisze:
Hi guys:
the lv can't remove ,it reports it has opened , but lvdisplay show open count is zero
junwork:/etc/kvm/vm # lvremove -f /dev/domu/atta Can't remove open logical volume "atta"
junwork:/etc/kvm/vm # lvdisplay /dev/domu/atta --- Logical volume --- LV Name /dev/domu/atta VG Name domu LV UUID 27XK8j-7Ay7-Rsv3-M3SI-y9Nw-aIT6-i8Kjrl LV Write Access read/write LV Status available # open 0 LV Size 1.00 GiB Current LE 256 Segments 1 Allocation inherit Read ahead sectors auto
- currently set to 1024
Block device 253:5
junwork:/etc/kvm/vm # lsof /dev/domu/atta junwork:/etc/kvm/vm #
junwork:/etc/kvm/vm # pvs PV VG Fmt Attr PSize PFree /dev/sda8 domu lvm2 a- 32.25g 3.25g
Did you tried to make this lv non-available firts (lvchange -a n)? The lsof command you used may not work this way. Try also something like this:
lsof /dev/mapper/domu-atta
or use:
fuser -vm /dev/domu/atta
Stefan