LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   command to erase all deleted files (https://www.linuxquestions.org/questions/linux-newbie-8/command-to-erase-all-deleted-files-915537/)

tonj 11-25-2011 02:41 PM

command to erase all deleted files
 
I'm running centos 4.9 and my drive is full of deleted files taking up space, and it also makes raid mirroring take forever. Is there a command that will completely erase all previously deleted files?

sycamorex 11-25-2011 03:22 PM

Well, deleted files are deleted. They're no longer taking space. How exactly did you 'delete' them? Did you just put them in the Trash (= empty it)?

tonj 11-25-2011 03:42 PM

these deleted files are kind of taking space, because they're not truly deleted, they're just realocated to hide them from the file system. I have the ability to restore them which means they are still there and they're causing my raid mirroring to take around 14 hours. The machine I'm on has no gui, it's all command line so there is no trash bin. I need to "wipe completely" all files that have been previously deleted and I have to do it at the command line.

sycamorex 11-25-2011 03:43 PM

Where are they relocated? Can you find them?

tonj 11-25-2011 03:49 PM

no there's thousands of them, I need a global command that will simply wipe them all for me, if there is such a thing.

sycamorex 11-25-2011 04:02 PM

Are they in a hidden directory? How exactly do you know they are taking space? To have a "global command" that will wipe them all you need to know where they are.

What's the output of 'df -h'?

You need to provide more details to be able to diagnose anything.

tonj 11-25-2011 04:10 PM

]$ df -h
Filesystem Size Used Avail Use% Mounted on
/dev/md1 1.9G 1.2G 678M 64% /
/dev/md2 1.9G 193M 1.7G 11% /var
/dev/md5 1.9G 33M 1.8G 2% /tmp
/dev/md6 120G 58M 114G 1% /home
none 253M 0 253M 0% /dev/shm

the deleted stuff is all on /dev/md6

sycamorex 11-25-2011 04:18 PM

Ok, that's better. Now can you post the output of:

Code:

du /home | sort -n -r | head -n 10

tonj 11-25-2011 04:28 PM

]# du /home | sort -n -r | head -n 10
25608 /home
13048 /home/phpmyadmin
11740 /home/.sites
11708 /home/.sites/server
11704 /home/.sites/server/logs
8396 /home/phpmyadmin/lang
8028 /home/.sites/server/logs/2011
3544 /home/.sites/server/logs/2010
1612 /home/phpmyadmin/libraries
1216 /home/.sites/server/logs/2010/9

Doc CPU 11-25-2011 04:43 PM

Hi there,

Quote:

Originally Posted by tonj (Post 4533965)
]$ df -h
Filesystem Size Used Avail Use% Mounted on
/dev/md1 1.9G 1.2G 678M 64% /
/dev/md2 1.9G 193M 1.7G 11% /var
/dev/md5 1.9G 33M 1.8G 2% /tmp
/dev/md6 120G 58M 114G 1% /home
none 253M 0 253M 0% /dev/shm

the deleted stuff is all on /dev/md6

you can't be serious, can you?
You're complaining about 58MB, a mere nothing, on a 120GB file system? Not really, are you?

[X] Doc CPU

sycamorex 11-25-2011 04:47 PM

Quote:

Originally Posted by Doc CPU (Post 4533990)
Hi there,



you can't be serious, can you?
You're complaining about 58MB, a mere nothing, on a 120GB file system? Not really, are you?

[X] Doc CPU

Look more closely:
dev/md6 120G 58M 114G 1% /home

Used 58M
Left 114G out of 120G.

I don't know much about RAID but either it's "reserved" some space or something is indeed not right here.

repo 11-25-2011 04:49 PM

Quote:

no there's thousands of them, I need a global command that will simply wipe them all for me, if there is such a thing.
What files are you talking about?
Could it be the files are still in use ?

Kind regards

tonj 11-25-2011 04:51 PM

its the deleted files! There's about 60Gb of deleted files on md6. raid mirroring doesn't just copy valid files it also copies deleted files, so that they could potentially be restored in the future. I don't want to restore them I want to wipe them away completely so the drive space is EMPTY.

Doc CPU 11-25-2011 04:54 PM

Hi there,

Quote:

Originally Posted by sycamorex (Post 4533994)
Look more closer:
dev/md6 120G 58M 114G 1% /home

Used 58M
Left 114G out of 120G.

I don't know much about RAID but either it's "reserved" some space or something is indeed not right here.

it probably is reserved space, I discussed this subject a few days ago with someone else. You're using a journaling file system like ext3 or ext4? And not surprisingly, it's about the same percentage again, roughly 5..6% of the partition.

[X] Doc CPU

tonj 11-25-2011 05:03 PM

reserved space? that doesn't sound right and doesn't align with previous raid mirroring I've done. It's the deleted files it's the deleted files it's the deleted files. Is there a command that will show them and let me completely erase them?


All times are GMT -5. The time now is 03:19 AM.