Any try to emerge ebuilds fails due to "insufficient space to store ... in /usr/portage/distfiles" though there is plenty (25GB) of space on that partition and access rights are verified. The problem might be linked to the implementation of the function call "statvfs" to check for free disk space on ALPHA systems. Reproducible: Always Steps to Reproduce: emerge gentoo-sources (any other ebuild will fail, too) Actual Results: Calculating dependencies... done! >>> Verifying ebuild manifests >>> Emerging (1 of 1) sys-kernel/gentoo-sources-2.6.27-r8 !!! Insufficient space to store genpatches-2.6.27-10.extras.tar.bz2 in /usr/portage/distfiles !!! Couldn't download 'genpatches-2.6.27-10.extras.tar.bz2'. Aborting. * Fetch failed for 'sys-kernel/gentoo-sources-2.6.27-r8', Log file: * '/var/tmp/portage/sys-kernel/gentoo-sources-2.6.27-r8/temp/build.log' >>> Failed to emerge sys-kernel/gentoo-sources-2.6.27-r8, Log file: >>> '/var/tmp/portage/sys-kernel/gentoo-sources-2.6.27-r8/temp/build.log' * Messages for package sys-kernel/gentoo-sources-2.6.27-r8: * Fetch failed for 'sys-kernel/gentoo-sources-2.6.27-r8', Log file: * '/var/tmp/portage/sys-kernel/gentoo-sources-2.6.27-r8/temp/build.log' Expected Results: emerge without failure The problem occurs on an ALPHA workstation XP1000: http://www.compaq.com/alphaserver/workstations/retired/xpseries/xp1000/index.html I suppose problems with the function call "statvfs" (python?) which may not be correctly implemented on ALPHAs to determine free disk space!? There are no issues when the files to be fetched and emerged are put into /usr/portage/distfiles manually. beta rico # df -h Dateisystem Größe Benut Verf Ben% Eingehängt auf /dev/hda3 36G 11G 25G 31% / udev 10M 104K 9,9M 2% /dev /dev/hda1 63M 6,3M 53M 11% /boot /dev/mapper/vg0-lvhome 94G 65G 29G 70% /home shm 1012M 0 1012M 0% /dev/shm beta rico # emerge --info Portage 2.1.6.7 (default/linux/alpha/2008.0/server, gcc-4.3.2, glibc-2.8_p20080602-r1, 2.6.26-gentoo-r2 alpha) ================================================================= System uname: Linux-2.6.26-gentoo-r2-alpha-EV67-with-glibc2.0 Timestamp of tree: Wed, 22 Apr 2009 14:30:01 +0000 ccache version 2.4 [enabled] app-shells/bash: 3.2_p33 dev-lang/python: 2.4.4-r13, 2.5.4-r2 dev-python/pycrypto: 2.0.1-r6 dev-util/ccache: 2.4-r7 sys-apps/baselayout: 1.12.11.1 sys-apps/sandbox: 1.2.18.1-r2 sys-devel/autoconf: 2.13, 2.61-r2 sys-devel/automake: 1.4_p6, 1.5, 1.6.3, 1.7.9-r1, 1.8.5-r3, 1.9.6-r2, 1.10.1-r1 sys-devel/binutils: 2.18-r3 sys-devel/gcc-config: 1.4.0-r4 sys-devel/libtool: 1.5.26 virtual/os-headers: 2.6.27-r2 ACCEPT_KEYWORDS="alpha" CBUILD="alpha-unknown-linux-gnu" CFLAGS="-mieee -O2 -mcpu=21264a -pipe" CHOST="alpha-unknown-linux-gnu" CONFIG_PROTECT="/etc /usr/kde/3.5/env /usr/kde/3.5/share/config /usr/kde/3.5/shutdown /usr/share/config" CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/fonts/fonts.conf /etc/gconf /etc/revdep-rebuild /etc/terminfo /etc/texmf/web2c /etc/udev/rules.d" CXXFLAGS="-mieee -O2 -mcpu=21264a -pipe" DISTDIR="/usr/portage/distfiles" FEATURES="ccache distlocks fixpackages parallel-fetch protect-owned sandbox sfperms strict unmerge-orphans userfetch" GENTOO_MIRRORS="http://distfiles.gentoo.org http://distro.ibiblio.org/pub/linux/distributions/gentoo" LANG="de_DE.utf8" LC_ALL="de_DE.utf8" LDFLAGS="-Wl,-O1" LINGUAS="de" MAKEOPTS="-j2" PKGDIR="/usr/portage/packages" PORTAGE_CONFIGROOT="/" PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --stats --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages" PORTAGE_TMPDIR="/var/tmp" PORTDIR="/usr/portage" PORTDIR_OVERLAY="/usr/local/portage" SYNC="rsync://rsync.gentoo.org/gentoo-portage" USE="7zip acl alpha apache2 asf berkdb bzip2 cjk clamav cli cracklib crypt cups divx4linux dri dynamicplugin exif exiscan-acl ffmpeg fortran ftp gdbm gimpprint gocr gpm gtk gtk2 iconv ieee1394 immqt-bc ipv6 isdnlog javascript jpeg ldap lm_sensors m17n-lib mailwrapper midi mjpeg mp3 mpeg msn mudflap mysql ncurses nls nptl nptlonly nsplugin opengl openmp pam pcre perl png pop3d pppd python pyzor razor readline reflection samba session slang snmp spell spl ssl sysfs tcpd tiff truetype unicode usb userlocales winbind xml xorg xvid zlib" ALSA_CARDS="ali5451 als4000 bt87x ca0106 cmipci emu10k1 ens1370 ens1371 es1938 es1968 fm801 hda-intel intel8x0 maestro3 trident usb-audio via82xx ymfpci" ALSA_PCM_PLUGINS="adpcm alaw asym copy dmix dshare dsnoop empty extplug file hooks iec958 ioplug ladspa lfloat linear meter mmap_emul mulaw multi null plug rate route share shm softvol" APACHE2_MODULES="actions alias auth_basic authn_alias authn_anon authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache dav dav_fs dav_lock deflate dir disk_cache env expires ext_filter file_cache filter headers include info log_config logio mem_cache mime mime_magic negotiation rewrite setenvif speling status unique_id userdir usertrack vhost_alias" ELIBC="glibc" INPUT_DEVICES="keyboard mouse evdev" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LINGUAS="de" USERLAND="GNU" VIDEO_CARDS="fbdev glint mach64 mga nv r128 radeon savage tdfx vga voodoo" Unset: CPPFLAGS, CTARGET, EMERGE_DEFAULT_OPTS, FFLAGS, INSTALL_MASK, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS beta portage # ls -l ... drwxrwxr-x 3 root portage 1720 22. Apr 17:04 distfiles ...
Run "df -i" to check the inodes. This is the usual cause of "disk full" errors when there's still "space" free.
Also please post the output of this command: python -c 'import os; st = os.statvfs("/usr/portage/distfiles") ; print st.f_bavail, st.f_bsize'
beta rico # python -c 'import os; st = os.statvfs("/usr/portage/distfiles") ; print st.f_bavail, st.f_bsize' 0 4096 beta rico # df -i Dateisystem INodes IBenut. IFrei IBen% Eingehängt auf /dev/hda3 0 0 0 - / udev 129440 2646 126794 3% /dev /dev/hda1 16560 25 16535 1% /boot /dev/mapper/vg0-lvhome 0 0 0 - /home shm 129440 1 129439 1% /dev/shm relevant parts of /etc/fstab: /dev/hda1 /boot ext2 defaults 1 2 /dev/hda3 / reiserfs defaults 0 0 /dev/vg0/lvhome /home reiserfs defaults 0 0 /dev/hda2 none swap sw 0 0 proc /proc proc defaults 0 0 shm /dev/shm tmpfs nodev,nosuid,noexec 0 0
(In reply to comment #3) > beta rico # python -c 'import os; st = os.statvfs("/usr/portage/distfiles") ; > print st.f_bavail, st.f_bsize' > 0 4096 So, the f_bavail field appears to be useless on your system. I'm not sure if that is legitimate, or indicates some sort of misbehavior or breakage. There's a f_bfree field that we can also check, so please post the output of this as well: python -c 'import os; st = os.statvfs("/usr/portage/distfiles") ; print st.f_bfree'
beta rico # python -c 'import os; st = os.statvfs("/usr/portage/distfiles") ; print st.f_bfree' 6420572
Maybe this thread is of interest: http://markmail.org/message/efg4jre2gczxfqrs
Problem remains unchanged with Portage 2.1.6.11. I would appreciate any idea to force updating the system without the need to download each distfile manually.
Created attachment 189788 [details, diff] use the f_bfree field when necessary but only if userfetch is not enabled (In reply to comment #5) > beta rico # python -c 'import os; st = os.statvfs("/usr/portage/distfiles") ; > print st.f_bfree' > 6420572 It seems to be reporting space available, but not for non-root users. This patch should make it work, but you'll have to add FEATURES="-userfetch" to /etc/make.conf. If the patch is saved as /tmp/bfree.patch, then it can be applied as follows: patch /usr/lib/portage/pym/portage/__init__.py /tmp/bfree.patch
Created attachment 189921 [details, diff] use the f_bfree field when necessary but only if userfetch is not enabled This fixes an incorrect calculation in the first patch.
Your second patch posted on 2009-04-30 06:36 works! Thanks a lot! Still some questions: Will this patch (or a modified version of it) be implemented in the stable tree of portage? Can the need to run the modified code be detected automatically apart from using the "-userfetch" feature?
(In reply to comment #10) > Will this patch (or a modified version of it) be implemented in the stable tree > of portage? Yes, it will be included in portage-2.1.6.12. > Can the need to run the modified code be detected automatically apart from > using the "-userfetch" feature? Well, if FEATURES=userfetch is enabled (the default) then IMO it should produce an error if it's not able to drop privileges. I'd still like to understand why the f_bfree field reports free space on your system while the f_bavail does not. Perhaps it's something about the way your filesystem is configured. Are you able to create files in /usr/portage/distfiles as a non-root user?
(In reply to comment #11) > Well, if FEATURES=userfetch is enabled (the default) then IMO it should produce an error if it's not able to drop privileges. Yes, in that case an error is produced. > Are you able to create files in /usr/portage/distfiles as a non-root user? No, files cannot be created as user as expected by the file permissions given in the bug description.
Created attachment 189997 [details, diff] use the f_bfree field when necessary but only if userfetch is not enabled This behave the same as the previous patch and also displays a message to indicate when FEATURES="-userfetch" is usefule.
Unfortunately I cannot apply the third patch from 2009-04-30 19:55. Applying it directly to a fresh re-emerge of portage 2.1.6.11 results in: beta portage # patch /usr/lib/portage/pym/portage/__init__.py /tmp/bfree.patch patching file /usr/lib/portage/pym/portage/__init__.py Hunk #1 succeeded at 3888 (offset -82 lines). patch unexpectedly ends in middle of line Hunk #2 succeeded at 3906 (offset -82 lines). Applying the second patch from 2009-04-30 06:36 first (after a fresh emerge of portage 2.1.6.11) and then the third patch results in: beta tmp # patch /usr/lib/portage/pym/portage/__init__.py /tmp/bfree2.patch patching file /usr/lib/portage/pym/portage/__init__.py Hunk #1 succeeded at 3897 (offset -82 lines). beta tmp # patch /usr/lib/portage/pym/portage/__init__.py /tmp/bfree3.patch patching file /usr/lib/portage/pym/portage/__init__.py Hunk #1 succeeded at 3888 (offset -82 lines). patch unexpectedly ends in middle of line Hunk #2 FAILED at 3906. 1 out of 2 hunks FAILED -- saving rejects to file /usr/lib/portage/pym/portage/__init__.py.rej How can I apply it correctly?
(In reply to comment #14) > Unfortunately I cannot apply the third patch from 2009-04-30 19:55. > > Applying it directly to a fresh re-emerge of portage 2.1.6.11 results in: > beta portage # patch /usr/lib/portage/pym/portage/__init__.py /tmp/bfree.patch > patching file /usr/lib/portage/pym/portage/__init__.py > Hunk #1 succeeded at 3888 (offset -82 lines). > patch unexpectedly ends in middle of line > Hunk #2 succeeded at 3906 (offset -82 lines). You can ignore that error. The patch only contains 2 hunks, so it completely applied, despite the error.
This is fixed in 2.1.6.12 and 2.2_rc32.
Sorry, but the third patch (2009-04-30 19:55) applied to portage 2.1.6.11 is not working. The same with portage 2.1.6.12. beta portage # emerge --info Portage 2.1.6.12 (default/linux/alpha/2008.0/server, gcc-4.3.2, glibc-2.8_p20080602-r1, 2.6.26-gentoo-r2 alpha) ================================================================= System uname: Linux-2.6.26-gentoo-r2-alpha-EV67-with-glibc2.0 Timestamp of tree: Sat, 02 May 2009 16:30:01 +0000 ... with feature "userfetch": beta portage # emerge layman Calculating dependencies... done! >>> Verifying ebuild manifests >>> Emerging (1 of 1) app-portage/layman-1.1.1 !!! Insufficient space to store layman-1.1.1.tar.gz in /usr/portage/distfiles !!! Couldn't download 'layman-1.1.1.tar.gz'. Aborting. * Fetch failed for 'app-portage/layman-1.1.1', Log file: * '/var/tmp/portage/app-portage/layman-1.1.1/temp/build.log' >>> Failed to emerge app-portage/layman-1.1.1, Log file: >>> '/var/tmp/portage/app-portage/layman-1.1.1/temp/build.log' * Messages for package app-portage/layman-1.1.1: * Fetch failed for 'app-portage/layman-1.1.1', Log file: * '/var/tmp/portage/app-portage/layman-1.1.1/temp/build.log' with feature "-userfetch": beta etc # emerge layman Calculating dependencies... done! >>> Verifying ebuild manifests >>> Emerging (1 of 1) app-portage/layman-1.1.1 !!! Insufficient space to store layman-1.1.1.tar.gz in /usr/portage/distfiles !!! Couldn't download 'layman-1.1.1.tar.gz'. Aborting. * Fetch failed for 'app-portage/layman-1.1.1', Log file: * '/var/tmp/portage/app-portage/layman-1.1.1/temp/build.log' >>> Failed to emerge app-portage/layman-1.1.1, Log file: >>> '/var/tmp/portage/app-portage/layman-1.1.1/temp/build.log' * Messages for package app-portage/layman-1.1.1: * Fetch failed for 'app-portage/layman-1.1.1', Log file: * '/var/tmp/portage/app-portage/layman-1.1.1/temp/build.log'
Created attachment 190169 [details, diff] fix inverted logic The logic was inverted. This patch fixes it (applies to portage-2.1.6.12).
reopening
The inverted logic patch applied to portage-2.1.6.12 fixes it. It works as intended by using the "-userfetch" feature while showing a hint message if "userfetch" is enabled. Thank you very much for your help!
This is fixed in 2.1.6.13 and 2.2_rc33.