View previous topic :: View next topic |
Author |
Message |
dhil n00b
Joined: 17 Dec 2008 Posts: 31 Location: @ home
|
Posted: Mon Jun 08, 2009 10:16 am Post subject: need to free harddisk space, help me |
|
|
Hello guys,
I got a OVH server and unfortunatly i dont have so much spaceo n the server..
these are my harddisk specs.
Filesystem Size Used Avail Use% Mounted on
/dev/sda1 2.9G 2.8G 0 100% /
/dev/sda2 6.8G 2.5G 4.0G 38% /home
shm 947M 0 947M 0% /dev/shm
I need to free some space inorder to run mysql - i really dont understand what takes so much space.. can someone give some hint where i can start cleaning stuff so that i can run my mysql database again.
Thankyou so much in advance
Google helps :
eclean distfiles
gives me an error like " Missing digest for and a lot of file names "
an example : Missing digest for '/usr/local/portage-ovh/app-admin/collectd-ovh/collectd-ovh-3.9.2.ebuild'
eclean packages
* Building file list for packages cleaning...
* Your packages directory was already clean.
please do help me guys.. |
|
Back to top |
|
|
MaximeG l33t
Joined: 15 Apr 2008 Posts: 722 Location: Belgium
|
Posted: Mon Jun 08, 2009 10:35 am Post subject: |
|
|
Hi,
You can manually clean the distfiles, by just getting rid of them with the "rm" command.
That should release some spaces.
Regards,
Maxime _________________ Future is wide open. |
|
Back to top |
|
|
dhil n00b
Joined: 17 Dec 2008 Posts: 31 Location: @ home
|
Posted: Mon Jun 08, 2009 10:45 am Post subject: |
|
|
i just removed arround 60 MB but still sda1 is 100% used.. what else can i try to free some space ? |
|
Back to top |
|
|
Nerevar l33t
Joined: 31 May 2008 Posts: 720
|
Posted: Mon Jun 08, 2009 11:15 am Post subject: |
|
|
Try "emerge --depclean -a". Be sure to verify the list returned contains items you're ok with removing.
Also, you can safely remove left over build files from /var/tmp/portage. |
|
Back to top |
|
|
h0mer`- Apprentice
Joined: 02 Aug 2004 Posts: 215
|
Posted: Mon Jun 08, 2009 11:50 am Post subject: |
|
|
my(sql) guess - binary logs.
did you disable them or set a timeframe how long to keep the logfiles?
well here are the steps you can do to check.
connect to your mysql console as root and type
you can delete them with
Code: | flush logs;
reset master; |
also you can set the timeframe for autoexpire of your logs in your /etc/mysql/my.cnf with
Code: | expire_logs_days = 14 |
good luck |
|
Back to top |
|
|
dhil n00b
Joined: 17 Dec 2008 Posts: 31 Location: @ home
|
Posted: Mon Jun 08, 2009 11:55 am Post subject: |
|
|
all the mysql stuff are on /home directory so its not a problem, got plenty of space..
running this command emerge --depclean -a gives the following output, and i am unable to understand what it means problem and what i should do. please be kind to advice me
* Depclean may break link level dependencies. Thus, it is
* recommended to use a tool such as `revdep-rebuild` (from
* app-portage/gentoolkit) in order to detect such breakage.
*
* Always study the list of packages to be cleaned for any obvious
* mistakes. Packages that are part of the world set will always
* be kept. They can be manually added to this set with
* `emerge --noreplace <atom>`. Packages that are listed in
* package.provided (see portage(5)) will be removed by
* depclean, even if they are part of the world set.
*
* As a safety measure, depclean will not remove any packages
* unless *all* required dependencies have been resolved. As a
* consequence, it is often necessary to run `emerge --update
* --newuse --deep world` prior to depclean.
Calculating dependencies / * Missing digest for '/usr/local/portage-ovh/app-admin/collectd-ovh/collectd-ovh-3.9.2.ebuild' - * Missing digest for '/usr/local/portage-ovh/app-admin/rtm/rtm-0.8.15.ebuild' \ * Missing digest for '/usr/local/portage-ovh/mail-client/sqwebmail-ovh/sqwebmail-ovh-5.1.1.ebuild... done!
* Dependencies could not be completely resolved due to
* the following required packages not being installed:
*
* >=dev-lang/python-2.5 pulled in by:
* sys-apps/portage-2.1.6.11
*
* x11-proto/inputproto pulled in by:
* x11-proto/xextproto-7.0.2
*
* >=virtual/perl-Archive-Tar-1.26 pulled in by:
* mail-filter/spamassassin-3.2.1-r1
*
* >=virtual/perl-IO-Zlib-1.04 pulled in by:
* mail-filter/spamassassin-3.2.1-r1
*
* Have you forgotten to run `emerge --update --newuse --deep world` prior
* to depclean? It may be necessary to manually uninstall packages that no longer
* exist in the portage tree since it may not be possible to satisfy their
* dependencies. Also, be aware of the --with-bdeps option that is documented
* in `man emerge`.
these are the files in cd /var/tmp/portage
app-arch app-portage sys-apps
can i remove them all ?
app-arch app-portage sys-apps |
|
Back to top |
|
|
MaximeG l33t
Joined: 15 Apr 2008 Posts: 722 Location: Belgium
|
Posted: Mon Jun 08, 2009 12:19 pm Post subject: |
|
|
Hi,
Yep, you can remove anything from tmp.
Have you cleaned the distfiles ?
Regards,
Maxime _________________ Future is wide open. |
|
Back to top |
|
|
d2_racing Bodhisattva
Joined: 25 Apr 2005 Posts: 13047 Location: Ste-Foy,Canada
|
Posted: Mon Jun 08, 2009 12:31 pm Post subject: |
|
|
Hi, in fact you should check this :
Code: |
# du -sh /usr/portage/distfiles
# du -sh /var
# du -sh /tmp
|
|
|
Back to top |
|
|
d2_racing Bodhisattva
Joined: 25 Apr 2005 Posts: 13047 Location: Ste-Foy,Canada
|
Posted: Mon Jun 08, 2009 12:32 pm Post subject: |
|
|
Are you using ccache ? If so, you can delete a lot of tmp files inside /var or /tmp, I don't remeber the correct path. |
|
Back to top |
|
|
krinn Watchman
Joined: 02 May 2003 Posts: 7470
|
Posted: Mon Jun 08, 2009 1:12 pm Post subject: |
|
|
/var/tmp/portage is also a space eater (specially nodes) |
|
Back to top |
|
|
dhil n00b
Joined: 17 Dec 2008 Posts: 31 Location: @ home
|
Posted: Mon Jun 08, 2009 1:13 pm Post subject: |
|
|
output for du -sh /usr/portage/distfiles
8.0K /usr/portage/distfiles
du -sh /var
728M /var
3.9M /tmp
92K /var/tmp/portage
so i dont think its eating so much space.. i am desperate as my webservices are not running now :S
what can i do as the next step, if i do any kernel upgrade.. will it put any temp files ?
Last edited by dhil on Mon Jun 08, 2009 1:36 pm; edited 1 time in total |
|
Back to top |
|
|
Sysa Apprentice
Joined: 16 Mar 2005 Posts: 161 Location: Europe
|
Posted: Mon Jun 08, 2009 3:13 pm Post subject: |
|
|
dhil wrote: | output for du -sh /usr/portage/distfiles
8.0K /usr/portage/distfiles
du -sh /var
728M /var
3.9M /tmp
92K /var/tmp/portage
so i dont think its eating so much space.. i am desperate as my webservices are not running now :S
what can i do as the next step, if i do any kernel upgrade.. will it put any temp files ? |
In any case you'll need disk space not for a kernel upgrade only but for any routine update (daily, weekly, monthly etc - depends on your update policy).
As we can see you are using old 10Gb HDD, so it is better not to clean-up bytes but to add 1-2-3 more cheap used HDDs (any size but think about LVM + smartmontools) and expand the directories as need to. _________________ RedHat -> SuSE -> Debian -> Gentoo |
|
Back to top |
|
|
cokey Advocate
Joined: 23 Apr 2004 Posts: 3355
|
Posted: Mon Jun 08, 2009 7:05 pm Post subject: |
|
|
sounds weird if you HDD is full up 100%, nothing we suggest here will remove more than 1GB so there is likely to be something more serious going on.
What is the output of _________________ https://otw20.com/ OTW20 The new place for off the wall chat |
|
Back to top |
|
|
timeBandit Bodhisattva
Joined: 31 Dec 2004 Posts: 2719 Location: here, there or in transit
|
Posted: Mon Jun 08, 2009 8:35 pm Post subject: |
|
|
dhil wrote: | du -sh /var
728M /var | That's about 25% of your partition right there, so locating the big consumers within /var would be helpful. Please post also the output of: _________________ Plants are pithy, brooks tend to babble--I'm content to lie between them.
Super-short f.g.o checklist: Search first, strip comments, mark solved, help others. |
|
Back to top |
|
|
lyallp Veteran
Joined: 15 Jul 2004 Posts: 1589 Location: Adelaide/Australia
|
Posted: Wed Jun 10, 2009 12:16 pm Post subject: |
|
|
Easiest thing to do would be to post
Code: | du -s /usr/* /var/* /tmp/* /lib/* /boot/* | sort -r -n | head -20 | sort -r -n | head -20 |
This will give you your top 20 disk space directories, giving you a starting point. _________________ ...Lyall |
|
Back to top |
|
|
dhil n00b
Joined: 17 Dec 2008 Posts: 31 Location: @ home
|
Posted: Fri Jun 12, 2009 9:59 am Post subject: |
|
|
sorry for the late reply guys - i been out of town why i didnt reply.
guys, what i found out was qmail had over 300 MB - so i just removed the queue and wupti, its working, but i would like to clean up more space and learn more linux stuff its interesting
once the queue was removed : i got df -h
/dev/sda1 2.9G 2.6G 160M 95% /
so again something is taking space
results requested :
du -shx /var/*
32K /var/bind
154M /var/cache
51M /var/db
4.0K /var/empty
122M /var/lib
12K /var/lock
0 /var/log
0 /var/mail
4.1M /var/qmail
214M /var/run
1.4M /var/spool
4.0K /var/state
12K /var/tmp
du -s /usr/* /var/* /tmp/* /lib/* /boot/* | sort -r -n | head -20 | sort -r -n | head -20
732116 /usr/src
595260 /usr/portage
277108 /usr/lib
224984 /usr/share
218984 /var/run
157148 /var/cache
124232 /var/lib
97844 /usr/libexec
51540 /var/db
49048 /usr/local
48888 /usr/bin
22832 /usr/include
15584 /usr/sbin
4112 /var/qmail
3240 /boot/bzImage-2.6.24.5-xxxx-std-ipv4-32
3196 /boot/bzImage-2.6.24.5-xxxx-grs-ipv4-32
3128 /boot/bzImage-2.6.24.2-xxxx-std-ipv4-32
2296 /usr/i686-pc-linux-gnu
1648 /boot/bzImage-2.4.33-grs-bipiv-ipv4-32-yukon
1428 /var/spool
so far thankyou for all the reponses.. the server is a ovh server - virtual server, so i cannot just add my own hdd- it will cost me much more - to keep the expenses low, i try to clean up and also learn more |
|
Back to top |
|
|
timeBandit Bodhisattva
Joined: 31 Dec 2004 Posts: 2719 Location: here, there or in transit
|
Posted: Fri Jun 12, 2009 1:49 pm Post subject: |
|
|
dhil wrote: | 122M /var/lib
214M /var/run | These are somewhat large. Please post the output of du -h --max-depth 1 /var/{lib,run}. They probably hold data your server needs but perhaps we'll find something you can clean up, like the mail queue.
Quote: | 732116 /usr/src
595260 /usr/portage | These are your big offenders: kernel sources and Portage distfiles. Remove old kernel sources you don't need and run make clean on the tree for your installed kernel. Run eclean --destructive distfiles to get rid of source tarballs for all packages not actually installed on your server. Together, these should reclaim 400-700MB of disk space.
A cautionary note, since this is a small server: save make clean on the kernel for last. If you are happy with the space recovered up to that point, skip that step. If you do proceed, check the free space before and after, and note the difference--you'll need at least that much free space to rebuild the kernel. _________________ Plants are pithy, brooks tend to babble--I'm content to lie between them.
Super-short f.g.o checklist: Search first, strip comments, mark solved, help others. |
|
Back to top |
|
|
lyallp Veteran
Joined: 15 Jul 2004 Posts: 1589 Location: Adelaide/Australia
|
Posted: Fri Jun 12, 2009 2:27 pm Post subject: |
|
|
In my opinion, simply do a backup of /usr/src/linux/.config, then do a 'rm -fr /usr/src/*' - you dont need any of it to run a system. Next time you want to build the kernel, re-emerge the sources and restore the .config file.
The same applies to /usr/portage - 'rm -fr /usr/portage/*' - after all, the next 'emerge --sync' will pull it all back.
Using the above 2 commands will save you 1.5G of stuff that is not needed for a running system. You don't need the portage directory or the kernel build directory to 'run' your system, only to 'build' your system.
Now, a development system or a build system, that is another story. _________________ ...Lyall |
|
Back to top |
|
|
timeBandit Bodhisattva
Joined: 31 Dec 2004 Posts: 2719 Location: here, there or in transit
|
Posted: Fri Jun 12, 2009 3:42 pm Post subject: |
|
|
lyallp wrote: | In my opinion, simply do a backup of /usr/src/linux/.config, then do a 'rm -fr /usr/src/*' - you dont need any of it to run a system. Next time you want to build the kernel, re-emerge the sources and restore the .config file.
The same applies to /usr/portage - 'rm -fr /usr/portage/*' - after all, the next 'emerge --sync' will pull it all back. |
No. This is bad advice.
First: Unless it can be remote-mounted from another host, it's risky to remove the Portage tree from a space-constrained system. It becomes all to easy to reduce available space below the minimum needed for the tree. When maintenance is eventually required it may prove difficult or impossible to re-sync without offloading files. Sure, there are ways, but it's a lot of needless work.
A better approach is to prune directories selectively. For example, a no-nonsense, console-only server might have no need for anything in games-* or x11-*. These could be removed and listed in /etc/portage/rsync_excludes so they wouldn't be restored by a sync.
Second, but more important: The source for a server's running kernel should not be discarded lightly. The OP has 2.6.24 kernels on the machine and these are already gone from Portage. Kernel versions tend to age out of the tree quickly. Although the ebuilds can be recovered from CVS, once the patch tarballs are gone from the mirrors it can be extremely difficult to recover them. No patch tarballs, no kernel--and the response, "just update" is invalid because with servers, there are often excellent reasons to stick with a particular kernel.
The kernel could, of course, be maintained on another machine with a compatible compiler and (S)FTP'd to the target. My point is that precautions must be considered before removing critical system components. _________________ Plants are pithy, brooks tend to babble--I'm content to lie between them.
Super-short f.g.o checklist: Search first, strip comments, mark solved, help others. |
|
Back to top |
|
|
lyallp Veteran
Joined: 15 Jul 2004 Posts: 1589 Location: Adelaide/Australia
|
Posted: Sat Jun 13, 2009 6:47 am Post subject: |
|
|
Points taken. _________________ ...Lyall |
|
Back to top |
|
|
dhil n00b
Joined: 17 Dec 2008 Posts: 31 Location: @ home
|
Posted: Sat Jun 13, 2009 9:59 pm Post subject: |
|
|
hi guys -
thankyou for your prompt replies
here is the output requested u guys should know i appriciate your h elp a lot
du -h --max-depth 1 /var/{lib,run}
4.0K /var/lib/arpd
86M /var/lib/clamav
8.0K /var/lib/clockspeed
30M /var/lib/collectd
4.0K /var/lib/courier-imap
8.0K /var/lib/courier
84K /var/lib/init.d
4.0K /var/lib/ip6tables
4.0K /var/lib/iptables
4.0K /var/lib/krb5kdc
4.0K /var/lib/misc
16K /var/lib/nfs
12K /var/lib/openldap-data
4.0K /var/lib/openldap-ldbm
4.0K /var/lib/openldap-slurp
24K /var/lib/php-pkg
24K /var/lib/portage
4.0K /var/lib/run
6.5M /var/lib/slocate
4.0K /var/lib/spamassassin
8.0K /var/lib/gentoo
122M /var/lib
8.0K /var/run/clamav
255M /var/run/mysqld
8.0K /var/run/named
4.0K /var/run/openldap
12K /var/run/proftpd
8.0K /var/run/screen
8.0K /var/run/spamd
255M /var/run
make clean didnt free up any spaces at all .. still 96 % hdd used
eclean --destructive distfiles
* Building file list for distfiles cleaning...
* Missing digest for '/usr/local/portage-ovh/app-admin/collectd-ovh/collectd-ovh-3.9.2.ebuild'
* Missing digest for '/usr/local/portage-ovh/app-admin/rtm/rtm-0.8.15.ebuild'
* Missing digest for '/usr/local/portage-ovh/mail-client/sqwebmail-ovh/sqwebmail-ovh-5.1.1.ebuild'
* Your distfiles directory was already clean.
also this didnt clean enough ... please guide me throug the next step .. |
|
Back to top |
|
|
dhil n00b
Joined: 17 Dec 2008 Posts: 31 Location: @ home
|
Posted: Mon Jun 15, 2009 8:53 am Post subject: |
|
|
hey guys.
i heard some guys talking about disabling mysql binary logs .. is it a good idea ? If it is, how can i delete old binary logs and eventually stop binary logs ?
since i stopped qmail, no activation mails from my board goes to the registered member.. so i need to restart the qmail service .. so a soloution can be, weekly delete qmail logs .
for each day something is getting bigger and bigger
Filesystem Size Used Avail Use% Mounted on
/dev/sda1 2.9G 2.7G 83M 98% /
/dev/sda2 6.8G 2.5G 4.0G 39% /home
shm 947M 0 947M 0% /dev/shm
having been trying to clear logs - i tried the following command :
flush logs;
Query OK, 0 rows affected (0.80 sec)
does this mean their is no binary log ? |
|
Back to top |
|
|
_SerEga_ n00b
Joined: 13 Jun 2009 Posts: 30 Location: Gatchina, Russia
|
Posted: Mon Jun 15, 2009 1:20 pm Post subject: |
|
|
You can zip portage tree and mount it with sys-fs/fuse-zip, since portage is a lot of text files it compression ratio will be good.
Quote: | Description: fuse-zip is a FUSE file system to navigate, extract, create and modify ZIP archives |
overlay zugaina |
|
Back to top |
|
|
dhil n00b
Joined: 17 Dec 2008 Posts: 31 Location: @ home
|
Posted: Mon Jun 15, 2009 1:35 pm Post subject: |
|
|
wow serga - i am a real noob here -- knowing nothing - this is my first virtual server and its actually in production
zip portage tree and mouth it with sys-fs ? what will this help ? do u mean i have to zip it and move it to another disk ? |
|
Back to top |
|
|
timeBandit Bodhisattva
Joined: 31 Dec 2004 Posts: 2719 Location: here, there or in transit
|
Posted: Mon Jun 15, 2009 1:47 pm Post subject: |
|
|
dhil wrote: | Code: | 86M /var/lib/clamav
255M /var/run/mysqld |
| Your big consumers here are MySQL and ClamAV. Without knowing how and why you are using MySQL, I can't say whether 255MB represents mostly space you can reclaim (logs) or your data. You should continue investigating this area. I know nothing helpful about ClamAV and its disk space needs; even so, it's small potatoes.
Quote: | make clean didnt free up any spaces at all .. still 96 % hdd used | That's a little surprising, only because most people never bother to clean their kernel tree. However, you skipped the most important step I recommended: I wrote: | Code: | 732116 /usr/src
595260 /usr/portage | These are your big offenders: kernel sources and Portage distfiles. Remove old kernel sources you don't need and run make clean on the tree for your installed kernel. | You have two or three kernel trees installed in /usr/src. You only need to keep the one that matches your installed, running kernel. Un-merge the others. You can reclaim about half a gigabyte right here. _________________ Plants are pithy, brooks tend to babble--I'm content to lie between them.
Super-short f.g.o checklist: Search first, strip comments, mark solved, help others. |
|
Back to top |
|
|
|