# No space left on device, but df shows free space [SOLVED]

## Mr. M

Hi,

I made a digital picture frame out of an old laptop and use a 4GB CF card for the root file system. I'm trying to update the kernel, but for some reason I get a "No space left on device" error:

```

frame ~ # emerge gentoo-sources

Calculating dependencies... done!

>>> Verifying ebuild Manifests...

>>> Emerging (1 of 1) sys-kernel/gentoo-sources-2.6.29-r5 to /

Traceback (most recent call last):

  File "/usr/bin/emerge", line 6971, in ?

    retval = emerge_main()

  File "/usr/bin/emerge", line 6965, in emerge_main

    myopts, myaction, myfiles, spinner)

  File "/usr/bin/emerge", line 6395, in action_build

    retval = mergetask.merge(pkglist, favorites, mtimedb)

  File "/usr/bin/emerge", line 3981, in merge

    return self._merge(mylist, favorites, mtimedb)

  File "/usr/bin/emerge", line 4259, in _merge

    prev_mtimes=ldpath_mtimes)

  File "/usr/lib/portage/pym/portage.py", line 4675, in doebuild

    if need_distfiles and not fetch(

  File "/usr/lib/portage/pym/portage.py", line 3160, in fetch

    waiting_msg=waiting_msg)

  File "/usr/lib/portage/pym/portage_locks.py", line 54, in lockfile

    myfd = os.open(lockfilename, os.O_CREAT|os.O_RDWR,0660)

OSError: [Errno 28] No space left on device: '/usr/portage/distfiles/.locks/.genpatches-2.6.29-7.extras.tar.bz2.portage_lockfile'

```

The weird thing is that I should have enough free space:

```

frame ~ # df -hl

Filesystem            Size  Used Avail Use% Mounted on

rootfs                3.8G  2.0G  1.7G  54% /

/dev/root             3.8G  2.0G  1.7G  54% /

udev                   10M   96K   10M   1% /dev

shm                   110M     0  110M   0% /dev/shm

rc-svcdir             1.0M   68K  956K   7% /lib/rc/init.d

tmpfs                  16M  4.0K   16M   1% /tmp

tmpfs                  16M   96K   16M   1% /var/log

tmpfs                  16M     0   16M   0% /var/lock

tmpfs                  16M     0   16M   0% /var/tmp

```

```

frame ~ # cat /etc/fstab

# <fs>                  <mountpoint>    <type>          <opts>          <dump/pass>

# NOTE: If your BOOT partition is ReiserFS, add the notail option to opts.

/dev/hda1               /boot                 ext2              noauto,noatime  1 2

/dev/hda2               /                     ext3              noatime         0 1

tmpfs                   /tmp                  tmpfs             defaults,nosuid,mode=1777,size=16m        0 0

tmpfs                   /var/log              tmpfs             defaults,nosuid,mode=1777,size=16m        0 0

tmpfs                   /var/lock             tmpfs             defaults,nosuid,mode=1777,size=16m        0 0

tmpfs                   /var/tmp              tmpfs             defaults,nosuid,mode=1777,size=16m        0 0

shm                     /dev/shm        tmpfs           nodev,nosuid,noexec     0 0

```

Does anyone have an idea what could be the reason for this problem?

Any tips are appreciated.Last edited by Mr. M on Mon Jul 06, 2009 5:21 pm; edited 1 time in total

----------

## krinn

as usual...

```
df -i
```

----------

## salahx

Also, you have /var/tmp set to a tmpfs space of 16M. Since that's the area Portage unpacks and compiles things, that's not likely going to be enough space.(also, unlike /tmp. stuff in /var/tmp is supposed to persist across reboots, according to FHS anyway)

----------

## Mr. M

krinn, salahx

Thanks for your replies, looks like I have re-create the partition with a higher inode/size ratio. 

 *Quote:*   

> 
> 
> Also, you have /var/tmp set to a tmpfs space of 16M. Since that's the area Portage unpacks and compiles things, that's not likely going to be enough space.(also, unlike /tmp. stuff in /var/tmp is supposed to persist across reboots, according to FHS anyway)
> 
> 

 

Thats a good point, however, I have PORTAGE_TMPDIR set to a directory that is not on a tmpfs partition. Actually, what I do to update the frame is to export "/" via NFS and mount it on a more powerful computer. On the more powerful computer, I chroot into the mounted root directory of the frame and mount a large tmpfs (4GB or so) over the portage temporary directory. Then "emerge -ua --deep system world"  :Smile: .

I will look into the your point that /var/tmp should be persistent, so far I haven't encountered any problems.

----------

## krinn

lookout for distcc, might save you time and efforts  :Razz: 

----------

