October 27, 20241 yr I created a few VMs as a test and then deleted the VMs. After the deletion process, the empty directories that were created when the VM was created remain. These remaining empty directories can then no longer be deleted. I even tried to delete them via the terminal with the command "rm -fr directory" But I received the following message "rm: cannot remove 'directory': Device or resource busy" How can I now delete these directories, since there are more and more folders with each test VM ? unraid-server-diagnostics-20241027-2108.zip
October 27, 20241 yr Community Expert Are you on 7 betas likely because they are zfs datasets? You need to remove the dataset you cannot rmdir
October 27, 20241 yr Author Thanks for your reply.. But what exactly does "You need to remove the dataset" mean ? How do I remove the dataset of those directories ?
October 27, 20241 yr Community Expert 33 minutes ago, GoTraSys said: Thanks for your reply.. But what exactly does "You need to remove the dataset" mean ? How do I remove the dataset of those directories ? Suggest you install zfs master plugin as it will allow you to remove the dataset.
October 27, 20241 yr Author I found out over Google what you mean by "You need to remove the dataset" << To remove a ZFS dataset, use the zfs destroy command >> I first tried it with : "zfs destroy cache/domains/Debian" but I,ve got this message : "cannot destroy 'cache/domains/Debian': dataset is busy" I then found out that you have to unmount the dataset first and then you can remove it. 1. command : "zfs unmount cache/domains/Debian" 2. command : "zfs destroy cache/domains/Debian" So problem solved..
October 31, 20241 yr Author On 10/27/2024 at 10:09 PM, GoTraSys said: 1. command : "zfs unmount cache/domains/Debian" 2. command : "zfs destroy cache/domains/Debian" @SimonF I thought everything was ok and that it worked, but unfortunately after each reboot of Unraid the destroyed/deleted shares are back again in the Unraid GUI under "SHARES". After a reboot when I try to delete the empty folder (share) in the Unraid GUI under "SHARES" first nothing happens. I have to enter first the "zfs unmount" command in the terminal, then I can delete the folder in the Unraid GUI under "SHARES".. But in the termiminal with the command "zfs list" the data set (folder) is still there. And I can't destroy it either, I get the error message "cannot destroy 'cache/domains/Debian': dataset is busy. It seems like something is not working properly in the ZFS Pool.. Or do I miss something on my side here ? unraid-server-diagnostics-20241031-1916.zip Edited October 31, 20241 yr by GoTraSys
October 31, 20241 yr Community Expert 28 minutes ago, GoTraSys said: @SimonF I thought everything was ok and that it worked, but unfortunately after each reboot of Unraid the destroyed/deleted shares are back again in the Unraid GUI under "SHARES". After a reboot when I try to delete the empty folder (share) in the Unraid GUI under "SHARES" first nothing happens. I have to enter first the "zfs unmount" command in the terminal, then I can delete the folder in the Unraid GUI under "SHARES".. But in the termiminal with the command "zfs list" the data set (folder) is still there. And I can't destroy it either, I get the error message "cannot destroy 'cache/domains/Debian': dataset is busy. It seems like something is not working properly in the ZFS Pool.. Or do I miss something on my side here ? unraid-server-diagnostics-20241031-1916.zip 132.48 kB · 0 downloads The code that has been added is as follows to remove VM Datasets. $zfsdataset = trim(shell_exec("zfs list -H -o name ".escapeshellarg($dirname))) ; $cmdstr = "zfs destroy \"$zfsdataset\" 2>&1 "; Can you provide the output of zfs list -H -o name /mnt/user/domains/Debian
March 26, 20251 yr I had this exact same issue. Searched for hours with no responses to help as of yet. I think I found your answer! On the "Main" tab of the web GUI, you should have a "ZFS Master" section. On the far right of this, click the little gear for "ZFS Master Settings" The 4th option in this screen is called "Destructive Mode", which by default is set to "No" Change this to "Yes" Now to back to the "Main" screen in the GUI. If you click the "Actions" to the right of the domain in ZFS Master, you should now have the option to "Destroy" I did this, and it deleted these empty folders! I hope this helps others with a simple, yet frustrating issue.
March 26, 20251 yr Community Expert @SimonF Not sure if it's intended or not but creating a VM, when the domain share is located in a ZFS pool, creates a dataset which I assume is part of the VM Snapshotting feature where VM snapshots are supposed to end up when a user takes a snapshot. However this dataset is created upon VM creation. I, like others, probably assume it's a bug when an empty "folder" is found in the domain share with the name of the VM on it. Edited March 26, 20251 yr by MowMdown
March 26, 20251 yr Community Expert 13 minutes ago, MowMdown said: @SimonF Not sure if it's intended or not but creating a VM, when the domain share is located in a ZFS pool, creates a dataset which I assume is part of the VM Snapshotting feature where VM snapshots are supposed to end up when a user takes a snapshot. However this dataset is created upon VM creation. I, like others, probably assume it's a bug when an empty "folder" is found in the domain share with the name of the VM on it. Unlike btrfs rmdir does not work on datasets, If the VM is removed via the gui the dataset should be removed if there is a single image file. If more than one only the first is removed and the directory/dataset is left along with the other images, plan to allow delete all in the future. How was it emptied. it needs to be a data set to support ZFS native snapshots either via the GUI or other solution so all VMs dirs on zfs are Datasets now.
March 26, 20251 yr Community Expert Let me preface this by saying Im not the OP. Just someone who "figured out" why an empty "folder" exists named after the VM. 26 minutes ago, SimonF said: Unlike btrfs rmdir does not work on datasets Correct, this I understand. (It would be nice if the GUI's built in file navigation/browser (not zfs master) could differentiate normal directories from datasets) 26 minutes ago, SimonF said: How was it emptied. It never contained any visible data. It's just an empty dataset created when the VM is created. For example, If I create a VM called "Windows 11" (true story) VM Manager creates a dataset in my domain share named "Windows 11" just like the VM. Nothing ever appears in this dataset. I assume this dataset is supposed to house any VM Snapshots I take of this VM. I cannot take VM snapshots because I use a physical disk instead of a virtualdisk.img. I will say if you stop the VM Manager from the settings and do a zfs destroy on the dataset, the VM Manager gets really angry. If you would like me to create a bug thread, I can post this over there so we can separate it from here. Edited March 26, 20251 yr by MowMdown
March 26, 20251 yr Community Expert 23 minutes ago, MowMdown said: For example, If I create a VM called "Windows 11" (true story) VM Manager creates a dataset in my domain share named "Windows 11" just like the VM. Nothing ever appears in this dataset. This was a bug in 7.0.0, it should no longer happen with 7.0.1, for new VMs, of course.
March 26, 20251 yr Community Expert 1 hour ago, MowMdown said: Let me preface this by saying Im not the OP. Just someone who "figured out" why an empty "folder" exists named after the VM. Correct, this I understand. (It would be nice if the GUI's built in file navigation/browser (not zfs master) could differentiate normal directories from datasets) It never contained any visible data. It's just an empty dataset created when the VM is created. For example, If I create a VM called "Windows 11" (true story) VM Manager creates a dataset in my domain share named "Windows 11" just like the VM. Nothing ever appears in this dataset. I assume this dataset is supposed to house any VM Snapshots I take of this VM. I cannot take VM snapshots because I use a physical disk instead of a virtualdisk.img. I will say if you stop the VM Manager from the settings and do a zfs destroy on the dataset, the VM Manager gets really angry. If you would like me to create a bug thread, I can post this over there so we can separate it from here. when you create a VM the directory is created because if you use disk images that is where they are stored by default. It should remove the dataset if you delete the VM.
March 27, 20251 yr Community Expert 6 hours ago, SimonF said: when you create a VM the directory is created because if you use disk images that is where they are stored by default. It should remove the dataset if you delete the VM. No the disk image goes into a separate directory along side the dataset. IIRC Two folders get created or the vdisk.img went to a different location. Either way the dataset named after the VM never contained any data. Another thing is I never use capital letters for directories/datasets, this specific dataset had capitalized W. Edited March 27, 20251 yr by MowMdown
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.