Linux-Noob Forums

Full Version: Need more disk space on / for yum to update?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.

Hi guys,

 

Whenever I try and update the server using yum, I get an error something like:

 



Code:
Transaction Check Error:
installing package nss-3.12.8-1.el5.centos.i386 needs 4KB on the / filesystem




 

Now I fixed this before by removing old kernel's, but there are only 2 at the moment (the one in use and a new one - waiting for a good time to reboot!)

 

Disk usage:

 



Code:
Filesystem           1K-blocks      Used Available Use% Mounted on
/dev/md1               4956160   4947480         0 100% /
/dev/md3               4956224   1508680   3191716  33% /var
/dev/md2             271835552  55636240 202168148  22% /home
/dev/md0                 77649     18728     54912  26% /boot
tmpfs                  3911088         0   3911088   0% /dev/shm




 

Contents of /

 



Code:
ls / -al
drwxr-xr-x  24 root root  4096 Sep 30 11:05 .
drwxr-xr-x  24 root root  4096 Sep 30 11:05 ..
-rw-r--r--   1 root root     0 May 18 09:41 .autofsck
-rw-r--r--   1 root root     0 Jan 15  2010 .autorelabel
drwxr-xr-x   2 root root  4096 Oct 16 04:02 bin
drwxr-xr-x   5 root root  5120 Oct 15 11:18 boot
drwxr-xr-x  12 root root  4100 Oct 17 04:02 dev
drwxr-xr-x  82 root root 12288 Oct 21 04:02 etc
drwxr-xr-x  13 root root  4096 Oct 15 11:17 home
drwxr-xr-x  11 root root  4096 Oct 16 04:02 lib
drwxr-xr-x   7 root root  4096 Oct 16 04:02 lib64
drwx------   2 root root 16384 Jan 15  2010 lost+found
drwxr-xr-x   2 root root  4096 Jan 26  2010 media
drwxr-xr-x   2 root root     0 Aug 18 02:00 misc
drwxr-xr-x   3 root root  4096 Jan 26  2010 mnt
drwxr-xr-x   2 root root     0 Aug 18 02:00 net
drwxr-xr-x   3 root root  4096 Jan 26  2010 opt
dr-xr-xr-x 437 root root     0 May 18 10:40 proc
drwxr-x---   4 root root  4096 Oct 21 11:25 root
drwxr-xr-x   2 root root 12288 Oct 16 04:02 sbin
drwxr-xr-x   2 root root  4096 Jan 26  2010 selinux
drwxr-xr-x   2 root root  4096 Jan 26  2010 srv
drwxr-xr-x  11 root root     0 May 18 10:40 sys
drwxrwxrwt   3 root root 20480 Oct 21 11:33 tmp
drwxr-xr-x  14 root root  4096 May 17 14:05 usr
drwxr-xr-x  23 root root  4096 May 17 14:05 var




 

Is there a way I can give '/' more space safely? I'm not too sure I want to go delete stuff from there in case it has disastrous consequences...

 

Cheers

 

Neil


ouch - no reason why your root filesystem should fill up like that!

 

use the "du" command to see how big specific directories are, eg:



Code:
du -sh /




or:



Code:
du -sh *




when in a directory.

 

You can ignore the /home and /var dirs - they're mounted on separate filesystems.

 

As a matter of interest.. you don't (graphical) login as root and run everything as that user, do you?


Quote:ouch - no reason why your root filesystem should fill up like that!

 

use the "du" command to see how big specific directories are, eg:



Code:
du -sh /

<div>


or:



Code:
du -sh *




when in a directory.

 

You can ignore the /home and /var dirs - they're mounted on separate filesystems.

 

As a matter of interest.. you don't (graphical) login as root and run everything as that user, do you?



</div>
 

It's a server, so no graphical logins at all.

 

If it was /var I'd be laughing as I could just empty some apache log files, restart the daemon and bob's your uncle... Is there an easy way of getting yum to use a drive that does have free space on it? The / path is confusing me, as when I list the files on it, I see etc, var etc, but they're on their own filesystem.

 

Interestingly, I've moved the yum cache dir to

Code:
/home/yum/cache


which has plenty of space, and I still get errors!

 



Code:
Transaction Check Error:
installing package nss-3.12.8-1.el5.centos.x86_64 needs 16KB on the / filesystem
installing package autofs-5.0.1-0.rc2.143.el5_5.5.x86_64 needs 16KB on the / filesystem
installing package glibc-2.5-49.el5_5.7.i686 needs 16KB on the / filesystem
installing package kernel-2.6.18-194.17.4.el5.x86_64 needs 96MB on the / filesystem
installing package kernel-headers-2.6.18-194.17.4.el5.x86_64 needs 96MB on the / filesystem
installing package glibc-devel-2.5-49.el5_5.7.x86_64 needs 96MB on the / filesystem
installing package nss-tools-3.12.8-1.el5.centos.x86_64 needs 96MB on the / filesystem

Error Summary
-------------
Disk Requirements:
At least 96MB needed on the / filesystem.





Quote:It's a server, so no graphical logins at all.

 

If it was /var I'd be laughing as I could just empty some apache log files, restart the daemon and bob's your uncle... Is there an easy way of getting yum to use a drive that does have free space on it?
Getting yum to use a different drive/partition is a matter of mounting something over /var/cache/yum, but as your /var is on another filesystem then that isn't the issue. Try "yum clean cache" or "yum clean all" to flush out the contents.

 

Remember that yum simply installs files - it may be adding packages to /usr/bin - so there isn't a way of "getting yum to use a drive with free space", unless you're talking about the cache, which you addressed lower down.

 

Quote:The / path is confusing me, as when I list the files on it, I see etc, var etc, but they're on their own filesystem.
"mount" will show you where mount points are for separate filesystems. It helps to think of "/" as one cooridoor with rooms leading off to other areas of the floor, except that /var leads to stairs up to another floor and /home = stairs leading down. "df" will report the sizes of those floors as well as the "/" floor, but it means content dropped into those filesytstems doesn't affect your current (root) floor.

 

What did the "du" command show?

 

Quote:Interestingly, I've moved the yum cache dir to

Code:
/home/yum/cache

<div>
which has plenty of space, and I still get errors!

</div>
That's a bit like saying you've expanded the size of your warehouse, but your home is still too small to accept delivery of new goods. The cache area is just a holding area for yum to pull down packages before installing; the error moans about the size final destination, not about the cache area (which was in /var anyway, and had space to cope prior to the move).


Thank you for the very clear and concise reply, much appreciated!

 

I think I was getting hung-up on the error, assuming it was yum's cache at fault, not thinking of the possibility it could be a problem with the final install.

 

I do have a slight problem (which is related to my confusion about the actual '/' path) - if I:

 



Code:
ls /
bin   dev  home  lib64       media  mnt  opt   root  selinux  sys  usr
boot  etc  lib   lost+found  misc   net  proc  sbin  srv      tmp  var




 

then it looks like the root isn't a seperate filesystem, but simply the actual root where-from all other paths are under...

 

For example, under a windows box you'd have C: and maybe D:, but C: root would be the root dir, then you'd have /windows under it etc - I'm probably way off here but hopefully that explains my confusion somewhat.

 

So if I run a command like:

 



Code:
du -sh /




 

I get reams and reams of output, as the command scans through everything, even my remote mounted backup drives!

 

I can post the output here but I'm not sure how useful it would be.

 

Not sure if it tells you anything but here's the diskfree stats:

 



Code:
Filesystem            Size  Used Avail Use% Mounted on
/dev/md1              4.8G  4.8G     0 100% /
/dev/md3              4.8G  683M  3.9G  15% /var
/dev/md2              260G   54G  193G  22% /home
/dev/md0               76M   19M   54M  26% /boot
tmpfs                 3.8G     0  3.8G   0% /dev/shm




 

 

Ok, I think I might have found some old files which were just sat wasting space, I've deleted them and ended up with some disk space, and yum finished updating successfully!

 



Code:
Filesystem           1K-blocks      Used Available Use% Mounted on
/dev/md1               4956160   4194400    741760  85% /
/dev/md3               4956224    699388   4001008  15% /var
/dev/md2             271835552  55930708 201873680  22% /home
/dev/md0                 77649     18728     54912  26% /boot
tmpfs                  3911088         0   3911088   0% /dev/shm




 

Thanks for your help, pointers, and for bearing with me!


Quote:For example, under a windows box you'd have C: and maybe D:, but C: root would be the root dir, then you'd have /windows under it etc - I'm probably way off here but hopefully that explains my confusion somewhat.
It's more like "/" = "My Computer" and /var = D: drive, /home = E: drive.

 

Windows has the ability now to mount a drive under a directory, so instead of D: you could call it C:\Documents. It looks like it's part of the C: drive (first disk) but it's a separate filesystem - filling up C:\Documents won't fill up C:\windows or C:|

 

Quote:So if I run a command like:

 



Code:
du -sh /

<div>


 

I get reams and reams of output, as the command scans through everything

</div>
Try:



Code:
cd /
du -sh *




That should give you a summary of each dir (or mount point). From there, you can start to drop down into other directories and re-run the command, narrowing down where large files happen to lie.