LinuxQuestions.org
Latest LQ Deal: Linux Power User Bundle
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 12-20-2006, 02:14 PM   #1
jeffmski
LQ Newbie
 
Registered: Dec 2006
Location: New Jersey
Distribution: Fedora 6
Posts: 4

Rep: Reputation: 0
Question /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!!
 
Old 12-20-2006, 07:50 PM   #2
JimBass
Senior Member
 
Registered: Oct 2003
Location: New York City
Distribution: Debian Sid 2.6.32
Posts: 2,100

Rep: Reputation: 49
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
 
Old 12-21-2006, 07:55 AM   #3
jeffmski
LQ Newbie
 
Registered: Dec 2006
Location: New Jersey
Distribution: Fedora 6
Posts: 4

Original Poster
Rep: Reputation: 0
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?
 
Old 12-21-2006, 03:14 PM   #4
mushk45
LQ Newbie
 
Registered: Sep 2005
Distribution: Slackware 10.0 , Fedora 3, SUSE 9.2, Knoppix 5.0.1 (Live CD)
Posts: 25

Rep: Reputation: 15
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
 
Old 12-21-2006, 07:05 PM   #5
JimBass
Senior Member
 
Registered: Oct 2003
Location: New York City
Distribution: Debian Sid 2.6.32
Posts: 2,100

Rep: Reputation: 49
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
 
Old 12-21-2006, 07:11 PM   #6
mushk45
LQ Newbie
 
Registered: Sep 2005
Distribution: Slackware 10.0 , Fedora 3, SUSE 9.2, Knoppix 5.0.1 (Live CD)
Posts: 25

Rep: Reputation: 15
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.
 
Old 12-21-2006, 07:56 PM   #7
JimBass
Senior Member
 
Registered: Oct 2003
Location: New York City
Distribution: Debian Sid 2.6.32
Posts: 2,100

Rep: Reputation: 49
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
 
Old 12-22-2006, 12:43 PM   #8
mushk45
LQ Newbie
 
Registered: Sep 2005
Distribution: Slackware 10.0 , Fedora 3, SUSE 9.2, Knoppix 5.0.1 (Live CD)
Posts: 25

Rep: Reputation: 15
ok, I won't guess anymore!

BTW, my /var folder on Slackware 10.0 is about 24 mb's :P
 
Old 12-30-2006, 02:53 PM   #9
sarthor
LQ Newbie
 
Registered: Apr 2005
Posts: 9

Rep: Reputation: 0
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.

Last edited by sarthor; 12-30-2006 at 03:34 PM.
 
Old 12-30-2006, 03:35 PM   #10
masonm
Senior Member
 
Registered: Mar 2003
Location: Following the white rabbit
Distribution: Slackware64 14.2 Solus
Posts: 2,264

Rep: Reputation: 51
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.
 
Old 12-30-2006, 04:50 PM   #11
Electro
LQ Guru
 
Registered: Jan 2002
Posts: 6,042

Rep: Reputation: Disabled
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.
 
Old 12-30-2006, 08:45 PM   #12
masonm
Senior Member
 
Registered: Mar 2003
Location: Following the white rabbit
Distribution: Slackware64 14.2 Solus
Posts: 2,264

Rep: Reputation: 51
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.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
cache folder like /var/cache/apt/packages on Debian Shaddy SUSE / openSUSE 0 08-13-2006 10:02 AM
Can I just delete my /var/cache/yum folder? SquishyMarbles Linux - Software 1 04-10-2006 03:25 PM
/var/cache/samba/wins.dat has old IP turnbui Linux - Networking 0 09-25-2005 09:07 AM
Error: Caching enabled and local cache: //var/cache/yum/base/primary.xml.gz does... dr_zayus69 Linux - Software 2 07-06-2005 04:32 AM
empty /var/cache/urpmi/rpms ??? christophe.dr Linux - Software 1 10-03-2003 04:46 PM


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

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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration