LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   /var/cache full (https://www.linuxquestions.org/questions/linux-newbie-8/var-cache-full-512318/)

jeffmski 12-20-2006 02:14 PM

/var/cache full
 
Hello I'm a Linux newbie. Just recently installed FC 6 and set my /var partition to 500M as suggested (This was a FC 5 book that suggested the size). I'm attempting to add the KDE environment and while downloading dependencies it reports that my /var/cache is full. Is this a cache whose contents I can delete to make space? Is the 500M partition too small? When I previosuly had FC 5 installed and attempted to upgrade Linux I ran out of space but I can't recall where but assume it was the /var area. Am I missing something here? Any help would be greatly apreciated!!

JimBass 12-20-2006 07:50 PM

500 Mb is absurdly small for var. Unless your entire linux system is smaller than 3 Gb, var should have some size to it. All the system info ends up in /var/log, and /var/cache holds the upgrade files most likely. I just checked my laptop, and a 22 gig install uses 786 Mb of space in /var, and I take steps to minimize what is kept there.

If you are doing this on a machine of 20 Gb or more, I would think you would want at least 3 Gb for var.

Look up resizing partitions to get more space into your /var partition.

Peace,
JimBass

jeffmski 12-21-2006 07:55 AM

Ok, thanks. I have no idea why the book I'm using as my guide suggested 500M. As I'm not totally familiar with Linux, LVM and Linux's method of resizing partitions yet, I'm curious if there is a way to edit a config file to redirect the /var/cache to another partition with sufficient space?

mushk45 12-21-2006 03:14 PM

Quote:

I'm curious if there is a way to edit a config file to redirect the /var/cache to another partition with sufficient space?
Of course! Welcome to linux!

To redirect the /var/cache to another partition with sufficient space:

open a shell.
login as root.

type: umount /var (be sure no program is using /var - I'm not sure if this will work)

the config file that controls this is /etc/fstab
type: gedit /etc/fstab

you can now change the first field before /var to an unused partition (hopefully with more space!)

type: mount /var

Or, if partition with the root folder "/" has enough space,
you can comment the line with /var by adding a # at the beginning of the line. That way, /var will be mounted along the / folder.

reboot:)

JimBass 12-21-2006 07:05 PM

Quote:

type: umount /var (be sure no program is using /var - I'm not sure if this will work)
Nope!!! /var/run most likely has all the running processes on your system. Trying to unmount that will either fail or crash I would expect.

Code:

jim@jimsworktop:~$ ls /var/run/
acpid.socket                exim4                      screen
alsa                        hal                        sensord.pid
atd.pid                      hotkey-setup                sshd
battery-stats-collector.pid  hotkey-setup.thinkpad-keys  sshd.pid
crond.pid                    identd                      sudo
crond.reboot                inetd.pid                  syslogd.pid
cups                        klogd.pid                  utmp
dbus                        lpd.pid                    vpnc
dhclient.eth0.pid            motd                        vsftpd
dhclient.eth1.pid            network                    xfs.pid
dirmngr                      ntpd.pid                    Xprint_servers
dirmngr.pid                  pppconfig                  Xprt_0.pid
dldrconfig-buildlog.txt      rpc.statd.pid
dldrwebconfd.pid            samba

The only way to tweak /var safely is to reboot with a live CD (Knoppix, or any of the ever growing live CD families) and do as suggested, maybe swapping /var with another location. Personally, I would at least change the size to be several gigs. If you installed on a LVM that is possible, or just kill it and reinstall. And throw that book away. 500 Mb for var, yeah sure, maybe in 1999 drive spaces!

I refuse to touch any rpm based distro, as they feel like open source windows to me. It may be possible to reconfigure yum or whatever package manager you use to usea different location for the cache, but I still suggest reformatting, that var is way too small.

Peace,
JimBass

mushk45 12-21-2006 07:11 PM

Quote:

Nope!!! /var/run most likely has all the running processes on your system.
Haha...so u can't unmount it...

I guess one could still be able to edit /etc/fstab and reboot so changes could take effect.

JimBass 12-21-2006 07:56 PM

Yes and no. You could certainly edit /etc/fstab and reboot to have the changes take effect, but unless you copy things manually before hand, you can get into alot of trouble.

Say for example the OP had the now famous 500 Mb partition mounted as /var, and say for the sake of argument he had a 3 Gb /usr partition. Say he changes the mountpoints in /etc/fstab, then reboots. He'll hit a kernel panic, or some other serious error. Processes will try to place their run .pid file in /var/run, but although you mounted var in the bigger partition, you didn't move the subdirectories. /var/run/ just doesn't exist, so most/all services would fail to start.

The "safe" way to go would be to use a live CD, copy all the contents of /var to a 3rd location, copy the usr contents into the old /var partition, drop the old /var contents into the old /usr, then change /etc/fstab (swapping the usr and var mountpoints) then reboot and take out the live CD. Then you'll have a 3 Gb var with all necessary subdirectories, and a 500 Mb /usr.

Which is why I say kill that partiton scheme. 500 Mb is too small for anything other than /boot or swap, unless it is a tiny system.

Peace,
JimBass

mushk45 12-22-2006 12:43 PM

ok, I won't guess anymore!

BTW, my /var folder on Slackware 10.0 is about 24 mb's :P

sarthor 12-30-2006 02:53 PM

how to clear my cache directory
 
HI,
I am using FC3, In squid.conf i have assigned cache_dir ufs /var/spool/squid 18000 16 256
and now when i am checking my cache by the command $du -mach /var/spool/squid it shows me 20 gb cache, And i am also getting some errors (Can not post that error now, i am somewhere else) in $tail -f /var/log/messeges, the Questoin that i want to ask, is How can i Clear my cache_dir (/var/spool/squid), by deleting and making dir again its creat error (may be the SElinux Error)I think thats permission error, I dont know what permission will it need in FC3,
Dear Friends i am new to linux, Hope you people will reply in the easy way to understand
Thank you all.

masonm 12-30-2006 03:35 PM

Quote:

Originally Posted by mushk45
ok, I won't guess anymore!

BTW, my /var folder on Slackware 10.0 is about 24 mb's :P

The size of /var varies (hence the name) depending on what you have running at any given time.

Most package/update managers, including RPM based ones like YUM, typically use a directory (usually cache) /var to store downloaded packages.

My Slack /var is around 654MB at the moment.

I would never recommend a /var of less than 1GB on any modern system and 3GB sounds more reasonable for a distro like FC.

The best way to move /var would be to use a LiveCD as already mentioned. You can work on the partitions and edit fstab as needed.

I normally recommend just creating a /var directory in / so that as long as / is a decent size you don't run into these sorts of problems.

Electro 12-30-2006 04:50 PM

With my Gentoo setup, I gave 2GB to /var and 500 MB for /var/log. About 200 MB is taken up in /var and 11 MB is taken up in /var/log.

The problem putting /var in the same partition where / is kept is the file /var/log/messages sometimes gets huge. To stop this from happening, I suggest a separate partition for /var/log. Though if /var is in the same partition where / is located and / is 100% full using man and some utilities will not work. Creating a partition for /var is actually better than placing in with the same partition where / is kept.

Most RPM based distributions gives you an option keeping or not keeping what is installed. By default they are set to keep, so you can uninstall it later. You can delete them to make more space, but you will not be able to find out what programs you have installed and you will not be able to uninstall them.

masonm 12-30-2006 08:45 PM

The size of /var/log/messages is the same regardless of whether /var is located in / or on it's own partition so I don't get your point. There really is no advantage to putting /var on a separate partition unless you're running a server.

The obvious disadvantage is exactly what the OP is struggling with.


All times are GMT -5. The time now is 09:30 PM.