LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
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-22-2012, 07:11 PM   #1
themess
Member
 
Registered: Jul 2008
Location: Indiana
Distribution: Debian
Posts: 31

Rep: Reputation: 0
Root is full. How can I figure out what do delete, and best way to do so?


Debian Squeeze. I've run Linux for two years, but am still a neophyte.

/sda1 is boot partition, size is 333 MiB, 318 MiB used.
/sda2 is an extended partition containing
/sda5 /usr, size is 8.4 GiB, 4.7 GiB used
/sda6 /var, size is 2.8 GiB, 550 MiB used
/sda7 is swap, 6.3 GiB
/sda8 /tmp, size is 380 MiB, 22 MiB used
/sda9 is /home, size is 354 GiB, 75 GiB used

Problem started yesterday after using Lucky Backup, a graphical front end for rsync. There were two error messages that I did not understand or record.

Disk Usage Analyzer (Baobab) shows
/ 100% used, size is 70.4 GB
/home 92.8% used, size is 65.3 GB
/usr 6.3% used, size is 4.4 GB
Nothing else is above 0.2% used.

I searched this forum for full root, finding several threads. rsync operation to an unmounted drive caused this problem once.

Problem was bad this morning, could not open more than a few programs at once, and once could not boot. Was able to copy /home to an external HD.

Other threads recommend removing unnecessary files from /var/tmp and /var/log, saying that most files there aren't needed. I deleted most of /var/tmp, after copying those to /home.


So:

1) How do I learn which files I can delete?
2) How can I prevent this type of problem?

Thanks,

Tom
 
Old 10-22-2012, 07:48 PM   #2
GlennsPref
Senior Member
 
Registered: Apr 2004
Location: Brisbane, Australia
Distribution: Devuan
Posts: 3,657
Blog Entries: 33

Rep: Reputation: 283Reputation: 283Reputation: 283
Hi, tricky situation.

I would login as root and umount /home and then delete all unwanted files and dir's.

<edit>, or /home for that matter, now it is unmounted, it (the real home data) is safe.</edit>

And reboot.

rm -rf (can't be undone without special tools and a spare system disk, IMO)

I wouldn't go this far but IF...

If you remove any directories /nnn you will need to recreate them, as root, before rebooting.

mkdir /mnt
mkdir /media

Regards Glenn

Last edited by GlennsPref; 10-22-2012 at 08:28 PM. Reason: edit, ooops! my bad
 
Old 10-22-2012, 07:55 PM   #3
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Rocky 9.2
Posts: 18,359

Rep: Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751
Unfortunately, your 2 lists of disk space don't match up eg no partition appears to be defined for root ('/') in the first, but it's in the 2nd list.
Can you get into a terminal, preferably as root and run
Code:
# note: lowercase L here, not 1
fdisk -l

df -h
and show the results using code tags as described here https://www.linuxquestions.org/quest...do=bbcode#code
 
Old 10-22-2012, 08:16 PM   #4
frankbell
LQ Guru
 
Registered: Jan 2006
Location: Virginia, USA
Distribution: Slackware, Ubuntu MATE, Mageia, and whatever VMs I happen to be playing with
Posts: 19,324
Blog Entries: 28

Rep: Reputation: 6142Reputation: 6142Reputation: 6142Reputation: 6142Reputation: 6142Reputation: 6142Reputation: 6142Reputation: 6142Reputation: 6142Reputation: 6142Reputation: 6142
I would urge caution. Typically, the files in /media and /mnt don't take up much space, as they are merely mount points. For example, here's what du tells me about my /media (the totals are in bytes, not in KBs or MBs or GBs):

Code:
4       ./media/cdrom1
4       ./media/floppy0
4       ./media/cdrom0
398272632       ./media/sdb5
459171304       ./media/sdb1
857443952       ./media
Note that the large file sizes are actually the count of files on my external hard drive and are not directly in /media.

As root and from the root directory, try running the command du --max-depth=2 (see man du for details). That will give you a much better idea of where the offending files are.

If they are in /home, as I would suspect, it should be a fairly simple matter to identify which ones you wish to delete, which ones you wish to transfer to external media or another computer, and which ones you wish to keep in /home.

If you are unable to boot because of this condition, you can boot to a Live CD of something, mount your hard drive, and run the command on the hard drive from your Live CD.

Good luck.

Last edited by frankbell; 10-22-2012 at 08:19 PM.
 
Old 10-22-2012, 08:35 PM   #5
GlennsPref
Senior Member
 
Registered: Apr 2004
Location: Brisbane, Australia
Distribution: Devuan
Posts: 3,657
Blog Entries: 33

Rep: Reputation: 283Reputation: 283Reputation: 283
I suspect you have a /home folder on / when umount /home.
Quote:
/sda9 is /home, size is 354 GiB, 75 GiB used
/var and /usr are not on / there for erasing files from there won't affect / being full.
 
Old 10-22-2012, 09:51 PM   #6
themess
Member
 
Registered: Jul 2008
Location: Indiana
Distribution: Debian
Posts: 31

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by GlennsPref View Post
Hi, tricky situation.

I would login as root and umount /home and then delete all unwanted files and dir's.

<edit>, or /home for that matter, now it is unmounted, it (the real home data) is safe.</edit>

And reboot.

rm -rf (can't be undone without special tools and a spare system disk, IMO)

I wouldn't go this far but IF...

If you remove any directories /nnn you will need to recreate them, as root, before rebooting.

mkdir /mnt
mkdir /media

Regards Glenn
I don't understand. sda1, the boot partition, seems to be the one with very little free space. /home seems to have 200+ GiB of free space. There is very little in /home that I want to delete.

I have emptied the trash. Doesn't that completely free the disk space that had been occupied by deleted files?
 
Old 10-22-2012, 09:56 PM   #7
themess
Member
 
Registered: Jul 2008
Location: Indiana
Distribution: Debian
Posts: 31

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by GlennsPref View Post
I suspect you have a /home folder on / when umount /home.

/var and /usr are not on / there for erasing files from there won't affect / being full.
I don't understand. Are you saying that /home is on root, but /var and /usr are not?

I haven't unmounted /home.
 
Old 10-22-2012, 11:08 PM   #8
GlennsPref
Senior Member
 
Registered: Apr 2004
Location: Brisbane, Australia
Distribution: Devuan
Posts: 3,657
Blog Entries: 33

Rep: Reputation: 283Reputation: 283Reputation: 283
If a command was given (as root) to write to /home/some/users/directory/... and /home was not mounted (fstab errors aside) the program may create the directory.

This is what happends with /var not being mounted at boot. The system may not complain, just create the directories it requires to function.

When you boot with the drive connected and mounted you can't access the new entries in /var. The have disapeared.

umount the partition and see if the folder is duplicated in some form.

...........

I'm saying that when you used rsync it wrote to the wrong partition and filled / up.

same if /var is not mounted, it will be created on / as /var

This could occur if you

rsync -avh / /home ....

That statement is also recusive, saving /home/to /home/home....plus the backup + the backup.....

So just what was the command you used?

look for a /home dir after you umount /home (sda9)
 
Old 10-22-2012, 11:14 PM   #9
GlennsPref
Senior Member
 
Registered: Apr 2004
Location: Brisbane, Australia
Distribution: Devuan
Posts: 3,657
Blog Entries: 33

Rep: Reputation: 283Reputation: 283Reputation: 283
Sorry I have not been very clear.
Quote:
what was the command you used?
exactly...

Last edited by GlennsPref; 10-22-2012 at 11:15 PM. Reason: There were two error messages that I did not understand or record.
 
Old 10-22-2012, 11:54 PM   #10
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Rocky 9.2
Posts: 18,359

Rep: Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751
The above is why I asked for the output of those 2 cmds; we need to clearly establish what we are looking at ...
 
Old 10-23-2012, 10:37 PM   #11
themess
Member
 
Registered: Jul 2008
Location: Indiana
Distribution: Debian
Posts: 31

Original Poster
Rep: Reputation: 0
I have done little command line work, so I spent two or three hours refamilliarizing myself with some things that I used a bit, 10 years ago. I found that about 30 meg of dropbox files had been dumped in /sda1, which is the boot directory. I carefully removed those using rm and rmdir. Free space in /sda1 is up to about 45 mb.

I haven't been able to run the suggested commands in exactly the way that was requested. I'm still working on it. But the system is now working normally.

The old installation of Debian, the one with problems, uses 287 mb of the 333 mb available. The new installation of Debian uses only 157 mb. So, there is still a problem. I need to keep working on it.

How can I run ls (or du) to find what is in sda1, sda5, and so on?

Thanks for the help!
 
Old 10-24-2012, 01:13 AM   #12
k3lt01
Senior Member
 
Registered: Feb 2011
Location: Australia
Distribution: Debian Wheezy, Jessie, Sid/Experimental, playing with LFS.
Posts: 2,900

Rep: Reputation: 637Reputation: 637Reputation: 637Reputation: 637Reputation: 637Reputation: 637
Quote:
Originally Posted by themess View Post
Debian Squeeze. I've run Linux for two years, but am still a neophyte.

/sda1 is boot partition, size is 333 MiB, 318 MiB used.

Quote:
Originally Posted by themess View Post
So:

1) How do I learn which files I can delete?
2) How can I prevent this type of problem?

Thanks,

Tom
It is possible /boot is full of old kernels.

1) Check in synaptic search for linux-image and linux-headers. If you have more than 2 of each you have way to many.
2) Do the above check every couple of months or so.
 
1 members found this post helpful.
Old 10-24-2012, 08:32 PM   #13
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Rocky 9.2
Posts: 18,359

Rep: Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751
Quote:
I haven't been able to run the suggested commands in exactly the way that was requested. I'm still working on it.
If you mean my suggestions in post #3, please show exactly what happened when you tried.
Note that you'd want to be root when doing them.
 
Old 10-26-2012, 06:43 PM   #14
themess
Member
 
Registered: Jul 2008
Location: Indiana
Distribution: Debian
Posts: 31

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by k3lt01 View Post
It is possible /boot is full of old kernels.

1) Check in synaptic search for linux-image and linux-headers. If you have more than 2 of each you have way to many.
2) Do the above check every couple of months or so.
A friend told me that Synaptic doesn't clean up after itself, nor does it delete old files after installing new ones.

I used Synaptic "Quick search". It shows a single installed copy of linux-image, linux-image-2.6.32-5-amd64
It does not show any installed linux-headers.
 
Old 10-26-2012, 08:29 PM   #15
frankbell
LQ Guru
 
Registered: Jan 2006
Location: Virginia, USA
Distribution: Slackware, Ubuntu MATE, Mageia, and whatever VMs I happen to be playing with
Posts: 19,324
Blog Entries: 28

Rep: Reputation: 6142Reputation: 6142Reputation: 6142Reputation: 6142Reputation: 6142Reputation: 6142Reputation: 6142Reputation: 6142Reputation: 6142Reputation: 6142Reputation: 6142
To clean up residue from installing *.deb files with the package manager, if there is any, you can run apt-get autoclean or aptitude autoclean as root.

You can learn more about aptitude here: http://algebraicthunk.net/~dburrows/...titude/doc/en/
 
  


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
My drive is full, and I can't figure out why? Leseguenni Linux - Newbie 6 11-22-2009 09:17 AM
RHEL4 root directory says full but sum of use is nowhere near full. Why? SteveInTallyFL Linux - Server 11 02-05-2009 05:45 AM
Can't figure out how to sync Apache and CVS root on fedora 9 b-mon3y Linux - Server 0 06-24-2008 09:04 AM
Can't figure out how to delete something from my trash can. Help please KezzerDrix Mandriva 4 04-01-2005 08:45 AM
Tried to delete file as root but it says I don't have permission to delete it! beejayzed Mandriva 23 03-12-2004 02:46 AM

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

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