[clue-tech] Why is rm so slow?

David L. Willson DLWillson at TheGeek.NU
Tue Jul 1 09:45:49 MDT 2008


On Mon, 30 Jun 2008 17:59:08 -0600, David L. Anselmi wrote
> David L. Willson wrote:
> > How do I get rm to stop "sweeping up", and just mark the space available, instead?  It
> > takes a ridiculous amount of time to delete large files.
> 
> Why do you think rm is sweeping up?  Just because it's slow?  I'm 
> betting it doesn't do that (since there's no option to turn it off). 
> You may be thinking of shred.

Actually, there is a file-attribute that flags for full file erasure on removal of the
last link.  I can't call it to mind right now, but it's in the man pages for chattr and
lsattr, I think.

> What kind of filesystem?  What block size?  What mount options 
> (caching)?  What drive interface?  Any chance you have marginal blocks 
> on the disk?

EXT3, dunno, default, FireWire800 to SATA, Are marginal blocks the ones on the edge of
the platter, that you're not supposed to write to?  :-)

> If you have to move all the blocks to the free list synchronously, it 
> might take a bit.

I think this is the relevant bit.  Why do deletions on FAT and NTFS go off instantly and
EXT* removals take time in direct proportion to file-size?  Is there a fundamental
difference in how the filesystems work?  If so, what benefit are we getting for the
overhead?

Maybe I should do some more "timings".  It's been a long time since I used FAT or NTFS.
 Maybe I'm just mis-remembering, but I don't think so...

-- David



More information about the clue-tech mailing list