LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices

Reply
 
Search this Thread
Old 08-20-2013, 01:58 PM   #1
PreguntoYo
LQ Newbie
 
Registered: Jan 2012
Distribution: Slackware
Posts: 24

Rep: Reputation: 2
Why my initrd.gz is getting bigger?


Hello:

I'm using Slackware 14.0 stable, with LVM under LUKS, spanish keymap, hibernation... and today I wanted to experiment with mkinitrd. I wanted to make an initrd as small as posible; I tried:

Code:
mkinitrd -c -k 3.2.45-smp -f ext4 -r /dev/GV_Slack/root -m mbcache:jbd2:ext4 -C /dev/sda2 -L -u -o /boot/initrd.gz -l es -h /dev/GV_Slack/swap
...as suggested by mkinitrd_command_generator.sh, but as it outputs:

Code:
OK: /lib/modules/3.2.45-smp/kernel/fs/mbcache.ko added.
OK: /lib/modules/3.2.45-smp/kernel/fs/jbd2/jbd2.ko added.
OK: /lib/modules/3.2.45-smp/kernel/fs/mbcache.ko added.
OK: /lib/modules/3.2.45-smp/kernel/fs/jbd2/jbd2.ko added.
OK: /lib/modules/3.2.45-smp/kernel/fs/ext4/ext4.ko added.
21995 blocks
/boot/initrd.gz created.
Be sure to run lilo again if you use it.
I had always been in doubt if mbcache.ko and jbd2.ko had been included twice in initrd.gz, and if I could make it smaller with just:

Code:
mkinitrd -c -k 3.2.45-smp -f ext4 -r /dev/GV_Slack/root -m ext4 -C /dev/sda2 -L -u -o /boot/initrd.gz -l es -h /dev/GV_Slack/swap
Which outputs:

Code:
OK: /lib/modules/3.2.45-smp/kernel/fs/mbcache.ko added.
OK: /lib/modules/3.2.45-smp/kernel/fs/jbd2/jbd2.ko added.
OK: /lib/modules/3.2.45-smp/kernel/fs/ext4/ext4.ko added.
21995 blocks
/boot/initrd.gz created.
Be sure to run lilo again if you use it.
Notice it "pulls" mbcache.ko and jbd2.ko (really, I don't know why would I need those two modules, anyway). I thought the initrd.gz would be smaller, but everytime I use it, the file gets bigger!:

Code:
ls -l /boot

-rw-r--r--  1 root root 4640826 ago 20 20:15 initrd.gz
-rw-r--r--  1 root root 4640876 ago 20 20:20 initrd02.gz
-rw-r--r--  1 root root 4641289 ago 20 20:22 initrd03.gz
-rw-r--r--  1 root root 4641324 ago 20 20:23 initrd04.gz
Am I doing something wrong?. Do I have some misconception about how mknitrd really works?. I'm puzzled.

Any ideas?.
 
Old 08-20-2013, 03:24 PM   #2
ljb643
Member
 
Registered: Nov 2003
Posts: 264

Rep: Reputation: Disabled
The 2 modules mbcache and jbd2 are dependencies of the ext4 filesystem module. You do not need to specify them separately with -m, as they will be added automatically. If you do put them in with -m, they are copied twice to the staging area (those "OK" messages), but with the same path, so the staging area and actual disk image only contain one copy of each. So there is no harm there in using -m.

I don't know why the image gets bigger each time - perhaps someone else does.
 
Old 08-21-2013, 10:47 AM   #3
guanx
Senior Member
 
Registered: Dec 2008
Posts: 1,014

Rep: Reputation: 145Reputation: 145
Quote:
Originally Posted by PreguntoYo View Post
I had always been in doubt if mbcache.ko and jbd2.ko had been included twice in initrd.gz, and if I could make it smaller with just:
Code:
mkinitrd -c -k 3.2.45-smp -f ext4 -r /dev/GV_Slack/root -m ext4 -C /dev/sda2 -L -u -o /boot/initrd.gz -l es -h /dev/GV_Slack/swap
If in doublt, try it. I assure you it will not trigger the nuclear bomb.

Quote:
Originally Posted by PreguntoYo View Post
Code:
ls -l /boot

-rw-r--r--  1 root root 4640826 ago 20 20:15 initrd.gz
-rw-r--r--  1 root root 4640876 ago 20 20:20 initrd02.gz
-rw-r--r--  1 root root 4641289 ago 20 20:22 initrd03.gz
-rw-r--r--  1 root root 4641324 ago 20 20:23 initrd04.gz
Am I doing something wrong?. Do I have some misconception about how mknitrd really works?. I'm puzzled.

Any ideas?.
That is the modules list file sit in the root directory of the initrd.
 
  


Reply

Tags
initrd


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
/proc/kcore file is getting bigger and bigger. thewhitelion Ubuntu 2 03-07-2008 09:50 AM
How to create new initrd.gz (or initrd.img) file? kkpal Programming 2 12-10-2007 08:38 AM
Failed to symbolic-link boot/initrd.img-2.6.18-4-486 to initrd.img Scotteh Linux - Software 8 06-01-2007 11:24 PM
size gets bigger and bigger alaios Linux - General 1 07-22-2004 10:18 AM
Sampling bits of information in bigger and bigger pieces lugoteehalt General 0 10-29-2003 05:38 AM


All times are GMT -5. The time now is 02:18 PM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration