LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 10-14-2009, 10:27 AM   #1
bryanvick
LQ Newbie
 
Registered: Oct 2009
Posts: 15

Rep: Reputation: 0
Space not freeing up after rm


I have a 500GB external HD mounted @ /media/backuphdd. I deleted everything on it with "sudo rm -rf /media/backuphdd/*".

df still shows 223GB being used:
Filesystem Size Used Avail Use% Mounted on
/dev/sdb1 451G 223G 205G 53% /media/backuphdd

du shows 68kb being used:
68K /media/backuphdd/

I have remounted, and rebooted. Why can't I reclaim this space?

Also, there is one tiny file on the hdd that I couldn't delete because of a "stale NFS file handle". I don't really care about that file, and am not looking for a solution to that problem, but I wanted to include that info for completeness.

It seems I am missing something pretty basic.
 
Old 10-14-2009, 10:45 AM   #2
pljvaldez
LQ Guru
 
Registered: Dec 2005
Location: Somewhere on the String
Distribution: Debian Wheezy (x86)
Posts: 6,094

Rep: Reputation: 281Reputation: 281Reputation: 281
Why not just reformat the drive?
 
Old 10-14-2009, 10:55 AM   #3
bryanvick
LQ Newbie
 
Registered: Oct 2009
Posts: 15

Original Poster
Rep: Reputation: 0
I will eventually

That is what I will eventually do if I can't find a solution. But what if I was not trying to delete everything, just a couple large files. I wouldn't turn to reformatting as a solution because I have a bunch of other files on the drive that I want.

I could have reformatted by now, but it really bugs me that something as simple as rm -rf * is not removing all the files. There absolutely has to be a solution to this other than reformatting. rm is so fundamental.
 
Old 10-14-2009, 11:03 AM   #4
Guttorm
Senior Member
 
Registered: Dec 2003
Location: Trondheim, Norway
Distribution: Debian and Ubuntu
Posts: 1,453

Rep: Reputation: 448Reputation: 448Reputation: 448Reputation: 448Reputation: 448
Hi

The disk space is not free unless all programs with open files on the disk close them. If you're using NFS maybe that's the problem? If not, lsof can identify which program. I would try unmount and mount again.
 
Old 10-14-2009, 11:27 AM   #5
bryanvick
LQ Newbie
 
Registered: Oct 2009
Posts: 15

Original Poster
Rep: Reputation: 0
I have run lsof, unmount/remount + reboot multiple times. Not working. Output of lsof /media/backuphdd = Nothing.
 
Old 10-14-2009, 12:31 PM   #6
tredegar
LQ 5k Club
 
Registered: May 2003
Location: London, UK
Distribution: Fedora38
Posts: 6,147

Rep: Reputation: 435Reputation: 435Reputation: 435Reputation: 435Reputation: 435
There could be filesystem corruption. Maybe it's time to run fsck on your unmounted external HD ?
 
Old 10-14-2009, 04:01 PM   #7
bryanvick
LQ Newbie
 
Registered: Oct 2009
Posts: 15

Original Poster
Rep: Reputation: 0
Corrupted

It was corrupted. I ran fsck to fix everything and when it was done I had a lost+found folder full of 250GB of stuff. Deleted it and df was reporting the correct usage of 0%. Thanks for the help.
 
Old 10-14-2009, 04:22 PM   #8
tredegar
LQ 5k Club
 
Registered: May 2003
Location: London, UK
Distribution: Fedora38
Posts: 6,147

Rep: Reputation: 435Reputation: 435Reputation: 435Reputation: 435Reputation: 435
Pleased that that is sorted now.

In future, remember that removable devices need to be unmounted before you unplug them (I believe it is the same with the win OS also).
 
Old 10-14-2009, 04:40 PM   #9
Quakeboy02
Senior Member
 
Registered: Nov 2006
Distribution: Debian Linux 11 (Bullseye)
Posts: 3,407

Rep: Reputation: 141Reputation: 141
Are you just hitting the power button to shut it off, or smashing reset to boot to Windows, or are you going through a Linux power down cycle? I ask, because the last time I saw that much corruption was due to not shutting down properly.
 
  


Reply



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 On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
freeing up space Paul Griesbaum Linux - Newbie 3 05-26-2009 10:23 PM
Freeing up space hongman Linux - Newbie 7 06-27-2005 02:00 PM
Freeing up some space. How? Rutnut Linux - General 10 06-21-2005 01:00 AM
Freeing up Space stroudt Linux - General 2 08-28-2003 03:14 PM
Freeing up Space stroudt Red Hat 6 08-28-2003 02:45 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 02:21 PM.

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