monster initramfs files
I have an F35 installation with this /etc/dracut.conf.d/dmodules.conf file:
Code:
#add_drivers+=" ata_piix ata_generic " |
It's a general thing, including every module in the kernel. Debian/Mint does it too. Build your own if you have a smal;l /boot
|
Other major distros still have simple config options to limit initrd modules to those required by the hardware on which installed. What follows are all from one multiboot PC with most recent versions of Debian, Fedora, Mageia, openSUSE & Ubuntu:
Code:
-rw------- 1 4891630 Jan 3 2018 deb09/boot/initrd.img-4.9.0-4-amd64 |
Do you have any compression options set? I'd say the initramfs image isn't being compressed. You need to tell dracut to do it, IIRC it won't on its own.
|
Quote:
I'm not aware of any available options to set for the automatic generation of these files when each new kernel is installed, if not from /etc/dracut.conf.d/d*.conf or /etc/dracut.conf. It used to be that hostonly="yes" was enough to keep them down to a more sane size. Where might compression have been disabled, or an over-bloated module set included? I certainly don't need that nls stuff, but what else represents excess? I found the bigger part of the problem. A several releases back, dracut started complaining about lack of whitespace in /etc/dracut.conf.d/*conf. So, I made sure each uncommented line had whitespace adjacent to each quote mark. Including changing hostonly="yes" to hostonly=" yes " was the mistake. Now that the whitespace is gone, new images are down about 60%. Still, 20,000K is significantly bigger than those of the other distros that I use. And, the line count change was low, down from 2855 for 5.14.18 to 2842 for 5.16.12. |
51 Megs? That's average for distros that put the kitchen sink in the initrd. Here's onr from Mint and then Slackware64-15.0
Code:
ls -lh /boot |
Except for Slackware's, which didn't exist when OP was composed, all file initrd outputs below are from initrds in OP.
Code:
# file initramfs-5.14.18-200.fc34.x86_64.img # Fedora 34 51207057 I did find that dracut can be configured to compress. I tried with and without xz compression on an F35 installation with kernel 5.16.12. The compressed version was only 19% smaller, at 16608652 bytes. It looks like its kitchen sink could use some trimming. |
Look in /boot/initrd-tree/your-kernel-version to see what's in it.
I dug once and found modules for all sorts of exotic filesystems, bluetooth, etc. while I have a very boring PC. There is busybox and a miniature OS in there, which is mounted on / before your root drive. The only module I need is ext4, but they probably have basic usb also. |
From lsinitrd initrd:
|
Careful - remember the busybox shell.
|
Quote:
Code:
compress="{cat|bzip2|lzma|xz|gzip|lzo|lz4|zstd|<compressor [args ...]>}" Quote:
|
Quote:
I still have some Fedora installations older than 33 I can explore for more size history as time permits.... |
Quote:
You're comparing distributions... so if you want a smaller init use one of those other config files if on the same box. Not the same box, not the same included/excluded modules, and you're not making a fair comparison (you already indicated via post 1 you're deviating from defaults - and yes I hate the way dracut requires you to handle whitespace in its config files in an ugly way). However, I can give you a possible hint looking at my TW and fc35 (I don't have an fc34) boxes... other than lack of compression your problem may be vi, ps, and grep on fedora. I can not speak for how long they have been included by default as I have no older fc boxes, so I can't answer your original question, but certainly explains the difference between distros. |
Usually you have a whole pile of uneccessary modules in there for every conceivable filesystem and interface. Fix that if you can. Mind you, a big initrd is only a niusance if your /boot is too small..
|
Quote:
My fedora initrd is 38M uncompressed, Tumbleweed is 30M compressed. Fedora boots noticeably faster. Maybe OP has a small /boot. I only needed to learn that lesson (and headache) once when I made a 250M /boot years ago - although space was more valuable then. |
All times are GMT -5. The time now is 01:40 AM. |