- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: rm -r command is very slow
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Discussions
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-18-2004 07:12 AM
10-18-2004 07:12 AM
rm -r command is very slow
I just saw this question in the humor section of questions you do not want your System Administrator to ask. Fortunately, I am not running this command from /:)
I created a 113GB partition on our newly purchased StorageWorks SAN. The area I created is /SANDISK/vol1. I went ahead and populated this area with about 80GB of junk data (tons of files) to do some tests. The access time is excellent and I am now ready to move the real data that I want there. I decided to clean up the area. I know that I could have just unmounted the area and done a newfs on the raw device file, but I decided to use the "rm" command instead. Why the heck does it take so long to complete? I did the following:
%cd /SANDISK/vol1
%rm -r *
This command took 4 hours to complete. A newfs would probably have only taken about a minute to complete. The problem is that newfs wipes out everything, and sometimes we have to remove large amounts of data in pieces. Is there something I can do to speed this up?
Thanks,
Brian Whyte
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-18-2004 07:21 AM
10-18-2004 07:21 AM
Re: rm -r command is very slow
I have also noticed the phenomenon when on large filesystems with numerous files and I have opted for recreating a new FS when I know I dont want anything on the old FS...
My ratio was 30 min vs 2 min (well it takes me 30s already to type...)
something else I noticed was the CPU consumption which made me favor for remove and newfs...
All the best
Victor
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-18-2004 07:21 AM
10-18-2004 07:21 AM
Re: rm -r command is very slow
Unless you run multiple rm commands in the same directory, it's not possible to speed up as it has to unlink so many files but one by one. It has little to do on how fast your disk system is. I would do something like this.
%cd /SANDISK/vol1
%rm -rf dir1&
%rm -rf dir2&
%rm -rf dir3&
And see how long it takes now.
-Sri
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-18-2004 07:22 AM
10-18-2004 07:22 AM
Re: rm -r command is very slow
mark
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-18-2004 07:23 AM
10-18-2004 07:23 AM
Re: rm -r command is very slow
Just to add, I do not think that we have any hard links. I have never created a hard link. Not sure that it would matter this much anyway.
Thanks,
Brian Whyte
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-18-2004 07:28 AM
10-18-2004 07:28 AM
Re: rm -r command is very slow
Goodness! You guys are quick. I could try removing directory by directory, but since there are a 100 directories, I'd rather not type that command 100 times.
Regards,
Brian Whyte
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-18-2004 07:38 AM
10-18-2004 07:38 AM
Re: rm -r command is very slow
You could try writing a listing of the files to a text file, then sort the file alphabetically descending - place a "rm" on each line and execute it as a script. In VMS, this would make the process go from hours to minutes.