libvirt.img is in-use, cannot mount


PR.

Recommended Posts

Hi,

 

Bit of an issue, I was having a problem with one core on my CPU being maxed out so I was stopping dockers trying to trace it (eventually found it was the directory caching plugin).

 

During that I set 'Enable VM's' to off, but now I can't turn it back on, the error "root: /mnt/user/system/libvirt/libvirt.img is in-use, cannot mount" is showing up in the logs.

 

I'm sure a reboot would fix the issue but wondering if there's another way?

 

Thanks

 

 

Link to comment
  • 7 months later...
  • 6 months later...
59 minutes ago, barf said:

fuser -c /mnt/user/system/libvirt/libvirt.img

ps -ef | grep pid that's using it

 

Mine was docker.  I had to stop all dockers and was able to restart kvm.

 

Did you have any docker container running that related to running VMs?  Cannot think of any other reason that libvirt.img would be in use by a docker container.

Link to comment
  • 2 weeks later...
  • 1 month later...

I also see many of my docker containers using libvirt.img when using fuser. I'm concerned whether it might be causing some of my Win10 hibernation issues. Can anyone confirm whether "fuser -c /mnt/user/system/libvirt/libvirt.img" should normally show docker pids?

Link to comment
  • 1 year later...

Did this ever get fixed?   I've got an issue with KVM not starting and doing the above fuser -c /mnt/user/system/libvirt/libvirt.img replies with a large number of processes.  Without killing them all and restarting the array/docker/server is there any other options? 

image.png

Link to comment
  • 1 month later...
On 10/25/2020 at 11:30 PM, isaw said:

Did this ever get fixed?   I've got an issue with KVM not starting and doing the above fuser -c /mnt/user/system/libvirt/libvirt.img replies with a large number of processes.  Without killing them all and restarting the array/docker/server is there any other options? 

Hi,

Same here. When I try to restart the Libvirt service I get the following error:

Dec 21 23:45:51 MOZART root: /mnt/user/system/libvirt/libvirt.img is in-use, cannot mount

... which seems to be caused by many processes:

root@MOZART:~# fuser -c /mnt/user/system/libvirt/libvirt.img
/mnt/user/system/libvirt/libvirt.img:   328   329   374cm   406   512   542m   611m   667m   726m  3948  5304c 10517c 10555c 12015 12857 12916c 13025c 13929 14060 16265 16802c 17139 17540c 17582 18255 18271c 18278c 18312 18522c 18523c 18524c 18525c 18526c 18686 18822 19091 19232c 20250 20251 20252 20253 21427c 21678 21706 21707 22021c 22564c 22580c 22581c 22805 22812m 22870m 22871m 23030m 23501 23505 23509 23526 23527 23528 23529 23530 23546m 23557e 23559e 24224 24225 24226 24246 24247 24248 24249 25821 26019c 26908 27102 27344c 27861 28083c 29489m 29531c 29601 30878 30918 30919 30978cm 31046m 32746

I have the virt-manager Docker container installed but the issue occurred while it was stopped.

I confirm that stopping the array and starting it again fixes the issue.

Best,

OP

Link to comment
  • 8 months later...

Going to bump this as I think it needs to be upgraded to a bug.

When disabling VmManager via settings it will stop, but reenabling required the docker service to stop also (the .img file is being accessed by all Dockers).  Once docker is stopped VM can be restarted, then Docker restarted.

Link to comment
On 8/31/2021 at 12:36 AM, isaw said:

When disabling VmManager via settings it will stop, but reenabling required the docker service to stop also (the .img file is being accessed by all Dockers).  Once docker is stopped VM can be restarted, then Docker restarted.

 

No reason I can think of that the libvirt.img file should ever be accessed by docker containers (in fact it should not even be visible to them I would have thought!). 

 

I have just checked on my own live system  running 6.9.2 and see similar behaviour.  My guess is they disappear when stopping the VM service as libvirt.iimg then gets unmounted.  Feels like feedback is needed from someone closer to @limetech as to whether this is a bug or expected behaviour and if it is expected behaviour the rationale so we understand what is happening.

 

EDIT:  Just checked on my development system running 6.10.0 rc2d and am not seeing this behaviour.  Not sure if that means this is a fixed bug or the development system is not running whatever triggers the behaviour. Might need  temporarily put the live system on that release to see if the behaviour disappears.

 

EDIT2:  Just brought my live system online with 6.10.0 rc2d and still see this behaviour.

 

Link to comment
  • 1 month later...
  • 2 months later...

The same happened to me after stopping the VM service, renaming the "domains" share to "vdisks" and restarting the VM service.

 

What I tried:

 

root@thoth:~# umount /mnt/cache/libvirt/libvirt.img
umount: /mnt/cache/libvirt/libvirt.img: not mounted.
root@thoth:~# /usr/local/sbin/mount_image '/mnt/cache/libvirt/libvirt.img' /etc/libvirt 1
/mnt/cache/libvirt/libvirt.img is in-use, cannot mount
root@thoth:~# fuser -c /mnt/cache/libvirt/libvirt.img
/mnt/cache/libvirt/libvirt.img:  6030m  6055m  7314m  7574m  8400m  8520m  8521m  8523m  8528m  8529m  8554m  8557m  8581m  8596m  8646m  8647m  8648m  8649m  8729m  8841m  8842m  8845m  9040m  9045m 12060m 12144m 16103m 16106m 16107m 16109m 16110m 16285m 16301m 16314m 16338m 16339m 16374m 16400m 16424cm 16446m 16455m 16479m 16488m 16658m 16659m 16662m 16663m 16678m 16893m 17537m 18805m 18818m 19679m 19680m 19681m 19682m 19683m 19684m 19685m 19686m 19687m 19688m 19689m 19690m 19691m 31769m 31843m 32152m 32155m 32195cm 32321m
root@thoth:~# ps -p 6030
  PID TTY          TIME CMD
 6030 ?        00:00:39 dockerd
root@thoth:~# ps -p 6055
  PID TTY          TIME CMD
 6055 ?        00:03:22 containerd
root@thoth:~# ps -p 7314
  PID TTY          TIME CMD
 7314 ?        00:00:00 s6-svscan
root@thoth:~# ps -p 7574
  PID TTY          TIME CMD
 7574 ?        00:00:00 s6-supervise
root@thoth:~# ps -p 8400
  PID TTY          TIME CMD
 8400 ?        00:00:00 dumb-init
root@thoth:~# ps -p 32321
  PID TTY          TIME CMD
32321 ?        00:00:06 Plex Tuner Serv
root@thoth:~# 

 

Then while and after stopping the docker service:

root@thoth:~# fuser -c /mnt/cache/libvirt/libvirt.img
/mnt/cache/libvirt/libvirt.img:  5651m  6030m  6055m
root@thoth:~# ps -p 5651
  PID TTY          TIME CMD
 5651 ?        00:00:00 s6-sync
root@thoth:~# ps -p 6030
  PID TTY          TIME CMD
 6030 ?        00:00:39 dockerd
root@thoth:~# ps -p 6055
  PID TTY          TIME CMD
 6055 ?        00:03:23 containerd
root@thoth:~# fuser -c /mnt/cache/libvirt/libvirt.img
/mnt/cache/libvirt/libvirt.img:  5651m  6030m  6055m
root@thoth:~# fuser -c /mnt/cache/libvirt/libvirt.img
root@thoth:~# 

 

 

Then I started the docker service again:

fuser -c /mnt/cache/libvirt/libvirt.img
/mnt/cache/libvirt/libvirt.img:  8869m  8893m  9644m  9788m 10066m 10067m 10071m 10072m 10088m 10096m 10197m 10198m 10199m 10200m 10201m 10202m 10203m 10204m 10205m 10206m 10207m 10208m 10209m 10210m 10271m 10630m 10788m 10789m 10790m 10793m 10794m 10806m 10807m 10825m 10841m 10842m 10843m 10844m 10925m 11227m 11259m 11262m 11325m 11472cm 11474m 11570m 11571m 11572m 11729m 11745m 11754m 11755m 11757m 11762m 11826m 11863cm

 

And started successfully the VM service, too (yes completely the same output):

fuser -c /mnt/cache/libvirt/libvirt.img
/mnt/cache/libvirt/libvirt.img:  8869m  8893m  9644m  9788m 10066m 10067m 10071m 10072m 10088m 10096m 10197m 10198m 10199m 10200m 10201m 10202m 10203m 10204m 10205m 10206m 10207m 10208m 10209m 10210m 10271m 10630m 10788m 10789m 10790m 10793m 10794m 10806m 10807m 10825m 10841m 10842m 10843m 10844m 10925m 11227m 11259m 11262m 11325m 11472cm 11474m 11570m 11571m 11572m 11729m 11745m 11754m 11755m 11757m 11762m 11826m 11863cm

 

I'd say it has nothing to do with the output of fuser. Must be something else wrong.

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.