Skip to content
View in the app

A better way to browse. Learn more.

Unraid

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Why is libvirt.img "special" when it comes to moving shares to new cache pool?

Featured Replies

  • Community Expert

Hi folks, long time user here.  Upgraded to 6.12 and then 6.12.2 and decided to create a 4-drive SSD ZFS RaidZ pool using some enterprise grade SSDs I was given, and use that pool for all my VMs and Docker containers.

 

Everything went great, except when I moved the libvirt.img file from the old cache pool to the new zfs pool.  Here's what I did:

  1. Set the system share to use the new ZFS pool
  2. Shut down the Docker engine via Settings-->Docker
  3. "mv /mnt/cache/system/docker /mnt/zfs-cache/system"
  4. Restarted Docker - no issues.
  5. Shut down the VM engine via Settings-->VM Manager
  6. "mv /mnt/cache/system/libvirt /mnt/zfs-cache/system"
  7. Validated that the file exists within /mnt/user/system/libvirt but physically exists only on the ZFS pool
  8. Attempted to restart the VM engine

 

This gave me "libvirt service failed to start" and the system logs gave me a bunch of errors about btrfs saying that the "file already existed" and information about /dev/loop4 and duplicate entities.  

 

Quote

Jul 10 13:13:47 UNRAID emhttpd: shcmd (399): /usr/local/sbin/mount_image '/mnt/user/system/libvirt/libvirt.img' /etc/libvirt 1
Jul 10 13:13:47 UNRAID kernel: loop4: detected capacity change from 0 to 2097152
Jul 10 13:13:47 UNRAID root: mount: /etc/libvirt: mount(2) system call failed: File exists.
Jul 10 13:13:47 UNRAID root:        dmesg(1) may have more information after failed mount system call.
Jul 10 13:13:47 UNRAID kernel: BTRFS warning: duplicate device /dev/loop4 devid 1 generation 2818 scanned by mount (31598)
Jul 10 13:13:47 UNRAID root: mount error

 

The issue went away after the reboot, but, why did it happen in the first place?  I did not have this issue when I moved the docker.img file.


Diagnostics file also attached.

unraid-diagnostics-20230710-1317.zip

Edited by Kaldek
Added context for people who might assume too much.

  • Community Expert
7 hours ago, Kaldek said:
  • Shut down the Docker engine via Settings-->Docker
  • "mv /mnt/cache/system/docker /mnt/zfs-cache/system"
  • Restarted Docker - no issues.
  • Shut down the VM engine via Settings-->VM Manager
  • "mv /mnt/cache/system/libvirt /mnt/zfs-cache/system"
  • Validated that the file exists within /mnt/user/system/libvirt but physically exists only on the ZFS pool
  • Attempted to restart the VM engine

It's common for it to fail when you stop and restart the VM engine while Docker is running, there's an issue for it on the forum. Need to also stop docker after stopping VM or libvirt doesn't get properly released, that may be what you ran into since you didn't do both in one go. 

Edited by Kilrah

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...

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.