Rm -rf


 
Thread Tools Search this Thread
Top Forums UNIX for Beginners Questions & Answers Rm -rf
# 1  
Old 12-04-2017
Rm -rf

Good Morning,

I'm running a script on Solaris 9 that deletes files on a Linux based NAS. I use rm -rf to do it, but it takes over a day to complete- there is a lot of data. Does anyone know of anything quicker?

Last edited by rbatte1; 12-05-2017 at 08:09 AM.. Reason: Changed CODE tags to ICODE tags to ease the reading flow
# 2  
Old 12-04-2017
Well you don't say exactly what NAS software, but I guess working on the NAS web(??) interface you could dismount the volume, format it, and remount it. If you really, really want to get shot of everything.

If not, please explain.
# 3  
Old 12-04-2017
Thanks.. Its an Iomega Storcenter NAS. I can't get rid of everything, only deleting some directories periodically.
# 4  
Old 12-04-2017
Quote:
Originally Posted by Stellaman1977
it takes over a day to complete- there is a lot of data.
More than 'a lot of data', I suspect there is 'a lot of files'. Piling thousands upon thousands of files in one directory is particularly slow.
# 5  
Old 12-04-2017
How are the files organized?
Having a million files in in one folder can be EXTREMELY slow, dependent on the file system type in the NAS box. And Solaris might cause an additional delay. It makes sense to distribute the files into a folder hierarchy so there is less than a thousand files per folder.
# 6  
Old 12-05-2017
Looking at reviews of Iomega Storcenter on the web it's not renowned for its performance.

However, what is the network connection between the machines? Can it run any faster? Like increase from 100Mb/s to 1000Mb/s?

Are there any network devices between the systems (eg, hubs, switches) that are slowing the connection down?

Can you increase the cache size on the NAS configuration?

IN PARTICULAR, can you change the cache setting from write-through to write-back? If so, that might make a big difference.

Oh, and what network adapter(s) are you using? Is there something in that BIOS that will improve performance? How many network interfaces does the NAS have? Could you consider teaming interfaces at each end?
# 7  
Old 12-05-2017
Using just rm -rf by itself won't actually do anything. You need to give it something to work on. If this is based on a find command, a driving file or something else can you show us what you are actually using?

You may get slightly better performance from putting multiple files on the command line, but not necessarily noticeable. if you have great chunks of data to delete, it might be better to split up your NAS provided storage and have separate filesystems. That way you can follow the suggestion of hicksd8 in post 2.

How is your data arranged?




Robin
Login or Register to Ask a Question

Previous Thread | Next Thread
Login or Register to Ask a Question