LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (https://www.linuxquestions.org/questions/linux-general-1/)
-   -   Hard Drive question (https://www.linuxquestions.org/questions/linux-general-1/hard-drive-question-4175469949/)

themchost 07-17-2013 11:04 AM

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.

snowday 07-17-2013 11:07 AM

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).

suicidaleggroll 07-17-2013 11:32 AM

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.

teckk 07-17-2013 12:10 PM

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.

selfprogrammed 07-17-2013 01:56 PM

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.

jefro 07-17-2013 03:00 PM

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.


All times are GMT -5. The time now is 03:56 PM.