Cannot Delete folder "Directory Not Empty"

N8_TheGreat

Dabbler
Joined
May 31, 2014
Messages
10
Hello FreeNAS community, I am looking for some guidance as I am not sure what else to do. I have a RAIDZ2 pool setup with 2 vdevs @ 7 drives per. The system had some Checksum errors due to corrupted files migrated from an old pool. Because of this I need to delete the old files/folders and clear the zpool status to resilver. My drives are all good as they have all been tested individually. I have removed all of the files and folders that were corrupted except for one folder. When I go to the folder and try to delete the directory I get the error "Directory not empty". I have tried deleting the folder with the following:

Code:
rm -rf test
rmdir test


Both commands don't work. There are no files in the directory, which I have confirmed with ls -l. I cannot make any files or folders in the directory, but I can change the name of it. Additionally, I have attempted changing the permissions and owner to root and 7777, but this hasn't seemed to make a difference. I have been logged in as root for every attempt.

The folder exists in my plex jail. I have also tried stopping all jails and rebooting to no avail. I have also attempted a resilver multiple times which has not changed anything. I desperately need to get this folder deleted so I can resilver and clear the errors. Any help would be greatly appreciated


HARDWARE:
SUPERMICRO X9SRL-F ATX Server Motherboard​
Intel Xeon CPU E5-2660​
128GB ECC RAM, 8x 16GB Sticks​
15x Seagate Exos 16TB HDDs, 7x7 RAIDZ2 with 1x Hot Spare and 1x 128GB SSD Cache​
 

P4#0383

Dabbler
Joined
Dec 21, 2019
Messages
39
@N8_TheGreat

Have you tried removing plex plugin?
I had the same issue with NexClout and I discovered the plug in was locking the folder due to the plugin lock call to the folder.
I would recommend to dig into the messages logged in /var/log and see if you there anything there that indicates an error.
You might have a plex folder under /var/log/plex, if you do, you can either run tail or grep -iR 'failure/error' /var/log/plex/.
 

joeschmuck

Old Man
Moderator
Joined
May 28, 2011
Messages
10,972
Perform a ls -all and report the results.

But you are correct, rm -rf temp should remove all files and recursive directories.

Have you tried to reboot and try to remove again? Have you tried the full path name?
The folder exists in my plex jail.
Are you trying to delete from within the jail or outside the jail? If from within, try it from outside the jail, it's easy to do.
 

N8_TheGreat

Dabbler
Joined
May 31, 2014
Messages
10
Perform a ls -all and report the results.

But you are correct, rm -rf temp should remove all files and recursive directories.

Have you tried to reboot and try to remove again? Have you tried the full path name?

Are you trying to delete from within the jail or outside the jail? If from within, try it from outside the jail, it's easy to do.

I ran ls -all and got the following total 0. Yes I have rebooted many times and have used the full path name many times too.

I am trying to delete it as root outside the jail, but I have also started the jail and tried deleting it from inside too.
 

N8_TheGreat

Dabbler
Joined
May 31, 2014
Messages
10
@N8_TheGreat

Have you tried removing plex plugin?
I had the same issue with NexClout and I discovered the plug in was locking the folder due to the plugin lock call to the folder.
I would recommend to dig into the messages logged in /var/log and see if you there anything there that indicates an error.
You might have a plex folder under /var/log/plex, if you do, you can either run tail or grep -iR 'failure/error' /var/log/plex/.

I really don't want to delete the plex jail as I have a lot of metadata from over that years and I really don't want to go down that route if I can help it. Plus all I need is to delete one folder. Also, if plex is stopped, then how would it be interfering with rm -rf ran by root. I'll look to see if I see any logs, but I don't see how that it would matter if plex is stopped
 

joeschmuck

Old Man
Moderator
Joined
May 28, 2011
Messages
10,972
I ran ls -all and got the following total 0.
Huh? That is not the correct output I was expecting. It should have provided a complete listing of the jail directories and the permissions where "temp" is located, assuming you are running the command from the jail level directory.
 

N8_TheGreat

Dabbler
Joined
May 31, 2014
Messages
10
Huh? That is not the correct output I was expecting. It should have provided a complete listing of the jail directories and the permissions where "temp" is located, assuming you are running the command from the jail level directory.
I ran that on the folder temp. Should I run it from a higher directory? Its pretty deep inside the jail so running it from the jail root would be massive
 

N8_TheGreat

Dabbler
Joined
May 31, 2014
Messages
10
The full path is
Code:
/plexpass/root/usr/local/plexdata-plexpass/Plex Media Server/Metadata/TV Shows/4/19ff7649f1809f000c684bf8c0a9093013f2a03.bundle/Contents/_combined/seasons/9/episodes/1/test
 

P4#0383

Dabbler
Joined
Dec 21, 2019
Messages
39
I really don't want to delete the plex jail as I have a lot of metadata from over that years and I really don't want to go down that route if I can help it. Plus all I need is to delete one folder. Also, if plex is stopped, then how would it be interfering with rm -rf ran by root. I'll look to see if I see any logs, but I don't see how that it would matter if plex is stopped

Understand that, it is long a tedious way.
If memory serve me well, killing Plex plugin might kill the jail as well. You might have to restart the plug-in to run the jail.
Getting the PID use: jls
Then you can try: jexec JID /bin/tcsh and then try to delete the folder from within the jail?
That might help on deleting the folder test.
 

N8_TheGreat

Dabbler
Joined
May 31, 2014
Messages
10
So my solution was to install a new plex plugin and transfer my metadata over. I have had bad experience with that before so I was avoiding doing it, but it worked seamlessly this time. Once I verified everything was working in the new plugin I decided to delete the old jail... which worked to get rid of that folder. I am now resilvering without any errors so far!... knock on wood!
 

N8_TheGreat

Dabbler
Joined
May 31, 2014
Messages
10
So my solution was to install a new plex plugin and transfer my metadata over. I have had bad experience with that before so I was avoiding doing it, but it worked seamlessly this time. Once I verified everything was working in the new plugin I decided to delete the old jail... which worked to get rid of that folder. I am now resilvering without any errors so far!... knock on wood!
BTW... I used RSYNC to move the metadata which worked great!
 
Top