Linux - SoftwareThis 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
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Distribution: Not sure. Whatever came on the Asus Netbook.
Posts: 21
Rep:
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.
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.
$ 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.
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.
Distribution: Not sure. Whatever came on the Asus Netbook.
Posts: 21
Original Poster
Rep:
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.
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.
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.
Distribution: Not sure. Whatever came on the Asus Netbook.
Posts: 21
Original Poster
Rep:
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.
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.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.