# Size of initramfs

## paul_zm

Recently I build a new kernel using genkernel. I hadn't done it for a while so I thought it

would be good to get a new one. So I did and all looks like it works but there is one thing

that I find is most strange. The size of the initramfs file of my previous kernel was roughly 2Mb.

But the new one is around 24Mb. How can that be? As far as I know I did not do anything different

then before. 

```

drwx------  2 root root    12288 Nov 22  2004 lost+found

lrwxrwxrwx  1 root root        1 Nov 22  2004 boot -> .

-rw-r--r--  1 root root        0 Jul 23  2005 .keep

-rw-r--r--  1 root root  1539384 Jan 23  2008 kernel-genkernel-x86-2.6.23-gentoo-r6

-rw-r--r--  1 root root   869128 Jan 23  2008 System.map-genkernel-x86-2.6.23-gentoo-r6

-rw-r--r--  1 root root  1994296 Jan 23  2008 initramfs-genkernel-x86-2.6.23-gentoo-r6

drwxr-xr-x 24 root root      600 Apr 19  2008 ..

-rw-r--r--  1 root root  2400128 Dec 25 16:08 kernel-genkernel-x86-2.6.26-gentoo-r4

-rw-r--r--  1 root root  1142796 Dec 25 16:08 System.map-genkernel-x86-2.6.26-gentoo-r4

-rw-r--r--  1 root root 24422417 Dec 25 18:07 initramfs-genkernel-x86-2.6.26-gentoo-r4

drwxr-xr-x  2 root root     1024 Dec 27 11:00 grub

drwxr-xr-x  4 root root     2048 Dec 27 21:26 .

```

Is there something I can do to reduce the size of this file? I want that because my boot partition

is only 50Mb.

----------

## NeddySeagoon

paul_zm,

genkernel must be doing something different then.

Time to give up genkernel and roll your own kernel maybe ?

----------

## paul_zm

I rather keep using Genkernel and there must be a way to fix this in another way. I am wondering if other people have comparable sizes?

----------

## d2_racing

 *NeddySeagoon wrote:*   

> Time to give up genkernel and roll your own kernel maybe ?

 

Each time that there's a new kernel version, there a lot of new stuffs, so it's normal that his InitramFs is bigger and bigger.

----------

## NeddySeagoon

paul_zm, 

The initrd is a real root filesystem in a file. Its either a gzipped ext2 filesystem in a file or a cpio archive of other cpio archives.

Either way, the kernel can unpick it and mount it as its root to do the things it needs to do to mount your real root.

So what huge libraries are in it ?

You can unpick it and look around.

As d2_racing says, all the kernel modules are in there too ... thats almost every module known to Linus. you will use very few of them.

This list keeps growing too but I doubt it accounts for a 20 fold increase in initrd size over a few kernel versions.

----------

## paul_zm

Thanks for the answers, I found the problem.

When I ran genkernel with the --menuconfig option I saved my configuration under

a different file name instead of the standard .config. So it probably did a kernel build

with the standard .config that comes with the distribution instead of using mine. I thought

it would always save it under the name .config anyway, apparently not.

----------

