[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: 2.4.1: cramfs and initrd



On Wed, Mar 28, 2001 at 09:29:14PM +1000, Herbert Xu wrote:
> zhaoway <zw@debian.org> wrote:
> 
> > Does anyone have this problem for kernel 2.4.1? When I compiled in
> > cramfs, initrd cannot work. Kernel message screen just say:
> 
> > wrong magic <== spit out by cramfs(?) which shouldn't be there in the
> >                 1st place?

The kernel tries every registered partition driver to read the superblock
of the initrd image.  The cramfs driver disobeys the 'silent' flag passed
to it (a bug) and grizzles that the superblock doesn't have the magic
numbers expected of a cramfs superblock.

> cramfs sets the block size to 4096 bytes, which breaks initrd because it was
> read in 1024 byte blocks.  This is worked around in kernel-source 2.4.2
> where the rd block size defaults to 4096 if you've got cramfs enableed.

I think the cure is worse than the disease. :-)  Suddenly your 1k/block
ext2 initrd fails to mount and the kernel panics without anything to
tell you it's because the filesystem blocksize now no longer matches
the new default ramdisk device blocksize ...

You can either create the initrd filesystem with 4k blocks, or pass
ramdisk_blocksize=1024 as a kernel boot parameter (assuming your ramdisk
fs has 1k blocks), though if you do the latter, I don't think cramfs
will work anyway.  4k blocks on an ext2 ramdisk probably isn't as bad as
it sounds with regards to size - I imagine the wasted space compresses
quite well.

Regards,

Mark.



Reply to: