LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
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 07-17-2013, 11:04 AM   #1
themchost
LQ Newbie
 
Registered: Jul 2013
Posts: 4

Rep: Reputation: Disabled
Unhappy Hard Drive question


Hello,

So I should first warn you I'm a linux noob

Right, when I do df -h I get the following back.
Code:
Filesystem            Size  Used Avail Use% Mounted on
/dev/sdb2              95G   90G  162M 100% /
tmpfs                  16G  4.0K   16G   1% /dev/shm
/dev/sdb1             504M   69M  411M  15% /boot
So as you can see I'm really struggling for disk space, I need some help on junk files I can delete first?

What I would like to do is move 15gb's from tmpfs to /dev/sdb2, is that possible, if so can you tell me how?

Thanks.
 
Old 07-17-2013, 11:07 AM   #2
snowday
Senior Member
 
Registered: Feb 2009
Posts: 4,667

Rep: Reputation: 1411Reputation: 1411Reputation: 1411Reputation: 1411Reputation: 1411Reputation: 1411Reputation: 1411Reputation: 1411Reputation: 1411Reputation: 1411
Welcome to the forums! I'm afraid we can't tell from the data you've provided which files are "junk" and safe to delete. Generally speaking, the first place you should look is your /home folder, look for large files such as videos, music, etc. that you can back up to an external drive and then delete from your hard drive (/dev/sdb2).

A utility I find useful is 'baobab' (a GUI disk usage analyzer available in the repositories of most distros).

Last edited by snowday; 07-17-2013 at 11:08 AM.
 
Old 07-17-2013, 11:32 AM   #3
suicidaleggroll
LQ Guru
 
Registered: Nov 2010
Location: Colorado
Distribution: OpenSUSE, CentOS
Posts: 5,573

Rep: Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142
tmpfs is temporary storage in RAM, it's not hard drive space, so anything you put there will be lost as soon as you reboot.

Your hard drive is full, you need to start finding and deleting files off of it. Either that, or buy a bigger or secondary hard drive.
 
Old 07-17-2013, 12:10 PM   #4
teckk
LQ Guru
 
Registered: Oct 2004
Distribution: Arch
Posts: 5,137
Blog Entries: 6

Rep: Reputation: 1826Reputation: 1826Reputation: 1826Reputation: 1826Reputation: 1826Reputation: 1826Reputation: 1826Reputation: 1826Reputation: 1826Reputation: 1826Reputation: 1826
Some examples:
Code:
ls -lS
Will show you files in directory by size.
Code:
find / -size +100M > file.txt
Find files in / over 100Mb in size.
Code:
du -a / | sort -n -r | head -n 30
Find the 30 largest files on machine.
Code:
du -a ~ | sort -n -r | head -n 30
Find 30 biggest files in home

You get the idea. Find out where the big files are.
I would not delete any thing that's not in home.
You can also get rid of some software that you don't use.
 
Old 07-17-2013, 01:56 PM   #5
selfprogrammed
Member
 
Registered: Jan 2010
Location: Minnesota, USA
Distribution: Slackware 13.37, 14.2, 15.0
Posts: 635

Rep: Reputation: 154Reputation: 154
What has taken that much space ?
1. Photos
2. Downloads
3. Games
4. I don't know
5. etc..

"I don't know" can be helped, the others you have to decide.

Logged in a your user, and at your home directory
>> du

which will give you a listing of all your directories and their usage.

>> du > du_log

will let you look at the du_log file more easily.

>> less du_log

Check your system logs. They can grow hideously large if you have some babbling problem devices, or you just reboot often.
If greater than a few MB, then switch to a new log file.
This is a protected file so there is a special command that I do not remember right now.
Location is /var/tmp/log if I remember right.

You might check /tmp, especially if you are in the habit of killing programs without letting them delete temporary files.
This is where temporary files reside.
After a few months, I usually have about 20 files in /tmp that can be deleted.
There will be some things in there that should be left alone, especially directories and printing stuff.

In /tmp, it is probably safe to delete anything older than your last boot, that your user owns, where you know what program left it behind.
I do not know of any program that would keep a reference to a /tmp file after a reboot.

Use tar or other archives to store photos and other large files that you do not access frequently. These can be stored in compressed format which can save 20% of your usage or more. The file managers can still open compressed formats and read files from within them.

Consider zip, gnuzip, bz2, compressed file formats.

To see archive programs
>> man -k archive

Consider using subversion, GIT, or another repository for things where you have many nearly identical versions. These will store the original, and differences, which takes much less space.

Check where you could use soft links, instead of a copy of a file, or directory.
>> ln -s <remote file location> <name of local link>

Write some stuff to CDROM. This takes an large amount of free disk space to create the ISO image, so it must be done before your drive gets too full. It involves moving files to a cdrom-tmp directory, with the total less than 650 MB, then creating an ISO image of that cdrom-tmp directory, and then writing the ISO image to a CDROM. When the CDROM has been verified as readable, the cdrom-tmp directory can be deleted.

Use tar to create backups of your large directories (use --bzip2). Collect them to a directory and write them to CDROM. Files can be retrieved from the backup whenever needed, so you can clean many files from the directories that you have backed-up.

If you installed everything by default then there is some that could be removed, but it is tedious to find and decide.
A few MB could be found in /usr/doc because so many of the programs have documentation that is mostly just another copywrite copy. Maybe 20% of the programs have documentation there that you might want to access someday.

Internationalization is known to take excessive disk space. If you installed all the international files and use only one, then the others can be removed (like French, German , Swahili, Chinese, etc.). This is best done in your distribution configuration if it can. It can be tedious to track down for each program. You really need to know which one you are using, otherwise you will delete the wrong one. May be easier to reinstall individual programs without internationalization.
Start looking in /usr/share

Avoid compressing the whole drive (it is possible I have heard) because it takes special steps to mount and use, and you would still need a small uncompressed drive to boot.

After considering all this, consider focusing your question on one particular problem area that you found.

Last edited by selfprogrammed; 07-17-2013 at 02:40 PM.
 
Old 07-17-2013, 03:00 PM   #6
jefro
Moderator
 
Registered: Mar 2008
Posts: 21,978

Rep: Reputation: 3624Reputation: 3624Reputation: 3624Reputation: 3624Reputation: 3624Reputation: 3624Reputation: 3624Reputation: 3624Reputation: 3624Reputation: 3624Reputation: 3624
Howdy themchost.

I agree that you have seeming run out of space.


Trash can, browser cache and such may be a source of files to delete.


Some apps might lock up space like virtualbox.


If you are running btrfs then use tools to delete snapshots. If Opensuse then use snapper.
 
  


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
2 hard drive question cabrando MEPIS 3 11-02-2005 03:43 PM
2 Hard Drive Question jmelgin Linux - Newbie 2 09-15-2003 07:06 PM
Hard Drive question 1_8_7 Slackware 25 08-25-2003 03:47 PM
hard drive question kylo8787 Linux - General 2 03-01-2002 03:51 AM
Hard drive question msmith7735 Linux - General 6 12-03-2001 07:06 AM

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

All times are GMT -5. The time now is 12:33 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