mdbooth / libldm

GNU General Public License v3.0
28 stars 15 forks source link

Unable to mount multiple volumes with the same UUID #24

Closed takeshibaconsuzuki closed 1 month ago

takeshibaconsuzuki commented 5 months ago

We use ldmtool to mount LDM volumes from VM disk images. Sometimes, we need to mount multiple LDM volumes with the same UUID. This can happen when we mount multiple snapshots of a VM, or when we are mounting multiple VMs cloned from the same template.

Up till 0.2.4, devices were found using the name instead of UUID. So we were able to deduplicate the devices by renaming them after creation. In 0.2.5, there was a commit which changed to using UUID to find devices: https://github.com/mdbooth/libldm/commit/45a47d7b2154ae348615864c828f43583e2a427a. This poses a problem for us since device mapper does not let us change the UUID once it is set: https://man7.org/linux/man-pages/man8/dmsetup.8.html.

Some solutions that come to mind are: 1) option to switch back to finding devices by name 2) option to specify UUID to set during device creation 3) option to leave UUID unset so the caller can set it later

What are your thoughts on this?

rwmjones commented 4 months ago

No one is working on libldm, so I suggest a better approach is to suggest patches.

takeshibaconsuzuki commented 4 months ago

Thank you for the response @rwmjones. I have written a patch to allow a user specified UUID for device mapper operations. Can you take a look or assign someone for review? Thanks!

takeshibaconsuzuki commented 1 month ago

@rwmjones Any feedback on this? Are we able to get someone to review the pull request? Thanks!

rwmjones commented 1 month ago

I merged it now.