SOLVED cant remove folder rm -rf gives device or resource busy

Joined
Jun 24, 2017
Messages
338
Kind of a bit of a weird one for me. Using TrueNAS Scale 22.02.0.1 I had some issues with permissions in SABNzbD. fought that for a little while and decided just to scrap and rebuild my downloads folder.

Problem is, i cant for some reason.
Ive tried rm -rf for the folder, ive tried stopping all apps and making sure nothing was accessing the folder, ive tried lsof +D /downloads, with no results (like nothing is accessing the folder), ive tried unmounting the path (its not mounted), ived tried fuser /downloads to see if any user is accessing it (no one is)... im kind of running out of tricks here :)

i should point out, the folder is currently empty.

Any ideas?
 
Joined
Jun 24, 2017
Messages
338
Oh man, sometimes you just need to repeatedly hit yourself in the head with a hammer until the answer comes...

I had the folder created as a dataset. THAT is why i couldnt just CLI delete it. Not sure why it wouldnt flag the folder as in use by the system or root user though...
 

grizzco

Cadet
Joined
Aug 1, 2022
Messages
4
Thank you for posting this! Otherwise, I would have never figured it out. It's nice to know I'm not the only one to ever had this issue.
 
Joined
Dec 23, 2022
Messages
9
Oh man, sometimes you just need to repeatedly hit yourself in the head with a hammer until the answer comes...

I had the folder created as a dataset. THAT is why i couldnt just CLI delete it. Not sure why it wouldnt flag the folder as in use by the system or root user though...
Also, thank you for posting this. I was pulling my hair out trying to figure out what was going on. This immediately fixed my issues. I can't even remember setting my folder up as a Dataset. lol
 

Simuman

Cadet
Joined
Sep 14, 2022
Messages
3
Thx, guess I'm not the only one pulling hair out, not that I've got that much left. :smile:
 

anodos

Sambassador
iXsystems
Joined
Mar 6, 2014
Messages
9,554
A quick tip for cases where FS operations through shell aren't working as expected, try df -Th <path>

Code:
root@carl[~]# df -Th /mnt/dozer/SHARE/ix-applications
Filesystem                  Type  Size  Used Avail Use% Mounted on
dozer/SHARE/ix-applications zfs   755M  5.4M  750M   1% /mnt/dozer/SHARE/ix-applications


This shows the FS mounted under the path as well as usage info.

Code:
root@carl[~]# df -Th /mnt/dozer/SHARE/Finder\ Refresh.app
Filesystem     Type  Size  Used Avail Use% Mounted on
dozer/SHARE    zfs   793M   44M  749M   6% /mnt/dozer/SHARE


The Filesystem is your ZFS dataset name, which you can use to investigate properties.
 
Top