ONTAP Discussions

large files and folder deletion from netapp command

Puru01

Hi

does anyone knows better way to delete a folder inside a share fro example. a is share and it has x,y,z folder. i want to delete a folder y from a from only - how would i can do it by Netapp cli since it is large folder and need some time to delete it .

any commands and method from ontap side only

 

Thanks 

Puru

1 ACCEPTED SOLUTION

ttran

Hello @Puru01 ,

 

Here is reference material on the ONTAP 9.8 Fast Directory Delete feature @TMADOCTHOMAS mentioned: Perform a fast directory delete by deleting files and directories asynchronously 

 

As always thank you @TMADOCTHOMAS !

 

Regards,

 

Team NetApp

Team NetApp

View solution in original post

7 REPLIES 7

Ontapforrum

Hi,

 

I don't think there is a way from ONTAP CLI to delete a folder (which is non-empty), you can list the folder and delete files but not empty directory. In any case, it is NOT recommended from NetApp CLI.  Please delete folder/files from the client side.

 

I think efficient way would be to delete using command line from either Windows or Linux side without enumerating.

For NFS it's not an issue, for CIFS I find it easier to map "share" using SMB to linux client, once you have cifs shares mounted on linux you can use these or any other command (from google) to get rid of large directory.

 

From linux: (For ex- Deleting folder 'x')
/]# rm -rf /share/directory/x
/]# rsync -a --delete /mnt/empty/ /mnt/share/directory/x

 

Thanks!

maffo

hi @Puru01 

as pointed out previously, you cannot delete specific folder/files from ONTAP directly, the only exception is if the folder in question is a qtree created by ONTAP in which case it can be deleted from ONTAP too.

EWILTS_SAS

We are a large NFS shop and delete tens of millions of files every day.  By far, the fastest method we have found is NetApp's XCP tool using the delete option.

 

We haven't researched any methods for CIFS shares but there is a Windows version of XCP - you might want to check out to see if that has a delete feature as well.

TMADOCTHOMAS

@Puru01 , FYI there's a new feature in OnTAP 9.8 and above called Fast Directory Delete that finally adds the ability to delete large directories from within OnTAP. I've not used it but I'm reading up on it now.

EWILTS_SAS

The Asynchronous Directory Delete in ONTAP is not faster than NFS XCP.  It offloads the workload, which can be significant, but it is slower.   It does have a throttle option but even wide open, it loses the race to XCP.  You're limited to a single delete job on the cluster at any one time (we regularly do multiple XCP deletes simultaneously over NFS).  Which tool you use depends on your requirements - do you want the fastest delete possible (with possible performance impacts) or are you ok with slower, less impactful deletes?

TMADOCTHOMAS

Makes sense, thanks @EWILTS_SAS !

ttran

Hello @Puru01 ,

 

Here is reference material on the ONTAP 9.8 Fast Directory Delete feature @TMADOCTHOMAS mentioned: Perform a fast directory delete by deleting files and directories asynchronously 

 

As always thank you @TMADOCTHOMAS !

 

Regards,

 

Team NetApp

Team NetApp
Public