Skip to contentSkip to conversation

Recent changes broke mkinitrd?

PATCH In review Stephen Hemminger 3 participants 7 messages Apr 17, 2003 ext2 file system

lore
Share & tools
lore
#0 lore raw

Recent (post 2.5.67) versions of the kernel break the creation of the initial ram disk. This is on RH 8.0 but probably is more wide spread.

The failure mode is:

# mkinitrd /tmp/initrd.2.5.67 2.5.67
tar: ./bin: Cannot mkdir: No space left on device
tar: ./bin/nash: Cannot open: No such file or directory
tar: ./bin/insmod: Cannot open: No such file or directory
tar: ./bin/modprobe: Cannot open: No such file or directory
tar: ./etc: Cannot mkdir: No space left on device
tar: ./dev: Cannot mkdir: No space left on device
tar: ./dev/console: Cannot mknod: No such file or directory
tar: ./dev/null: Cannot mknod: No such file or directory
tar: ./dev/ram: Cannot mknod: No such file or directory
tar: ./dev/systty: Cannot mknod: No such file or directory
tar: ./dev/tty1: Cannot mknod: No such file or directory
tar: ./dev/tty2: Cannot mknod: No such file or directory
tar: ./dev/tty3: Cannot mknod: No such file or directory
tar: ./dev/tty4: Cannot mknod: No such file or directory
tar: ./loopfs: Cannot mkdir: No space left on device
tar: ./proc: Cannot mkdir: No space left on device
tar: ./sysroot: Cannot mkdir: No space left on device
tar: Error exit delayed from previous errors

The problem is not the increase size of modules but instead something changed with ext2/ext3?

                 Running kernel
                 2.5.67-bk  2.4.18
                 *-------*------*
	  2.5.67 | Fails |  Ok  |
mkinitrd         *-------*------*
          2.4.18 | Fails |  Ok  |
                 *-------*------*

2.5.67 is okay, but the latest kernel from bk is not.

#1 lore raw
Quoted 3 lines · Stephen Hemminger

Recent (post 2.5.67) versions of the kernel break the creation of the initial ram disk.

hmm, so it did. It'll be the ext2 changes. mkinitrd works OK if you use ext3:

mkinitrd renamed from mkinitrd.orig +2 -2
@@ -473,7 +473,7 @@
 
 # We have to "echo y |" so that it doesn't complain about $IMAGE not
 # being a block device
-echo y | mke2fs $LODEV $IMAGESIZE >/dev/null 2>/dev/null
+echo y | mke2fs -j $LODEV $IMAGESIZE >/dev/null 2>/dev/null
 tune2fs -i0 $LODEV >/dev/null
 
 if [ -n "$verbose" ]; then
@@ -481,7 +481,7 @@
 fi
 
 mkdir -p $MNTPOINT
-mount -t ext2 $LODEV $MNTPOINT || {
+mount -t ext3 $LODEV $MNTPOINT || {
 	echo "Can't get a loopback device"
 	exit 1
 }

I'll take a look...

#2 lore raw
Quoted 7 lines · On Thu, 17 Apr 2003 11:40:16 -0700 Andrew Morton <[email protected]> wrote:
Quoted 3 lines · Stephen Hemminger

Recent (post 2.5.67) versions of the kernel break the creation of the initial ram disk.

hmm, so it did. It'll be the ext2 changes. mkinitrd works OK if you use ext3:

That works for me - Thanks

#3 lore raw

PATCH 1/1 Fix orlov allocator boundary case

In reply to Stephen Hemminger
Quoted 3 lines · Stephen Hemminger

Recent (post 2.5.67) versions of the kernel break the creation of the initial ram disk.

OK, here be the fix.

I'm a bit peeved that this wasn't discovered until it hit Linus's tree. Weren't these patches in -mjb as well?

In the interests of SMP scalability the ext2 free blocks and free inodes counters are "approximate". But there is a piece of code in the Orlov allocator which fails due to boundary conditions on really small filesystems.

Fix that up via a final allocation pass which simply uses first-fit for allocation of a directory inode.

 fs/ext2/ialloc.c |    9 +++++++++
 1 files changed, 9 insertions(+)
fs/ext2/ialloc.c renamed from fs/ext2/ialloc.c~orlov-approx-counter-fix +9 -0
diff -puN fs/ext2/ialloc.c~orlov-approx-counter-fix fs/ext2/ialloc.c
@@ -410,6 +410,15 @@ fallback:
 			goto found;
 	}
 
+	if (avefreei) {
+		/*
+		 * The free-inodes counter is approximate, and for really small
+		 * filesystems the above test can fail to find any blockgroups
+		 */
+		avefreei = 0;
+		goto fallback;
+	}
+
 	return -1;
 
 found:

_

#4 lore raw

Re: [patch] Fix orlov allocator boundary case

Quoted 9 lines · On Thu, 17 Apr 2003 12:21:42 -0700 Andrew Morton <[email protected]> wrote:
Quoted 3 lines · Stephen Hemminger

Recent (post 2.5.67) versions of the kernel break the creation of the initial ram disk.

OK, here be the fix.

I'm a bit peeved that this wasn't discovered until it hit Linus's tree. Weren't these patches in -mjb as well?

The patch fixed the problem -- thanks again

#5 lore raw

Re: [patch] Fix orlov allocator boundary case

In reply to Andrew Morton

On Thursday 17 April 2003 21:21, Andrew Morton wrote:

Hi Andrew,

Quoted 3 lines

OK, here be the fix.
I'm a bit peeved that this wasn't discovered until it hit Linus's tree. Weren't these patches in -mjb as well?

I guess this is also true for the ext3 code?

I am using the orlov stuff for 2.4.21* maintained by Theodore and Steven.

ciao, Marc

#6 lore raw

Re: [patch] Fix orlov allocator boundary case

Quoted 9 lines · Marc-Christian Petersen

On Thursday 17 April 2003 21:21, Andrew Morton wrote:

Hi Andrew,

Quoted 3 lines

OK, here be the fix.
I'm a bit peeved that this wasn't discovered until it hit Linus's tree. Weren't these patches in -mjb as well?

I guess this is also true for the ext3 code?

Only for the modified ext3 in the -mm tree.

Quoted 1 line

I am using the orlov stuff for 2.4.21* maintained by Theodore and Steven.

That kernel will not exhibit the problem - it is caused by the "fast version" of the free inodes count being off by a few blocks, and the filesystem having only one block group.