Share your knowledge at the LQ Wiki.
Go Back > Forums > Linux Forums > Linux - Server
User Name
Linux - Server This forum is for the discussion of Linux Software used in a server related context.


  Search this Thread
Old 07-23-2012, 09:31 PM   #1
LQ Newbie
Registered: Jun 2012
Posts: 12

Rep: Reputation: Disabled
How to correct possibly wrong directory entry ?

The server I'm looking at had a directory with millions of file and almost 1GB space. This was due to a software bug and has been corrected since.
In order to delete the files, the host admin renamed the directory then ran a script to rm all files in it with sleep interval. It took about a month but the files have been deleted.
My problem is that the directory entry still shows the same 1GB disk space using ls -l.
I need to do a scan on the directory structure but commands like ls -R or grep -R get put in an uninterrupted disk sleep. I guess it comes from this huge directory (If you think the problem is different, please let me know).

What would be the best way to correct that directory entry or ideally delete it without crashing a quite busy production server to which I have no physical access ?
I've read somewhere that renaming it would work but I'd rather ask here first, make absolutely sure I don't crash it.

Linux version 2.6.18-194.11.4.el5PAE ( (gcc version 4.1.2 20080704 (Red Hat 4.1.2-48)) #1 SMP Tue Sep 21 05:48:23 EDT 2010

Filesystem 1K-blocks Used Available Use% Mounted on
/dev/sda3 959228044 111934848 798567248 13% /

940552192 Jul 21 17:00 cache_old/

Thanks for your help
Old 07-24-2012, 03:53 AM   #2
LQ Guru
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 9,668

Rep: Reputation: 2853Reputation: 2853Reputation: 2853Reputation: 2853Reputation: 2853Reputation: 2853Reputation: 2853Reputation: 2853Reputation: 2853Reputation: 2853Reputation: 2853
to check or fix filesystem problems you need to start with fsck. I'm not really sure, is this /cache_old dir now really empty?
Old 07-29-2012, 08:31 PM   #3
LQ Guru
Registered: Aug 2004
Location: Sydney
Distribution: Centos 6.9, Centos 7.3
Posts: 17,406

Rep: Reputation: 2396Reputation: 2396Reputation: 2396Reputation: 2396Reputation: 2396Reputation: 2396Reputation: 2396Reputation: 2396Reputation: 2396Reputation: 2396Reputation: 2396
Try also
df -i which should confirm the inode usage/count.


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] Modify the directory entry structure of a directory to show manipulated data shreyas08 Linux - Newbie 1 12-13-2011 05:34 AM
bad entry in directory unaligned directory entry rjo98 Linux - Server 4 04-01-2011 07:39 AM
correct fstab entry for two disc drives, internal and external Cultist Slackware 2 01-14-2011 04:11 PM
rsync uses wrong directory, has wrong size but right file count? brianpbarnes Linux - Software 1 02-23-2009 05:48 PM
Correct entry for local machine in /etc/hosts Kropotkin Linux - Networking 1 11-16-2004 05:41 PM > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 12:15 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration