[Techtalk] mke2fs vs rm -rf

Patricia Gaughen gone at us.ibm.com
Fri Oct 4 19:42:32 EST 2002


  > Hi,
  > 
  > Currently I back up a couple of partitions to 
  > a backup drive using tar. However, after a 
  > while the backup partitions begin to fill up
  > because tar just leaves the old files in place
  > (I'm not writing to an archive; just piping
  > to standard out so the filesystem is copied).
  > 
  > To clean the backup drives, I would like to use
  > 'mke2fs' because it is faster and safer than using 
  > rm -rf, since mke2fs can only be run on unmounted
  > partitions. I was just wondering whether anyone
  > could think of any problems with this...?

I can't see any problems with this... from my experience I'd rather 
do a mkfs on a filesystem that I know I unmounted than to do a 
big wildcard rm -rf.  I've seen too many bad things happen from 
misplaced '*' after the rm -rf :-)

BTW, you should check out rsync for a future backup method.  If 
you give rsync the right option you won't have the old file left 
behind.  Also the intermezzo fs (www.inter-mezzo.org) might be of 
interest to you.  Although, if tar works for you and you're happy with
it, keep doing it.

Hope this helps,
Pat 

-- 
Patricia Gaughen (gone at us.ibm.com)
IBM Linux Technology Center
http://www.ibm.com/linux/ltc/





More information about the Techtalk mailing list