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 |
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.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
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.
|
 |
|
10-22-2012, 08:11 PM
|
#1
|
Member
Registered: Jul 2008
Location: Indiana
Distribution: Debian
Posts: 31
Rep:
|
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
|
|
|
10-22-2012, 08:48 PM
|
#2
|
Senior Member
Registered: Apr 2004
Location: Brisbane, Australia
Distribution: Devuan
Posts: 3,690
|
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 09:28 PM.
Reason: edit, ooops! my bad
|
|
|
10-22-2012, 08:55 PM
|
#3
|
LQ Guru
Registered: Aug 2004
Location: Sydney
Distribution: Rocky 9.2
Posts: 18,426
|
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
|
|
|
10-22-2012, 09:16 PM
|
#4
|
LQ Guru
Registered: Jan 2006
Location: Virginia, USA
Distribution: Slackware, Ubuntu MATE, Mageia, and whatever VMs I happen to be playing with
Posts: 19,775
|
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 09:19 PM.
|
|
|
10-22-2012, 09:35 PM
|
#5
|
Senior Member
Registered: Apr 2004
Location: Brisbane, Australia
Distribution: Devuan
Posts: 3,690
|
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.
|
|
|
10-22-2012, 10:51 PM
|
#6
|
Member
Registered: Jul 2008
Location: Indiana
Distribution: Debian
Posts: 31
Original Poster
Rep:
|
Quote:
Originally Posted by GlennsPref
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?
|
|
|
10-22-2012, 10:56 PM
|
#7
|
Member
Registered: Jul 2008
Location: Indiana
Distribution: Debian
Posts: 31
Original Poster
Rep:
|
Quote:
Originally Posted by GlennsPref
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.
|
|
|
10-23-2012, 12:08 AM
|
#8
|
Senior Member
Registered: Apr 2004
Location: Brisbane, Australia
Distribution: Devuan
Posts: 3,690
|
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)
|
|
|
10-23-2012, 12:14 AM
|
#9
|
Senior Member
Registered: Apr 2004
Location: Brisbane, Australia
Distribution: Devuan
Posts: 3,690
|
Sorry I have not been very clear.
Quote:
what was the command you used?
|
exactly...
Last edited by GlennsPref; 10-23-2012 at 12:15 AM.
Reason: There were two error messages that I did not understand or record.
|
|
|
10-23-2012, 12:54 AM
|
#10
|
LQ Guru
Registered: Aug 2004
Location: Sydney
Distribution: Rocky 9.2
Posts: 18,426
|
The above is why I asked for the output of those 2 cmds; we need to clearly establish what we are looking at ...
|
|
|
10-23-2012, 11:37 PM
|
#11
|
Member
Registered: Jul 2008
Location: Indiana
Distribution: Debian
Posts: 31
Original Poster
Rep:
|
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!
|
|
|
10-24-2012, 02:13 AM
|
#12
|
Senior Member
Registered: Feb 2011
Location: Australia
Distribution: Debian Wheezy, Jessie, Sid/Experimental, playing with LFS.
Posts: 2,900
|
Quote:
Originally Posted by themess
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
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.
|
10-24-2012, 09:32 PM
|
#13
|
LQ Guru
Registered: Aug 2004
Location: Sydney
Distribution: Rocky 9.2
Posts: 18,426
|
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.
|
|
|
10-26-2012, 07:43 PM
|
#14
|
Member
Registered: Jul 2008
Location: Indiana
Distribution: Debian
Posts: 31
Original Poster
Rep:
|
Quote:
Originally Posted by k3lt01
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.
|
|
|
10-26-2012, 09:29 PM
|
#15
|
LQ Guru
Registered: Jan 2006
Location: Virginia, USA
Distribution: Slackware, Ubuntu MATE, Mageia, and whatever VMs I happen to be playing with
Posts: 19,775
|
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/
|
|
|
All times are GMT -5. The time now is 05:43 PM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|