Delete old share folder in /mnt2

Does anyone know how to delete an old share dir out of /mnt2 via cli? I deleted a share via the gui but the empty dir is still in /mnt2. I verified it’s unmounted, reboot, etc. It looks like an empty folder, but I can’t delete it. I even tried btrfs subvolume delete, no dice. It’s not breaking anything. Just my cleanup OCD.

[root@rstor mnt2]# umount nfs01
umount: nfs01: not mounted
[root@rstor mnt2]# rmdir nfs01
rmdir: failed to remove ‘nfs01’: Operation not permitted
[root@rstor mnt2]# btrfs subvolume delete /mnt2/nfs01
ERROR: not a subvolume: /mnt2/nfs01
[root@rstor mnt2]# chmod 777 /mnt2/nfs01
chmod: changing permissions of ‘/mnt2/nfs01’: Operation not permitted
[root@rstor mnt2]# ls -ltah nfs01
total 0
drwxr-xr-x 1 root root 394 Mar 29 04:56 …
drwxr-xr-x 1 root root 0 Mar 28 16:14 .
[root@rstor mnt2]# stat nfs01
File: ‘nfs01’
Size: 0 Blocks: 0 IO Block: 4096 directory
Device: 27h/39d Inode: 120425 Links: 1
Access: (0755/drwxr-xr-x) Uid: ( 0/ root) Gid: ( 0/ root)
Access: 2017-03-29 04:13:49.955003670 -0700
Modify: 2017-03-28 16:14:50.174959630 -0700
Change: 2017-03-29 03:46:24.093963480 -0700
Birth: -
[root@rstor mnt2]#

Did you tried:

rm -rf directoryName

yeah, same error:

rm: cannot remove ‘nfs01’: Operation not permitted


I replicated your problem and indeed you can’t delete a share made via the “RockSTOR” ui. If you make a directory with “mkdir” on the file system then it’s no problem to remove it. Not sure, but has “RockSTOR” some failsafe protection…

Figured it out. In case anyone is trying to do the same:

chattr -i 'foldername’
rmdir ‘foldername’

For me I did:

chattr -i nfs01
rmdir nfs01

Hi @mrseth1, thanks for the update! I didn’t know of the command “chattr”. Learned something new. :thumbsup: