NETGEAR is aware of a growing number of phone and online scams. To learn how to stay safe click here.
Forum Discussion
nickjames
Sep 04, 2022Luminary
Windows SMB created folder undeletable
At one point I started creating folders in the root directory of my RN via Windows SMB instead of creating shares on the RN. I'm trying to delete one of those SMB folders that I created. It successfully deletes but reappears moments later. How can I permanently delete this folder?
nickjames wrote:
When I rerun that command, snapper list-config, all of the subvolumes shown match the GUI and Windows with the exception of NOT seeing Test123 in the SSH session.
My guess here is that you renamed the original share folder to Test123 from Windows. Then you deleted the share from the NAS admin UI. That would generate an error because the share folder no longer existed. But it appears to have deleted the share from the ReadyNAS database, and also deleted the snapshot configuration.
Before you can delete Test123, you need to delete all the snapshots that it has. If you had a snapper config, you could have deleted them as a group. But since you don't, they need to be deleted one at a time. From your earlier btrfs subvolume list /RAID50.6x2TB | grep -i Test123 we can see 83 snapshots that need to be deleted.
The first "real" snapshot in your older post has a path of Test123/.snapshots/10/snapshot
To manually delete that one, enter btrfs subvolume delete -c /RAID50.6x2TB/Test123/.snapshots/10/snapshot
It could take a while for the deletion to complete (not sure how long).
If it does complete with no error, proceed to the next one (/RAID50.6x2TB/Test123/.snapshots/41/snapshot. Continue until you delete them all (ending with /RAID50.6x2TB/Test123/.snapshots/1517/snapshot). Note if you use the up arrow key on the keyboard, you will see the previous command. You can then use the left and right arrows to position the cursor, and change the numeric value (10 to 41, etc until you get to 1517). That should reduce the amount of typing.
When they are all done, then enter btrfs subvolume delete -c /RAID50.6x2TB/Test123/.snapshots to delete the .snapshots folder and finally btrfs subvolume delete -c /RAID50.6x2TB/Test123/ to delete the share.
15 Replies
nickjames wrote:
At one point I started creating folders in the root directory of my RN via Windows SMB instead of creating shares on the RN. I'm trying to delete one of those SMB folders that I created. It successfully deletes but reappears moments later. How can I permanently delete this folder?
Are you certain this is a folder you created? There are some folders that aren't shares, but still are folders created by the NAS - Home of course, but also some hidden folders.
It sounds like some process is actively using the folder, and recreating it when it isn't found.
Have you tried ssh?
- nickjamesLuminary
Hi StephenB - Yes, I'm certain that I created it. I had never tried SSH until today. I'm not able to get it to remove but my SSH skills aren't the best. Here is some of the output:
root@DUMPSTER:/RAID50.6x2TB# ls
... Test123
root@DUMPSTER:/RAID50.6x2TB# rm -rf Test123
rm: cannot remove 'Test123': Directory not empty
root@DUMPSTER:/RAID50.6x2TB# ls Test123
root@DUMPSTER:/RAID50.6x2TB# rm -rf Test123/
rm: cannot remove 'Test123/': Directory not empty
root@DUMPSTER:/RAID50.6x2TB# ls
... Test123
root@DUMPSTER:/RAID50.6x2TB#
nickjames wrote:
root@DUMPSTER:/RAID50.6x2TB# rm -rf Test123
rm: cannot remove 'Test123': Directory not empty
root@DUMPSTER:/RAID50.6x2TB# ls Test123
root@DUMPSTER:/RAID50.6x2TB# rm -rf Test123/
rm: cannot remove 'Test123/': Directory not emptyCan you try ls -als Test123
Maybe also try setting verbose mode on the rm command: rm -vrf Test123
Related Content
NETGEAR Academy

Boost your skills with the Netgear Academy - Get trained, certified and stay ahead with the latest Netgear technology!
Join Us!