very slow deletions on ext3 USB drive

Fred Roller froller at tnclimited.com
Fri Sep 18 15:31:29 UTC 2009


Karl Auer wrote:
> Hullo all.
>
> I have a hard disk, 250Gb or so, in an external USB 2.0 HDD enclosure.
> The disk is now full. Specifically, it is full of old backups. Each
> backup is in its own directory, and there are about 45 directories at
> the top level. Each directory contains about 300,000 files and
> directories, mostly very small. The files are pretty evenly distributed
> through the directories and subdirectories. The disk is an ext3
> filesystem.
>
> I now want to recycle the drive and start filling it up with new
> backups. So I have started deleting the old backups. I don't want to
> delete ALL the backups - just the oldest ones - so I can't just reformat
> the disk.
>
> Problem is, it is taking literally hours to remove each backup
> directory. Why is this so? Is there any faster way than "rm -fr" to
> remove a directory? Should I use a different filesystem type next time?
>
> The only wrinkle here is that the backup directories were created using
> rsynch, hard linking to identical files rather than copying them anew.
> But that is a simple link count - I can't see it adding *this* much pain
> to a simple deletion!
>
> Clues?
>
> Regards, K.
>
>   
Lot of good suggestions, this may help:

http://www.unix.com/unix-dummies-questions-answers/51400-how-remove-all-except-one-file.html

-- 
Fred
www.fwrgallery.com

"Life is like linux, simple.  If you are fighting it you are doing something wrong."





More information about the ubuntu-users mailing list