[opensuse] HELP - How to I delete a directory that won't die! (no rm -rf isn't the answer)
Listmates, I must have had a script go bad and completely screw up a file or two in a directory and now I cannot "ls" the directory, I cannot "rm -rf" the directory, but I can "mv" the directory and I can "cd" into the directory. The directory holds font files and I ran a script with "tr" in the scripts and I had the wrong arguments to tr and now there is a mess. The directory "V2" has the following properties: drwxrwxrwx 2 david dcr 128552960 2009-07-16 22:28 V2/ I booted to runlevel 1 and fsck'ed the disk and it is fine. So, I know this is one of those cases where I have screwed up the files in the directory well beyond my ability just delete them and I'm --- stuck. What is the best way to recover?? -- David C. Rankin, J.D.,P.E. Rankin Law Firm, PLLC 510 Ochiltree Street Nacogdoches, Texas 75961 Telephone: (936) 715-9333 Facsimile: (936) 715-9339 www.rankinlawfirm.com -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
* David C. Rankin
I must have had a script go bad and completely screw up a file or two in a directory and now I cannot "ls" the directory, I cannot "rm -rf" the directory, but I can "mv" the directory and I can "cd" into the directory.
The directory holds font files and I ran a script with "tr" in the scripts and I had the wrong arguments to tr and now there is a mess. The directory "V2" has the following properties:
drwxrwxrwx 2 david dcr 128552960 2009-07-16 22:28 V2/
I booted to runlevel 1 and fsck'ed the disk and it is fine. So, I know this is one of those cases where I have screwed up the files in the directory well beyond my ability just delete them and I'm --- stuck.
What is the best way to recover??
try midnightcommand in a text console. -- Patrick Shanahan Plainfield, Indiana, USA HOG # US1244711 http://wahoo.no-ip.org Photo Album: http://wahoo.no-ip.org/gallery2 Registered Linux User #207535 @ http://counter.li.org -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
On Thursday 16 July 2009 11:03:33 pm Patrick Shanahan wrote:
* David C. Rankin
[07-16-09 23:51]: try midnightcommand in a text console.
OK, Here is the issue. mc seems to be running and deleting the files after I selected the directory and told it to delete rather than trying to descend into the directory. mc is working on deleting thousands of files named: /home/samba/computer/fonts/V2/.directory.lock.Esto70 /home/samba/computer/fonts/V2/.directory.lock.bgVe70 /home/samba/computer/fonts/V2/.directory.lock.XrXa70 /home/samba/computer/fonts/V2/.directory.lock.IaWj70 /home/samba/computer/fonts/V2/.directory.lock.NpUm70 It will delete a whole bunch, then look like it is stuck of 15-20 secs, then start deleting again. I guess it is just going through cycles of buffer/delete, over and over. Hopefully it will finish sometime tonight. When I messed up the tr call, I did something like tr [a-z] [A-Z] filename instead of "echo filename | tr 'A-Z' 'a-z'" Only problem was the initial call was in a loop. "for i in $(ls); do tr....." Why that would blow up like this, I don't know. Seems like it should just have thrown errors instead of creating millions of files. -- David C. Rankin, J.D.,P.E. Rankin Law Firm, PLLC 510 Ochiltree Street Nacogdoches, Texas 75961 Telephone: (936) 715-9333 Facsimile: (936) 715-9339 www.rankinlawfirm.com -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
On Fri, Jul 17, 2009 at 00:55, David C. Rankin
Seems like it should just have thrown errors instead of creating millions of files
What filesystem is it? Ext3 has a limit of 32,000 files in a directory, FWIW. -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
On Friday 17 July 2009 12:51:48 am you wrote:
On Fri, Jul 17, 2009 at 00:55, David C. Rankin
wrote: Seems like it should just have thrown errors instead of creating millions of files
What filesystem is it? Ext3 has a limit of 32,000 files in a directory, FWIW.
Yep, it's Ext3, The darn thing has been deleting for a couple of hours now in mc. I don't know how long this might actually take.... -- David C. Rankin, J.D.,P.E. Rankin Law Firm, PLLC 510 Ochiltree Street Nacogdoches, Texas 75961 Telephone: (936) 715-9333 Facsimile: (936) 715-9339 www.rankinlawfirm.com -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
On Thursday 16 July 2009 11:55:38 pm David C. Rankin wrote:
On Thursday 16 July 2009 11:03:33 pm Patrick Shanahan wrote:
* David C. Rankin
[07-16-09 23:51]: try midnightcommand in a text console.
OK,
Here is the issue. mc seems to be running and deleting the files after I selected the directory and told it to delete rather than trying to descend into the directory. mc is working on deleting thousands of files named:
/home/samba/computer/fonts/V2/.directory.lock.Esto70 /home/samba/computer/fonts/V2/.directory.lock.bgVe70 /home/samba/computer/fonts/V2/.directory.lock.XrXa70 /home/samba/computer/fonts/V2/.directory.lock.IaWj70 /home/samba/computer/fonts/V2/.directory.lock.NpUm70
Patrick, thanks, mc worked! Judging from the time of my first post, mc took just over 3 hours to delete all of the files in the fonts/V2 directory. There must have been thousands and thousands of them. That is really strange that using (misusing) 'tr' could cause the thousands of files to be created. Looking at my bash_history, one of the following commands is the one that did it: 4942 for i in $(ls); do tr [A-Z] [a-z] $i; done 4943 for i in $(ls); do tr [a-z] $i; done 4945 for i in $(ls); do echo $(tr [a-z] $i); done 4946 for i in $(ls); do echo $(tr $i [a-z]); done 4947 for i in $(ls); do echo $i; done 4948 for i in $(ls); do echo $i | tr 'a-z'; done 4949 for i in $(ls); do echo $i | tr [a-z]; done 4950 for i in $(ls); do echo $i | tr 'A-Z' 'a-z'; done I never knew 'tr' could have such adverse side effects. I wonder which one did it? -- David C. Rankin, J.D.,P.E. Rankin Law Firm, PLLC 510 Ochiltree Street Nacogdoches, Texas 75961 Telephone: (936) 715-9333 Facsimile: (936) 715-9339 www.rankinlawfirm.com -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
On Thursday July 16 2009, David C. Rankin wrote:
Listmates,
I must have had a script go bad and completely screw up a file or two in a directory and now I cannot "ls" the directory, I cannot "rm -rf" the directory, but I can "mv" the directory and I can "cd" into the directory.
In what manner do the commands that fail when operating on that directory do so?
The directory holds font files and I ran a script with "tr" in the scripts and I had the wrong arguments to tr and now there is a mess. The directory "V2" has the following properties:
drwxrwxrwx 2 david dcr 128552960 2009-07-16 22:28 V2/
How many files are in that directory? It's enormous! Will find enumerate its contents? If so, something like this might work: % find V2 -type f -print0 |xargs -0 rm
...
What is the best way to recover??
Well, I hear Windows types reinstall ever couple of weeks or so...
-- David C. Rankin
Randall Schulz -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
On Thursday 16 July 2009 11:14:48 pm Randall R Schulz wrote:
On Thursday July 16 2009, David C. Rankin wrote:
Listmates,
I must have had a script go bad and completely screw up a file or two in a directory and now I cannot "ls" the directory, I cannot "rm -rf" the directory, but I can "mv" the directory and I can "cd" into the directory.
In what manner do the commands that fail when operating on that directory do so?
Randall, When I issue "ls -al" or "rm", the command just "get stuck" until I start another terminal and "kill -9 PID". A simple kill won't work.
The directory holds font files and I ran a script with "tr" in the scripts and I had the wrong arguments to tr and now there is a mess. The directory "V2" has the following properties:
drwxrwxrwx 2 david dcr 128552960 2009-07-16 22:28 V2/
How many files are in that directory? It's enormous!
There should be 127 files of about 50K each. How in the hell it got enormous is beyond me. There could be hundreds (maybe even thousands) of copies of each file in there.
Will find enumerate its contents? If so, something like this might work:
% find V2 -type f -print0 |xargs -0 rm
I'll give find a go and I'll also try mc like Patrick suggested.
What is the best way to recover??
Well, I hear Windows types reinstall ever couple of weeks or so...
The only shame is this is a 10.3 system that I "have" to fix ;-) -- David C. Rankin, J.D.,P.E. Rankin Law Firm, PLLC 510 Ochiltree Street Nacogdoches, Texas 75961 Telephone: (936) 715-9333 Facsimile: (936) 715-9339 www.rankinlawfirm.com -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
On Thursday July 16 2009, David C. Rankin wrote:
On Thursday 16 July 2009 11:14:48 pm Randall R Schulz wrote:
On Thursday July 16 2009, David C. Rankin wrote:
Listmates,
I must have had a script go bad and completely screw up a file or two in a directory and now I cannot "ls" the directory, I cannot "rm -rf" the directory, but I can "mv" the directory and I can "cd" into the directory.
In what manner do the commands that fail when operating on that directory do so?
Randall,
When I issue "ls -al" or "rm", the command just "get stuck" until I start another terminal and "kill -9 PID". A simple kill won't work.
I suspect they just exceeded your patience and were not literally hung in any real way (deadlocked, e.g.).
...
-- David C. Rankin
Randall Schulz -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
David C. Rankin wrote:
Listmates,
I must have had a script go bad and completely screw up a file or two in a directory and now I cannot "ls" the directory, I cannot "rm -rf" the directory, but I can "mv" the directory and I can "cd" into the directory.
Interesting issue! Did you try to mount an USB flash disk, "mv" the buggy directory to the flash disk, and do mkdosfs on the USB flash disk? If it can be moved, it must can be removed. -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
On Friday 17 July 2009 12:06:34 am you wrote:
David C. Rankin wrote:
Listmates,
I must have had a script go bad and completely screw up a file or two in a directory and now I cannot "ls" the directory, I cannot "rm -rf" the directory, but I can "mv" the directory and I can "cd" into the directory.
Interesting issue! Did you try to mount an USB flash disk, "mv" the buggy directory to the flash disk, and do mkdosfs on the USB flash disk? If it can be moved, it must can be removed.
Yes, I first thought about moving to /dev/null, but that didn't work. I could move it to another directory (i.e. "mv V1 V2) as long as it was on the same partition. I attempted to move it to /tmp and let the scheduled clean up take care of it, but since /tmp is on the / partition, the mv stalled trying to copy across filesystem boundaries. (I now think the stalling was just the time it was taking to delete) So far things are getting deleted (very slowly) with mc, so I'm just going to let it run for now. -- David C. Rankin, J.D.,P.E. Rankin Law Firm, PLLC 510 Ochiltree Street Nacogdoches, Texas 75961 Telephone: (936) 715-9333 Facsimile: (936) 715-9339 www.rankinlawfirm.com -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
David C. Rankin wrote:
Listmates,
I must have had a script go bad and completely screw up a file or two in a directory and now I cannot "ls" the directory, I cannot "rm -rf" the directory, but I can "mv" the directory and I can "cd" into the directory.
The directory holds font files and I ran a script with "tr" in the scripts and I had the wrong arguments to tr and now there is a mess. The directory "V2" has the following properties:
drwxrwxrwx 2 david dcr 128552960 2009-07-16 22:28 V2/
I booted to runlevel 1 and fsck'ed the disk and it is fine. So, I know this is one of those cases where I have screwed up the files in the directory well beyond my ability just delete them and I'm --- stuck.
What is the best way to recover??
My guess that nothing is stuck, but you're just not patient enough.... Looking at the size of the directory, it contains a LOT of files. It takes time to do *anything* in this directory. We're having a CCD system that regularly dumps some 100-200000 files in one directory. Doing a 'ls' or something similar easily takes up to 10 minutes, and that's on reiserfs - ext3 will be even slower on that, I assume. So just run your rm -rf and leave it running. It will eventually finish and remove everything, but it might well take hours... No idea wether 'unlink' might work better - never tried this. Pit -- Dr. Peter "Pit" Suetterlin http://www.astro.su.se/~pit Institute for Solar Physics Tel.: +34 922 405 590 (Spain) P.Suetterlin@royac.iac.es +46 8 5537 8534 (Sweden) Peter.Suetterlin@astro.su.se -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On Friday, 2009-07-17 at 11:14 +0100, Pit Suetterlin wrote:
My guess that nothing is stuck, but you're just not patient enough.... Looking at the size of the directory, it contains a LOT of files. It takes time to do *anything* in this directory.
We're having a CCD system that regularly dumps some 100-200000 files in one directory. Doing a 'ls' or something similar easily takes up to 10 minutes, and that's on reiserfs - ext3 will be even slower on that, I assume.
Why is it so slow? 10 minutes * 60S/m / 100E3 files = 6mS per file. Isn't that too much for a computer? Something is not working right... unless the HD has to do a seek per each file. Perhaps the tools we use were designed years ago and are not designed for directories so big? :-? - -- Cheers, Carlos E. R. -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.9 (GNU/Linux) iEYEARECAAYFAkpgUsoACgkQtTMYHG2NR9WngACeKh+1OslFL1Ra9AtAtT2pCcVD YOMAn3B6SlqKkZycp70mfFI0w8ZJ8+CM =5xu/ -----END PGP SIGNATURE----- -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On Friday, 2009-07-17 at 11:49 +0100, Dave Howorth wrote:
Carlos E. R. wrote:
Why is it so slow?
These things are slow. But one specific issue is whether it is mounted with noatime.
Yes, noatime would help. Yes, I know they are slow, but... why? - -- Cheers, Carlos E. R. -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.9 (GNU/Linux) iEYEARECAAYFAkpg0hMACgkQtTMYHG2NR9Uv9QCfYM8RkwoCSkqAc7RvdpnB2JtD w0QAn0Tk4F5y/3BVQCE94X0wyXlloYI+ =Q5md -----END PGP SIGNATURE----- -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
participants (8)
-
Andrew Joakimsen
-
Carlos E. R.
-
Dave Howorth
-
David C. Rankin
-
Patrick Shanahan
-
Pit Suetterlin
-
Randall R Schulz
-
Zhang Weiwu