No, really: The initrd is too big

A while back I remember seeing news around the ‘net about Linus Torvalds voicing concern over the growing size of the kernel. Things like that are usually non-issues for me and I think they are for most end-users, but it’s the first thing I thought of when I put Ubuntu onto a 2Gb 4200rpm drive and dropped it into a Pentium with 32Mb of memory in it.

For the longest time now, my mental limbo-pole for Ubuntu on any computer has been 32Mb: Without 32Mb in the machine, the installer program twitched and flailed uncontrollably until you finally took it off life support and cut the power. You could, conceivably run Ubuntu on a machine with less memory than that, although dipping much lower — even by just 8Mb or so — left you in dangerous territory.

Or so I thought. I was pleased to find the random 16Mb stick of PC66 at the bottom of a box in my local recycling shop last week, and after a 12-hour marathon of memtest, it’s showing no defects whatsoever. But the aforementioned 2Gb hard drive with a clean installation of Ubuntu on it refused to start all the same. “The initrd is too big,” it said, quite politely.

I see elsewhere on the Internet where BIOS settings can come into play, but this time it might be that the initrd is just too big. How big can it be? I thought, and transplanted the drive (again … swapping drives is the story of my life) in an effort to find out. And the answer was 40Mb.

Good grief. I must be looking at that wrong. Discrepancies like that can only be explained as some mistake of mine. In any case, the error message was telling the truth. That is too big.

Now the size of a stock Linux kernel and the size of the initrd in a vanilla installation of Ubuntu 9.10 are not necessarily related, but I could swear this was never a problem before now. I am more-or-less certain that I have installed minimal Ubuntu systems on computers with only 32Mb of memory — some within the past couple of years — and they started up fine. And Debian runs without complaint on the machine, although I haven’t needed to check the size of the initrd in Debian, so it might be different. (It appears to be less than 8Mb for initrd.img-2.6.32-trunk-486.)

I suppose weight gain is the only excuse. Forty megabytes is considerable when your world is topped off by a 550Mhz Celeron, and no machine has more than 192Mb. But this world never has a need for more than about 24 of those 192Mb at any given time … unless of course, you’re trying to start up Ubuntu.

I’ll have to scrape around a little more and see if there is any way to carve down that 40Mb number, and maybe actually get the system working without having to swap memory chips as well as hard drives. I don’t hold out much hope though … 40Mb might be a stumbling block for a beat-up leftover 166Mhz Thinkpad, but to anyone else who’s not living in 1998, 40Mb here or there is nothing to voice concern over. Unless you are Linus.

About these ads

17 Responses to “No, really: The initrd is too big”


  1. 1 nflenz 2010/02/04 at 12:20 AM

    Why not just remove the initrd from menu.lst? The system should boot fine if the root filesystem uses ext3.

  2. 3 ajlec2000 2010/02/04 at 12:57 AM

    I believe Ubuntu has been growing from release to release. I don’t think the Ubuntu Community is developing the OS with machines like yours in mind.

    Right now the bare minimum for install is 64M of ram and its not recommended.

    The recommended minimum is 384M and I don’t think that amount can handle the compiz whiz bang desktop.

    Within a couple of years my 512M machines may not be suitable for Ubuntu. (Which is one reason I hang out here looking to learn more about the minimalist approach.)

  3. 4 Gusar 2010/02/04 at 3:28 AM

    That initrd probably contains modules for as much hardware as possible. Meaning you don’t need 98% of the stuff in there.
    Your best route is to compile a custom kernel which has what you need for that particular machine and only that. If you compile everything statically (no modules), you’ll get an image of around 2.5MB.

  4. 5 MK 2010/02/04 at 4:35 AM

    Just checked on Karmic, and initrd is just 7.6MB. But that’s 2.6.31.

    • 6 K.Mandla 2010/02/04 at 7:44 AM

      I was hoping someone would check theirs and find a different number. I double- and triple-checked mine, but 40Mb still sounds unnaturally huge. I halfway suspect some sort of error in the installation. …

  5. 7 matt 2010/02/04 at 4:43 AM

    The initrd is likely that big because it has all modules included (it was made to suit almost any hardware configuration). So it has any possible driver for RAID or crypto libs or different hard disc controllers, etc.

    Arch Linux gets around this by making two initrd images. One with *only* the modules you need based on your hardware and a “fallback” initrd with all the modules. You use the customized initrd for regular use but if it somehow gets misconfigured you can drop back to the fallback to boot and then fix the problem. I’ve never had to use the fallback, though.

    See here: http://wiki.archlinux.org/index.php/Mkinitcpio

    And you actually don’t *need* an initrd unless you are doing something tricky (root crypto, usb boot, raid, etc).

    If you are running on such limited hardware you really should be configuring your own kernel. It would be a night and day difference on such a low powered system.

  6. 9 steve 2010/02/04 at 3:00 PM

    Indeed. Compiling your own kernel having the filesystem type and appropriate hdd hardware drivers included rather than as modules negates the need for an initrd altogether, as well as speeding up boot times. I’m sure you know this though ;)

  7. 10 Morten 2010/02/04 at 7:47 PM

    I just had a look and mine (using Linux Mint 8 => Ubuntu 9.10)
    are about 8 MB – and when uncompressed 23 MB
    It seem something strange is going on in your machine.

  8. 11 mirradric 2010/02/05 at 4:10 PM

    I remember using an alternative initrd tool called yaird which scans your hardware and includes only the modules required for your boot up, resulting in a much smaller initrd. Of course this does not solve the problem of the installer. http://packages.ubuntu.com/karmic/yaird

  9. 12 peekaboo 2010/02/06 at 7:25 AM

    If you don’t have gigabytes worth of memory you either fail at putting together hardware or fail at earning money.

    Either way it’s just fail at a level that doesn’t even justify me writing this.

    Or if you’re living in a third world country I can forgive you, but that’s about it.


  1. 1 Links 4/2/2010: Scientific Linux Reviewed, Google Tablets | Boycott Novell Trackback on 2010/02/05 at 1:06 PM
  2. 2 Good news or bad news? Still no X « Motho ke motho ka botho Trackback on 2010/02/07 at 11:28 PM
  3. 3 Tale of two Ubuntus « Motho ke motho ka botho Trackback on 2010/09/24 at 10:21 PM
  4. 4 From 32 to 43 « Motho ke motho ka botho Trackback on 2011/03/04 at 7:54 AM

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s




Welcome!



Visit the Wiki!

Some recent desktops


May 6, 2011
Musca 0.9.24 on Crux Linux
150Mhz Pentium 96Mb 8Gb CF
 


May 14, 2011
IceWM 1.2.37 and Arch Linux
L2300 core duo 3Gb 320Gb

Some recent games


Apr. 21, 2011
Oolite on Xubuntu 11.04
L2300 core duo 3Gb 320Gb

Enter your email address to subscribe to this blog and receive notifications of new posts.

Join 405 other followers

License

This work is licensed under the GNU Free Documentation License. Please see the About page for details.

Blog Stats

  • 3,963,830 hits

Archives


Follow

Get every new post delivered to your Inbox.

Join 405 other followers

%d bloggers like this: