ONTAP Discussions

Efficient method for deleting a large amount of data

bktrimble84
6,642 Views

Hello,

 

We're running OnTap 8.2.1. I was looking for a system side command I could use to browse cifs shares and remove a particular folder under a root share as opposed to navigating the share from Windows, but I haven't seen anything. I'm curious if anyone here has a tip/trick for removing overly complex, deep/large folder structures without just removing the entire share?

 

So far it's taking 20+ minutes to discover the folders content from a windows client before the system starts to delete anything.

 

The structure looks similar to the following:

 

Groups (top level folder/share)

-Group1 (1TB, 250k+ files)

-Group2 (2TB 1M+files)

-Group3 ( 1.8TB 500k+ files)

 

The "group 2" folder would be the one I'd like to remove.

 

Appreciate any assistance you could provide.

 

-Brian

 

 

3 REPLIES 3

Sahana
6,603 Views

Hi,

 

Refer KB 2017624 BUG 599967:CIFS or NFS operations are delayed due to concurrent deletions of many large files

If this post resolved your issue, help others by selecting ACCEPT AS SOLUTION or adding a KUDO.

KieranMcKenna
6,318 Views

Hi Brian,

 

I do *lots* of CIFS / NAS Folder and File re-structuring, and for *years* have been wanting a controller-side feature for deleting QTREE + data or deleting volume subfolder(s) + data.

 

There is a 'QTREE delete' command available (I think only a GUI feature) but it only deletes *empty* QTREEs - you have to have previously used a Windows/Linux host to delete the actual data.

 

From your question notes, it looks like you are trying to use Windows Explorer/GUI to delete large folders (+subfolders and files). The drawback of which is that Win Explorer has to enumerate the data before starting the actual delete process.

 

Instead, you can use the 'RMDIR' command from the Windows Command line. It skips the enumeration process and starts deleting files and folders immediately.

 

eg to delete a 2TB size second-level folder (and all subfolders and data) under a top level network share called 'Projects' :

 

c:>RMDIR /S /Q \\server\Projects\second-level

 

/S = (run recursively on all subfolders, files) /Q = (quiet mode, disable confirmations)

 

Thats it - the command will traverse the subtree and delete the data.

OZWALKERZ
5,938 Views

Powershell has a command to delete *whole* qtrees from C-mode controllers

 

remove-ncqtree 

 

It wil need the -FOrce to delete a qtree that is not empty

EG:

Remove-NcQtree -VserverContext myvserver -Volume myvol -Qtree myqtree -Force 

 

To remove subdirectories, you have to delete all files therein first... 

Read-NcDirectory, then interate into any sub directories and remove-ncfile/remove-ncdirectory

 

Just having problems at the moment working out what permissions I need to give a user/role to delete files!

Cheers,

Stuart

Public