Maybe this is a silly question, but i have a few million files i need to delete but i can't just reformat the volume. Right now the fastest thing i can think of is nice -20 rm -Rf /folder-i-want-to-delete is there a better or faster way to do this? Thanks, Jamie
On Sat, Sep 29, 2007 at 04:43:43AM -0700, Jamie Lists wrote:> Maybe this is a silly question, but i have a few million files i need > to delete but i can't just reformat the volume. > > Right now the fastest thing i can think of is > > nice -20 rm -Rf /folder-i-want-to-delete > > is there a better or faster way to do this?No, but if you want to re-use the directory name, rename it before removing it: mv folder-i-want-to-delete _removed_folder rm -fr _removed_folder & keep working... -- lfr 0/0 -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 189 bytes Desc: not available URL: <http://lists.centos.org/pipermail/centos/attachments/20070929/e7104db6/attachment.sig>
On 9/29/07, Luciano Rocha <strange at nsk.no-ip.org> wrote:> On Sat, Sep 29, 2007 at 04:43:43AM -0700, Jamie Lists wrote: > > Maybe this is a silly question, but i have a few million files i need > > to delete but i can't just reformat the volume. > > > > Right now the fastest thing i can think of is > > > > nice -20 rm -Rf /folder-i-want-to-delete > > > > is there a better or faster way to do this? > > No, but if you want to re-use the directory name, rename it before > removing it: > mv folder-i-want-to-delete _removed_folder > rm -fr _removed_folder & > keep working... > > --Thanks for the tip.. We just have millions and millions of files and it's taking FOREVER haha! I thought maybe there might be some other command i'm not aware of that would wipe this stuff out faster ya know. James
Some hint : - use a partition dedicated for that, that you can format every time you need to reset it. - try other filesystem. Some filesystem are faster for delete operations. - try to change the journaling during the delete operations. If you use ext3, I'm thinking about something like: # mount -o remount,noload /data # rm -rf /data/* # mount -o remount /data or # mount -o remount,data=writeback /data # rm -rf /data/* # mount -o remount,data=ordered /data On 9/29/07, Jamie Lists <jamielist at gmail.com> wrote:> Maybe this is a silly question, but i have a few million files i need > to delete but i can't just reformat the volume. > > Right now the fastest thing i can think of is > > nice -20 rm -Rf /folder-i-want-to-delete > > is there a better or faster way to do this? > > Thanks, > Jamie > _______________________________________________ > CentOS mailing list > CentOS at centos.org > http://lists.centos.org/mailman/listinfo/centos >-- Alain Spineux aspineux gmail com May the sources be with you