0

im running into weird error when tried to yum remove some package from the system:

sudo yum remove evaluation-1.2-0.1122.noarch.rpm 
Loaded plugins: fastestmirror
Traceback (most recent call last):
  File "/usr/bin/yum", line 29, in <module>
    yummain.user_main(sys.argv[1:], exit_code=True)
  File "/usr/share/yum-cli/yummain.py", line 276, in user_main
    errcode = main(args)
  File "/usr/share/yum-cli/yummain.py", line 107, in main
    base.doLock()
  File "/usr/lib/python2.6/site-packages/yum/__init__.py", line 1740, in doLock
    while not self._lock(lockfile, mypid, 0644):
  File "/usr/lib/python2.6/site-packages/yum/__init__.py", line 1810, in _lock
    os.write(fd, contents)
OSError: [Errno 28] No space left on device

i run the 'df -h' and got this:

df -h
Filesystem            Size  Used Avail Use% Mounted on
/dev/sda3             7.9G  7.9G     0 100% /
tmpfs                 7.8G     0  7.8G   0% /dev/shm
/dev/sda1              97M   37M   55M  41% /boot
/dev/sda5              83G  977M   78G   2% /workplace

seems to me still lots of space available.

ran 'df -i' and got:

 df -i
Filesystem            Inodes   IUsed   IFree IUse% Mounted on
/dev/sda3             524288   42146  482142    9% /
tmpfs                2041840       1 2041839    1% /dev/shm
/dev/sda1              25688      39   25649    1% /boot
/dev/sda5            5505024     229 5504795    1% /workplace

im not familiar with the linux system, any idea what might go wrong? Thanks

1
  • Avail 0 means no space available (on the root partition which includes /usr and /var. BTW: in case you are not sure what mount contains a dir you can use df -h /usr/bin.
    – eckes
    Jun 21, 2017 at 7:55

3 Answers 3

9

Look at your output. it clearly shows that there is 0% available space on SDA3 partition, mounted as "/". Theoretically if you create a single file which eats all space, it still does not use all available inodes for a filesystem. Use

du -sh /*

to find out which directory uses how much data. You may try fsck check of the filesystem structure, depending on type of filesystem ( probably ext3 or ext4 ). Once I had a situation, in which application ( specifically apache webserver ) was saying "no space left on device" when I tried to start it, while there was plenty of space, it turned out it was open semaphores ( ipcs / ipcrm ) or limit of permitted open files per process which caused such behaviour.

In modern systems, especially for desktop use, it doesn't make sense anymore to keep "/" or "/boot" on separate partitions, rather a few physical disks are combined in one partition using LVM and similar tools. Common problem with too small "/" is when logs ( usually /var/log or /var/adm/log ) are kept on "/", consume all space, and then you need to move them to "/work" or "/home" partition anyway, and you end up with root filesystem shared across many partitions nevertheless.

1
  • Likely /usr/lib is the offender consider creating a separate /usr/lib. Jun 21, 2017 at 7:29
2

From the df-h output, you have no space left on your / or root partiton.

Filesystem Size Used Avail Use% Mounted on

dev/sda3 7.9G 7.9G 0 100% /

Run a command like du -hs / or du -hs /*/*/* to find directories containing large files or a command like find / -type f -size +500000k, replacing the 500000k with the file size threshold for individual files.

Once you identify the large directories or files on your file system, identify what they are and how big they are, when they were last modified and whether they can be compressed (using tar and gzip) or deleted using rm, in order to make more space free.

Then you should be able to run the yum command to uninstall a package without it not being able to write to disk due to lack of space.

2

This one is your problem:

Filesystem            Size  Used Avail Use% Mounted on
/dev/sda3             7.9G  7.9G     0 100% /

There is in fact no space left on the partition '/dev/sda3'

Having lots of space available on other partitions will not help if the space is needed exactly there.

You must log in to answer this question.