SUMMARY: Removing a directory segfaults...

From: Darren Honeyball [ML] <mlist_at_spod.net>
Date: Wed Feb 18 2004 - 04:18:11 EST
It turned out in the end to have 14043 subdirectories each with a 
different inode number.  I use the following script to fix it.

#!/bin/sh
loop=1
dir="homer"
while [ -d "${dir}" ]; do
         echo "${loop}"
         loop=`expr ${loop} + 1`
         cd ${dir}
done
cd ..
while [ -d "${dir}" ]; do
         rm -rf ${dir}
         cd ..
done

Thanks to all who suggested various ways of fixing this...

Darren

Darren Honeyball [ML] wrote:

> I've come across a system which appears to have had directories 
> recursively created - problem is I cant cd far enough down to start 
> removing them, and an rm -rf segfaults...
> 
> e.g.
> 
> ls -R
> 
> ls: 
> ./homer/homer/homer/homer/homer/homer/homer/homer/homer/homer/homer/homer/homer/homer/homer/homer/homer/homer/homer/homer/homer/homer/homer/homer/homer/homer/homer/homer/homer/homer/homer/homer/homer/homer/homer/homer/homer/homer/homer/homer/homer/homer/homer/homer/homer/homer/homer/homer/homer/homer/homer/homer/homer/homer/homer/homer/homer/homer/homer/homer/homer/homer/homer/homer/homer/homer/homer/homer/homer/homer/homer/homer/homer/homer/homer/homer/homer/homer/homer/homer/homer/homer/homer/homer/homer/homer/homer/homer/homer/homer/homer/homer/homer/homer/homer/homer/homer/homer/homer/homer/homer/homer/homer/homer/homer/homer/homer/homer/homer/homer/homer/homer/homer/homer/homer/homer/homer/homer/homer/homer/homer/homer/homer/homer/homer/homer/homer/homer/homer/homer/homer/homer/homer/homer/homer/homer/homer/homer/homer/homer/homer/homer/homer/homer/homer/homer/homer/homer/homer/homer/homer/homer/homer/homer/homer/homer/homer/homer/homer/homer/homer/homer/homer/homer/h
om 
> 
> er/homer/homer/homer/homer/homer/homer: File name too long
> 
> Any thoughts on how to remove this short of backing up the filesystem 
> and newfs'ing?
> 
> TIA
> 
> Darren
> _______________________________________________
> sunmanagers mailing list
> sunmanagers@sunmanagers.org
> http://www.sunmanagers.org/mailman/listinfo/sunmanagers
_______________________________________________
sunmanagers mailing list
sunmanagers@sunmanagers.org
http://www.sunmanagers.org/mailman/listinfo/sunmanagers
Received on Wed Feb 18 04:17:57 2004

This archive was generated by hypermail 2.1.8 : Thu Mar 03 2016 - 06:43:28 EST