LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 12-15-2009, 09:15 PM   #1
ahr8tch
LQ Newbie
 
Registered: Dec 2009
Location: Texas
Distribution: Not sure. Whatever came on the Asus Netbook.
Posts: 21

Rep: Reputation: 15
How Does One Free Disk Space


I did a df and found out that my netbook (Asus) only has 858MB of free space. Files I had downloaded for Citrix were taking up a great deal of space so I ran rm to remove them. Running ls after the rm showed them no longer displaying but another df shows no change in available disk space.

Must I run a command to free the space and return it to the file system?

Running Xandros and KDE on a netbook (Asus EeePC 900) with only .5 GB RAM and 4GB of HD space.

TIA
 
Old 12-15-2009, 09:25 PM   #2
exvor
Senior Member
 
Registered: Jul 2004
Location: Phoenix, Arizona
Distribution: Gentoo, LFS, Debian,Ubuntu
Posts: 1,537

Rep: Reputation: 87
It is possible that df was reading the drive free space and that the rm had yet to write the changes to the hard drive completely. Tho I don't think it should work that way for some reason.
 
Old 12-15-2009, 09:52 PM   #3
ghostdog74
Senior Member
 
Registered: Aug 2006
Posts: 2,697
Blog Entries: 5

Rep: Reputation: 244Reputation: 244Reputation: 244
you can try run these commands
Code:
du -sk * # see how big those directories are.
Code:
find / -type f -size +100M  #find files with size more than 100M
find / -type f \( -iname "*.bak" -o -iname "*.tmp" \) # add as desired
then do the cleanup using rm
 
1 members found this post helpful.
Old 12-16-2009, 06:32 AM   #4
Shadow_7
Senior Member
 
Registered: Feb 2003
Distribution: debian
Posts: 4,137
Blog Entries: 1

Rep: Reputation: 874Reputation: 874Reputation: 874Reputation: 874Reputation: 874Reputation: 874Reputation: 874
I tend to favor

$ du -h --max-depth=1
(helps identify WHERE your space is allocated)

df and du are just approximations though. There's various ways to do the math.

For certain files /var/log/ and /tmp/, you might need to reboot to reclaim space, or just restart syslogd. Or famd, or other applications. It really depends on the removal method and filesystem in question. If you're crunched for space in a hurry, then the contents of /usr/share/doc/ is mostly removeable and space needy. If you have a few custom kernels, make clean might free up a few 100MB of space. And other quick fixes. I've just got a usb docking station and many external drives. Mount and move and unmount, problem solved. Resident data pack rat.

It sounds more like you didn't remove any files of any consequential size. Browser cache and ~/.java and other places tend to be data pack rats. /var/cache/, /var/log/ and other places. The main thing is to ID where your space went. Which might mean knowing what space usage is normal in the first place. 4GB is pretty small IMO. I've got swap partitions bigger. Although mainly as a safety net for large media files and editing, or encrypted dvds that needs to be unencrypted to use. And basically just in case. The big killer of late is /tmp/ since audacity in combination with large audio files, and work on copies settings, means a lot of temp storage when editing / modifying a 1GB audio file. Why so big? That's hardly a stereo image of an hour concert at > CD quality. Mere peanuts in todays HD world.

If your web browser crashes a lot. It might leave a bunch of /tmp/Flash* and other files behind. A reboot should free some of those up. Restarting the browser, probably not.
 
1 members found this post helpful.
Old 12-16-2009, 09:41 AM   #5
pcunix
Member
 
Registered: Dec 2004
Location: MA
Distribution: Various
Posts: 149

Rep: Reputation: 23
If a file is in use (open for reading or writing) by any process, its disk blocks are not removed when you "rm" it. Only the directory entry is removed.

If the thing you removed is just a link, symbolic or hard, removing that obviously won't free any disk blocks.

You CAN reclaim disk space by using "> filename", but that has its own set of caveats; see http://aplawrence.com/Unixart/freeing-disk-space.html
 
1 members found this post helpful.
Old 12-16-2009, 02:03 PM   #6
ahr8tch
LQ Newbie
 
Registered: Dec 2009
Location: Texas
Distribution: Not sure. Whatever came on the Asus Netbook.
Posts: 21

Original Poster
Rep: Reputation: 15
OK! Maybe I didn't frame this question correctly. Let me try again.

The system is a small netbook - Asus 900L with 1 GB RAM and 4 GB HD running Xandros, KDE and the bash shell.

I think that I might have a very full HD. I want to find out; so I run a df command and get the following result:
Filesystem 1K-blocks Used Available Use% Mounted on
rootfs 490020 459233 5405 99% /
/dev/sda1 3359375 2501375 858000 75% /.ro
/dev/sda2 490020 459233 5405 99% /.rw
none 490020 459233 5404 99% /
tmpfs 514080 12 514068 1% /dev/shm
tmpfs 131072 20 131052 1% /tmp
/dev/sda1 3359375 2501375 858000 75% /ro

(I was as careful as I could be with the typing here but there might be mistakes.)

1) This looks to me like there are 7 file systems created. Is that correct? Why are there so many? Do I need them all?

2) As I understand it, /dev/sda1 is the first partition on the HD. Is this correct?
If so, why are there 2 "/dev/sda1" file systems? I don't understand the "Mounted on" column but it seems strange to me that one at /.ro and the other at /ro. Does this indicate a problem or an error? I don't see how both can really exist with a size of 3.3GB on an HD that is only 4GB.

3) Is there a command that will tell me how much of the 4 GB real space is in use?

4) Is there a command that will list all my files and directories (like dir in DOS) showing me which is a directory and which is a file? I know to Linux all objects are files but it must have a way (which I don't know)of distinguishing directories from other files. I realize that I'll have to change directories or specify full pathnames to see the contents of directories and subdirectories.

5) The Asus has an SD drive installed and identified as the D: device. Is there a feasible way to put some of the data from the HDD on the SD drive (with media installed, of course)? If so, how would I go about it? Can filesystems exist across multiple devices in Linux, or must the SD drive have its own filesystem, separate from the HD system?

We really don't use this netbook for much. We bought it with the intention of using it to read our email and to access the Internet. That's pretty much all that we want to do; so the resource limitations didn't seem to be a problem until we tried to install the Citrix client, needed to access the corporate system, and were unable to do so because we ran out of space.

TIA for your patience and any assistance you can give.
 
Old 12-16-2009, 02:30 PM   #7
DotHQ
Member
 
Registered: Mar 2006
Location: Ohio, USA
Distribution: Red Hat, Fedora, Knoppix,
Posts: 548

Rep: Reputation: 33
df -h will show you the output in a easy 'human' readable format. You'll see better where your file space is allocated.

It appears you have boot partition that is needed. A root (/) partition that is also required along with /tmp (temporay storage, required for the OS...working space so to speak) and /shm (shared memory ...required)

To tell directories from files do a:
ls -lhR | more

This will show you the current dir and all files / dirs under it. If the first letter on the line is a d it is a directory ...if the first letter on the line is anything else it is a file (usually it will be a - indicating a regular file ...and l in the 1st column indicates a linked file. deleteing it will not gain you any space) ...most big files are not linked unless you did something 'special' ...so this is usually not the case.)

Have you tried a reboot to see if the freed space showed up?

To just show the directory you are currently in leave off the upper case R. ie: ls -l

Your SD drive should work but you would have to mount it as a new file system.

du -sh /home will give you a summary of how much total space is used up in /home.

Add h to many of these commands will output the data in human readable format IOW: gigs or mb's instead of bytes. h is not requred you can leave it off and see the difference.

Last edited by DotHQ; 12-16-2009 at 02:38 PM.
 
1 members found this post helpful.
Old 12-16-2009, 02:48 PM   #8
ahr8tch
LQ Newbie
 
Registered: Dec 2009
Location: Texas
Distribution: Not sure. Whatever came on the Asus Netbook.
Posts: 21

Original Poster
Rep: Reputation: 15
Thanks, DotHQ!

I will give those suggestions a try, including the reboot. I can't remember if I've rebooted since I started this journey.

rh
 
Old 12-16-2009, 03:51 PM   #9
cpplinux
Member
 
Registered: Dec 2009
Posts: 37

Rep: Reputation: 17
You may try
sudo apt-get autoclean
to remove some old installation packages downloaded during your system updates/upgrades. This works for Ubuntu, but should be similar for Xandros. See here for the explanation.
 
Old 12-16-2009, 08:06 PM   #10
ahr8tch
LQ Newbie
 
Registered: Dec 2009
Location: Texas
Distribution: Not sure. Whatever came on the Asus Netbook.
Posts: 21

Original Poster
Rep: Reputation: 15
OK!

I've gone through the tedious process of changing into each subdirectory and removing the files from each then stepping back up to the parent directory and then removing the subdirectory until all the files I downloaded are no longer appearing after an ls command.
Having done all that, I then shut the system down and restarted and ran a df command and got the same result as I had before I started. I then ran the sudo apt-get autoclean command and ran the df command again. Still, I get the same result as before I did anything.

I truly don't understand what's going on.

Can anyone tell me why in the df command results I show 2 /dev/sda1 filesystems - 1 mounted at /.ro and the other mounted at /ro. Why 2 file systems? What is the difference between the to mount points?

I'm beginning to understand how Alice felt after falling down the rabbit hole.
 
Old 12-17-2009, 08:04 AM   #11
DotHQ
Member
 
Registered: Mar 2006
Location: Ohio, USA
Distribution: Red Hat, Fedora, Knoppix,
Posts: 548

Rep: Reputation: 33
It sounds as if the files you removed were not the primary ones using up the space you are trying to free. If df -h is showing gigs or megs and you don't remove a whole gig or meg, then df will show the same result.
Earlier in this thread someone posted the find command used for finding big files on your system. Use that to find the biggest files. If not sure whether or not they can be removed ask here. You might find a log file (/var/log) or a mail file is eating up all the space and that the files you downloaded were negligible.
 
Old 12-17-2009, 08:09 AM   #12
~sHyLoCk~
Senior Member
 
Registered: Jul 2008
Location: /dev/null
Posts: 1,173
Blog Entries: 12

Rep: Reputation: 129Reputation: 129
You can use an useful app called "ncdu". It will show you the size of each directories.

Regards
 
  


Reply


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
partition space and disk space usage and free don't match nsic Linux - Newbie 3 02-22-2013 12:57 PM
How t get it known free disk space? ukrainet Linux - General 3 05-06-2008 10:52 PM
Disk Free Space Ian D Linux - Newbie 1 02-09-2006 07:11 AM
How much disk space do I have free? Ian D Linux - General 5 10-27-2005 06:22 PM
Can't free disk space mcm8327 Linux - Software 4 03-29-2004 08:19 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 02:28 AM.

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