- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Deleting massive directories quickly
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
Discussions
Discussions
Discussions
Forums
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
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
тАО03-08-2002 01:07 AM
тАО03-08-2002 01:07 AM
Deleting massive directories quickly
I have two directories on a HP9000 running HPUX10.20.
These directories have 400000 and 700000 files in each of them respectively. I need to remove both of these. I started this last night, but the rm can only delete about 500 files a minute. These that the rm would be running over 20 hours to remove the directory with 700K files, and probably 15hours for the other one. Can anyone tell me of a quicker way to "zap" a directory than this!
Regards,
Dermot.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-08-2002 01:13 AM
тАО03-08-2002 01:13 AM
Re: Deleting massive directories quickly
if these diretories are extra mounted (/etc/fstab) i would umount, recreate with newfs ... and mount back the directory.
Regards
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-08-2002 01:31 AM
тАО03-08-2002 01:31 AM
Re: Deleting massive directories quickly
However, these directories are not seperate filesystems, so I cannot use your suggestion. There are several other directories the same filesystem as these that I do not want to remove.
Dermot
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-08-2002 01:44 AM
тАО03-08-2002 01:44 AM
Re: Deleting massive directories quickly
If you're only using one process to do this, perhaps you could try running up a number of shells, cd'ing to the directory, and run the rm command on "blocks" of subdirs, e.g.
rm -r '[a-eA-E]*'
rm -r '[f-jF-J]*'
...
etc..., one per shell. This may not be practical of course, as I don't know the directory structure.
Rgds, Robin.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-08-2002 01:48 AM
тАО03-08-2002 01:48 AM
Re: Deleting massive directories quickly
if the other directories, which you still are smaller, do a backup of them and then follow the procedure of Andreas, create a new filesystem and make a restore of the needed data.
Allways stay on the bright side of life!
Peter
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-08-2002 01:53 AM
тАО03-08-2002 01:53 AM
Re: Deleting massive directories quickly
You can try also with find and xargs, i:e:
find dir1 -mtime +30 | xargs rm.
It will run a rm with multiple files instead multiples rm of one file.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-08-2002 01:55 AM
тАО03-08-2002 01:55 AM
Re: Deleting massive directories quickly
Man gzip for information.
Hope this helps.
Kenny.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-08-2002 02:01 AM
тАО03-08-2002 02:01 AM
Re: Deleting massive directories quickly
Instead of 'delete', how about making them 'unavailable' by renaming the directory and recreating it as an empty area?
Nett effect: the files are no longer visible and you can delete them in slow time, while basking in the admiration of your Users that you managed to achieve this so quickly.
Share and Enjoy! Ian
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-08-2002 02:57 AM
тАО03-08-2002 02:57 AM
Re: Deleting massive directories quickly
If the directories are still in use, try some hardlink manipulation:
ln dirname dirname.old
mkdir dirname.new
# now force dirname to refer to the new directory...
ln -f dirname.new dirname
unlink dirname.new
# then remove the old dir with its contents...
rm -r dirname.old
Of course you're still going to be constrained by the speed of your hardware and the load thats being placed on it by other applications.
Regards,
Steve
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-08-2002 03:05 AM
тАО03-08-2002 03:05 AM
Re: Deleting massive directories quickly
If I map the filesystem onto another server which is idle, and let that delete the files (all week if necessary) will there be any additional load on the box that actually has the files on it, or will it just ignore the deleting and work away itself.
Just a thought.
Dermot
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-08-2002 03:16 AM
тАО03-08-2002 03:16 AM
Re: Deleting massive directories quickly
Thanks for your help.
Dermot
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-08-2002 10:17 AM
тАО03-08-2002 10:17 AM
Re: Deleting massive directories quickly
You can do following things on your machine.
1. create a logical volume with name "junk"
2. Mount that volume on a directory /junk
3. Say you want to remove two directories A and B.
4. now give following commands
mv A /junk
mv B /junk
5. now you can remove the logical volume using lvremove.
I think this is the most convenient method for your case.
Thanks,
-Piyush
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-08-2002 10:29 AM
тАО03-08-2002 10:29 AM
Re: Deleting massive directories quickly
Try "unlink" command. Do "manb unlink" for more info.
Hope this helps.
Regds
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-08-2002 11:16 AM
тАО03-08-2002 11:16 AM
Re: Deleting massive directories quickly
can you explain further what you have done?
I cant understand...
If the filesystem is still mounted on the busy machine, mapping it from other box, dont free first box of manage filesystem. So, IMMO, it should be even worst.
TIA