Mounting file in CD Rom in VM guest permanently locks file

Patrick_3000

Contributor
Joined
Apr 28, 2021
Messages
167
The only way I'm aware of to mount an image file (like .iso) as a CD in a virtual machine in Scale is to add a CD-Rom device for the VM, then browse a dataset stored on Scale and select the desired image file.

The problem, however, is that from then on, even after the CD-Rom device is deleted, it's impossible to open, copy, delete, or access in any way the image file in the dataset. The file, as as far as I can tell, is permanently locked in the dataset.

This has happened with two different image files that I've mounted in a CD-Rom device in a VM: a Clonezilla Live .iso and a GParted Live .iso.

Does anyone know why files used as a CD-Rom image in a VM are subsequently locked? I have no idea how to even get rid of the locked files. Maybe I could do so my deleting and recreating the dataset that contains the files, but that would be a last resort and certainly isn't a solution for future image files that I want to mount in VMs.
 

Patrick M. Hausen

Hall of Famer
Joined
Nov 25, 2013
Messages
7,776
Did you shutdown the VMs, remove the device, start them again?
 

Patrick_3000

Contributor
Joined
Apr 28, 2021
Messages
167
Did you shutdown the VMs, remove the device, start them again?
Yes. I shut down the VM and deleted the CD-Rom device, which, as far as I can tell, is the only way to remove the CD-Rom, other than by ejecting it inside the VM, but that's only temporary as it comes back if the CD-Rom isn't deleted. After deleting the CD-Rom device, the .iso file that was previously mounted is permanently locked by Scale.
 

Patrick_3000

Contributor
Joined
Apr 28, 2021
Messages
167
I think I may have solved this, although I don't understand what caused it. I'll describe what I did in case anyone else runs into this problem.

As I noted, the problem occurs when mounting an image file (.iso) in a CD-Rom device in a VM in Scale. Later, after the CD-Rom image file is unmounted by deleting the device, the image file is locked by Scale and becomes inaccessible. It can be viewed on a Samba share, but it can't be opened or copied, and any attempt to do so from either a Linux or Windows client says "permission denied," even though the permissions appear to be correct when executing "ls -l" from a Linux client command line.

I finally got the image file unlocked by stripping ACLs recursively from the top dataset all the way down to the child dataset that contains the image file using the Scale UI. I then re-added the ACLs, and the image file was unlocked and accessible.

I then added the image file again as a CD-Rom device in the VM, for testing purposes. This time, when I went to unmount (delete the image file), I left "Force delete" unchecked, which is the only thing I did differently from the previous time that resulted in the file being locked. This time, the image file was not locked. So it seems that checking "Force delete" when deleting a CD-Rom device was the likely cause of the problem, even though I don't understand why.
 

artlessknave

Wizard
Joined
Oct 29, 2016
Messages
1,506
checking "Force delete" when deleting a CD-Rom
probably because you forced it. this means it doesnt cleanly unlock the file, because you told it not to. you should only force it if you are having issues, otherwise leave it alone because......you will cause yourself issues.
 

Patrick_3000

Contributor
Joined
Apr 28, 2021
Messages
167
probably because you forced it. this means it doesnt cleanly unlock the file, because you told it not to. you should only force it if you are having issues, otherwise leave it alone because......you will cause yourself issues.
I agree. In retrospect, it probably was the fact that I checked "force delete" that caused the problem. It probably stopped the file from being cleanly unlocked.
 
Top