2

I have a couple of folders on an NAS storage device which have been emptied of data and I would like to remove them. When attempting to delete them, I get an error message saying "The action can't be completed because the folder or a file in it is open in another program".

Both folders are empty. I have enabled the Show hidden files, folder or drives in the Explorer View options and the folders are still empty. I have used Beyond Compare to view the folder contents and the folders are still empty. I have searched the folders using Process Explorer and Lock Hunter to try and free them up but they have both found no locking processes.

I need these gone, what can I do now?

EDIT: I can connect to the NetApp via SSH

K7AAY
  • 9,725
Rich M
  • 398
  • 1
  • 4
  • 19

2 Answers2

8

The folder is locked by something, but you can't find out what. or where the lock comes from.

Given that the folder is located on a NAS, the easiest solution is to simply reboot the NAS to remove the lock, and immediately after remove the folder.

If possible, it is advised to use the web interface of the NAS to remove the folder, to prevent your explorer to set a lock to the folder preventing you from deleting the folder after the reboot. (I know this is not possible in your case, but others who stumble upon this question and answer may have that ability)

Even in a business environment with many people using the NAS, there always is a moment where you can perform a maintenance reboot. Usually everyone leaves after hours, so the action can be performed then. If people work even after hours, then schedule the reboot, and announce it company wide that the NAS will be rebooted for maintenance. Usually lunch time is a moment when this can be done, otherwise after hours is another option.

Tell them to close all files to prevent losing data and just reboot the NAS. People who still had files open but were warned only have to blame themselves.

LPChip
  • 66,193
0

Have finally resolved this enigma. The problematic sub-folders were being shared specifically on the NetApp, along with the root share. Removing the "sub" share from the NetApp allowed the folders to be deleted.

Open NetApp OnCommand Manager and browse to the relevant controller.
Expand the Storage node.
Click on the Shares node.
Find the relevant share in the right-hand pane.
Right-click on the share and select "Stop sharing".
Confirm your selection.

You must follow this process. Rebooting will not work as the shares are persistent, i.e. they are programmed to remain after a reboot. If they did not, you would have to set up all of your shares again each time you rebooted, not a good place to be if you have a lot of shares.

Rich M
  • 398
  • 1
  • 4
  • 19