Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 87754 - genkernel 3.1.6 truncates initrds and images when /boot is full
Summary: genkernel 3.1.6 truncates initrds and images when /boot is full
Status: RESOLVED NEEDINFO
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Core system (show other bugs)
Hardware: All All
: High critical (vote)
Assignee: Gentoo Genkernel Maintainers
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-04-03 03:30 UTC by Matteo Settenvini
Modified: 2005-07-12 12:11 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments
Kernel config (default-config,35.35 KB, text/plain)
2005-04-03 03:32 UTC, Matteo Settenvini
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Matteo Settenvini 2005-04-03 03:30:12 UTC
I compiled my gentooized 2.6.11-r5 kernel with genkernel 3.1.6. Before, with 2.6.11-rc4 + genkernel 3.1.1b everything went right.
I use the following command to compile it:

genkernel --udev --gensplash="default -r 1024x768" --menuconfig all

Now, each time I boot the compiled kernel with its initrd, the following lines are displayed before it hangs ("C-M-del" still works, though):

----

RAMDISK: compressed image found at block 0
RAMDISK: ran out of compressed data
invalid compressed (err=1)
VFS: mounted root (ext2 filesystem) readonly
Freeing unused kernel memory: 764K freed
EXT2-fs error (device ram0): ext2_check_page: bad entry in directory #20: rec_len is smaller than minimal - offset = 0, inode = 0, rec_len = 0, name_len = 0
Warning: unable to open initial console
request_module: runaway loop modprobe binfmt_0000
request_module: runaway loop modprobe binfmt_0000
request_module: runaway loop modprobe binfmt_0000
request_module: runaway loop modprobe binfmt_0000
request_module: runaway loop modprobe binfmt_0000

----

Haven't yet tried to boot without the initrd (probably the problem lies there?),  but the problem exists anyway. I'll attach my .config.


Gentoo Base System version 1.6.10
Portage 2.0.51.19 (default-linux/x86/2004.3, gcc-3.4.3-20050110, glibc-2.3.4.20050125-r1, 2.6.11-gentoo-r4 i686)
=================================================================
System uname: 2.6.11-gentoo-r4 i686 Intel(R) Pentium(R) 4 CPU 2.40GHz
Python:              dev-lang/python-2.2.3-r5,dev-lang/python-2.3.5 [2.3.5 (#1, Feb 17 2005, 23:19:32)]
distcc 2.18.3 i686-pc-linux-gnu (protocols 1 and 2) (default port 3632) [disabled]
dev-lang/python:     2.2.3-r5, 2.3.5
sys-devel/autoconf:  2.59-r6, 2.13
sys-devel/automake:  1.7.9-r1, 1.8.5-r3, 1.5, 1.4_p6, 1.6.3, 1.9.5
sys-devel/binutils:  2.15.92.0.2-r7
sys-devel/libtool:   1.5.14
virtual/os-headers:  2.6.8.1-r4
ACCEPT_KEYWORDS="x86 ~x86"
AUTOCLEAN="yes"
CFLAGS="-O3 -march=pentium4 -pipe"
CHOST="i686-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/kde/2/share/config /usr/kde/3.4/env /usr/kde/3.4/share/config /usr/kde/3.4/shutdown /usr/kde/3/share/config /usr/lib/X11/xkb /usr/share/config /usr/share/texmf/dvipdfm/config/ /usr/share/texmf/dvips/config/ /usr/share/texmf/tex/generic/config/ /usr/share/texmf/tex/platex/config/ /usr/share/texmf/xdvi/ /var/bind /var/qmail/control"
CONFIG_PROTECT_MASK="/etc/gconf /etc/terminfo /etc/env.d"
CXXFLAGS="-O3 -march=pentium4 -pipe"
DISTDIR="/usr/portage/distfiles"
FEATURES="autoaddcvs autoconfig ccache distlocks sandbox sfperms"
GENTOO_MIRRORS="ftp://sunsite.informatik.rwth-aachen.de/pub/Linux/gentoo ftp://ftp.tu-clausthal.de/pub/linux/gentoo/ http://ftp.linux.ee/pub/gentoo/distfiles/ "
LANG="it_IT@euro"
LC_ALL="it_IT"
MAKEOPTS="-j2"
PKGDIR="/usr/portage/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
SYNC="rsync://rsync.gentoo.org/gentoo-portage"
USE="x86 X aalib alsa apache2 apm arts avi bash-completion berkdb bitmap-fonts bonobo cdr crypt cups curl dga directfb doc dvd emacs emboss encode fam fbcon flac font-server foomaticdb fortran gdbm gif gnome gpm gtk gtk2 gtkhtml guile imagemagick imap imlib ipv6 jack java jpeg junit kde ldap libg++ libwww mad maildir mbox mikmod mmx motif mp3 mpeg mysql nas ncurses nls nptl odbc oggvorbis opengl oss pam pcmcia pdflib perl png python qt quicktime readline samba sasl sdl slang speex spell sse sse2 ssl svga tcltk tcpd tetex tiff truetype truetype-fonts type1-fonts xml xml2 xmms xv zlib video_cards_i915 linguas_it"
Unset:  ASFLAGS, CBUILD, CTARGET, LDFLAGS, PORTDIR_OVERLAY
Comment 1 Matteo Settenvini 2005-04-03 03:32:58 UTC
Created attachment 55170 [details]
Kernel config

My kernel config.
Comment 2 Tim Yamin (RETIRED) gentoo-dev 2005-04-03 11:42:41 UTC
If you try without gensplash?
Comment 3 Matteo Settenvini 2005-04-03 12:21:18 UTC
No, it's not gensplash.
I noticed that after compiling and installing the initrd, I had exactly 0b space left on /boot.
What's strange, it's that genkernel did copy the initrd on /boot anyway (usually, shouldn't it complain when there's no space left on device?) and truncated it (at least, that's what I think).
Regenerating the initrd after removing some old kernels from /boot did produce a good initrd. However, reproducing the old conditions (almost full /boot) and recreating the initrd with genkernel brings in exactly the same issue.

This bug can be closed also as a WORKSFORME (or INVALID), but keep in mind that genkernel seems to truncate part of the initrd when copying it to /boot and there's no space left on device. 
Is it possible that some function read free kbytes using 1024 as a base, and some other does it with 1000? Just an idea of mine, though, and quite general: if it was to be true, could be also a "cp"/"install" problem.
Comment 4 Tim Yamin (RETIRED) gentoo-dev 2005-04-03 14:18:00 UTC
Hrm, interesting; genkernel does "cp /var/tmp/genkernel/.../initrd-${kernel-version} /boot" and cp should fail when /boot is running low on space... If you reproduce the same full conditions and just copy over an initrd using cp does that also truncate?
Comment 5 Matteo Settenvini 2005-04-07 02:43:59 UTC
Yes, it does, even if reporting an error.
For example, I did a:

cd /boot
for i in `seq 1 10`; do cp initrd-2.6.11.gentoo-r3 i.tmp$i; done

The space filled up, and I got the obvious error:
cp: writing to `i.tmp5': No space left on device

But when looking at /boot with ls -l:

matteo@tulip ~ $ ls -l /boot/
total 13896
[...]
-rw-r--r--  1 root root  643475 mar 10 11:56 initrd-2.6.11-gentoo-r3
-rw-r--r--  1 root root  643475 apr  7 11:19 i.tmp1
-rw-r--r--  1 root root  643475 apr  7 11:19 i.tmp2
-rw-r--r--  1 root root  643475 apr  7 11:19 i.tmp3
-rw-r--r--  1 root root  643475 apr  7 11:19 i.tmp4
-rw-r--r--  1 root root  536576 apr  7 11:19 i.tmp5
[...]

As you can see, i.tmp5 isn't 643475 as it should, and yet it hasn't been removed. So we should see if the original file and target one have the same size (md5sum?), and else we should _remove_ the partial file in /boot. Just an idea, though.

But doesn't genkernel already checks for that? The second time I used it it gave me a warning because of having no space on /boot... why the first time it went on silently?
Comment 6 Tim Yamin (RETIRED) gentoo-dev 2005-04-07 08:27:38 UTC
What filesystem are you using for /boot? I'm not able to reproduce it here so it may be the local configuration that caused it to fluke the first time...
Comment 7 Matteo Settenvini 2005-04-07 09:57:11 UTC
ext2 as recommended.
Comment 8 Tim Yamin (RETIRED) gentoo-dev 2005-06-21 10:17:36 UTC
Can you please try 3.2.0_pre9 and see if that still gives the same problem? If
it does then please try copying an oversized file to /boot using cp again and
then do echo $? and see what gives.
Comment 9 Matteo Settenvini 2005-07-05 09:50:56 UTC
at the moment genkernel 3.2.0_pre18 produces unbootable images for me (the
initramfs image reports it lacks mkdir and so on when booting, and it cannot
mount root), so I'll have to wait for it to become stable.
Comment 10 Eric Edgar (RETIRED) gentoo-dev 2005-07-05 11:51:27 UTC
clear your caches with genkernel and try again.  Also did you change your 
busybox config?
Comment 11 Eric Edgar (RETIRED) gentoo-dev 2005-07-12 12:11:23 UTC
genkernel-3.2.2 is out.  While it may not fix your issue we are unable to
replicate it.  

Please send more debug output if this is still and issue with the latest genkernel.