LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
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 11-14-2009, 02:54 AM   #1
JokerBoy
Member
 
Registered: Sep 2009
Posts: 140

Rep: Reputation: 24
With or without initrd.gz?


i use a custom kernel (2.6.31.6), with fs support build into it, not as modules. but my system seems to perform better with initrd.gz. i searched on LQ threads related to initrd, but nothing with my kind of issue. if you have any suggestion how can i improve the performance of my kernel without using a initrd.gz don`t hesitate to write it down here. thanks.

Bogdan.
 
Old 11-14-2009, 04:02 AM   #2
MS3FGX
LQ Guru
 
Registered: Jan 2004
Location: NJ, USA
Distribution: Slackware, Debian
Posts: 5,852

Rep: Reputation: 361Reputation: 361Reputation: 361Reputation: 361
What exactly do you mean by the system performs better? The initrd is held in RAM, so it would have faster read/write access than mounting the root filesystem directly, but I wouldn't think you would notice any serious performance increase from that.

An initrd is absolutely not necessary if the kernel is built properly. So whatever problem you are having should be resolvable.
 
Old 11-14-2009, 04:30 AM   #3
JokerBoy
Member
 
Registered: Sep 2009
Posts: 140

Original Poster
Rep: Reputation: 24
well, i don`t know how to say it, but without initrd my cpu seems to a little slower than with it, and my hard drives seems to be used more intensively. if you like, i can attach my .config
 
Old 11-14-2009, 08:16 AM   #4
onebuck
Moderator
 
Registered: Jan 2005
Location: Central Florida 20 minutes from Disney World
Distribution: SlackwareŽ
Posts: 13,925
Blog Entries: 44

Rep: Reputation: 3159Reputation: 3159Reputation: 3159Reputation: 3159Reputation: 3159Reputation: 3159Reputation: 3159Reputation: 3159Reputation: 3159Reputation: 3159Reputation: 3159
Hi,

When you create a 'initrd' you will be loading the modules to a ramdisk. The 'CPU' will not be faster but the hdd or storage device will be used to load or manipulate the needs of the kernel. Unless you load all the kernel required needs into a tmpfs then you will have storage access. The efficientcy of a initrd is the allowance of portability. You can move between systems without recompilation to provide support via modularity. The module usage allows you to include the necessary requirements for the system to boot. Therefore allow the system to utilize the filesystem of the system for the boot to allow the kernel to function.

Quote:
excerpt from 'man initrd'

initrd - boot loader initialized RAM disk

CONFIGURATION
The /dev/initrd is a read-only block device assigned major number 1 and minor number 250. Typi-
cally /dev/initrd is owned by root.disk with mode 0400 (read access by root only). If the Linux
system does not have /dev/initrd already created, it can be created with the following commands:
mknod -m 400 /dev/initrd b 1 250
chown root:disk /dev/initrd

Also, support for both "RAM disk" and "Initial RAM disk" (e.g. CONFIG_BLK_DEV_RAM=y and CON-
FIG_BLK_DEV_INITRD=y) must be compiled directly into the Linux kernel to use /dev/initrd. When
using /dev/initrd, the RAM disk driver cannot be loaded as a module.

DESCRIPTION
The special file /dev/initrd is a read-only block device. This device is a RAM disk that is ini-
tialized (e.g., loaded) by the boot loader before the kernel is started. The kernel then can use
/dev/initrd's contents for a two-phase system boot-up.

In the first boot-up phase, the kernel starts up and mounts an initial root file-system from the
contents of /dev/initrd (e.g., RAM disk initialized by the boot loader). In the second phase,
additional drivers or other modules are loaded from the initial root device's contents. After
loading the additional modules, a new root file system (i.e., the normal root file system) is
mounted from a different device.

Boot-up Operation
When booting up with initrd, the system boots as follows:

1. The boot loader loads the kernel program and /dev/initrd's contents into memory.

2. On kernel startup, the kernel uncompresses and copies the contents of the device /dev/initrd
onto device /dev/ram0 and then frees the memory used by /dev/initrd.

3. The kernel then read-write mounts the device /dev/ram0 as the initial root file system.

4. If the indicated normal root file system is also the initial root file-system (e.g.
/dev/ram0) then the kernel skips to the last step for the usual boot sequence.

5. If the executable file /linuxrc is present in the initial root file-system, /linuxrc is exe-
cuted with UID 0. (The file /linuxrc must have executable permission. The file /linuxrc can
be any valid executable, including a shell script.)

6. If /linuxrc is not executed or when /linuxrc terminates, the normal root file system is
mounted. (If /linuxrc exits with any file-systems mounted on the initial root file-system,
then the behavior of the kernel is UNSPECIFIED. See the NOTES section for the current kernel
behavior.)

7. If the normal root file system has a directory /initrd, the device /dev/ram0 is moved from /
to /initrd. Otherwise if the directory /initrd does not exist, the device /dev/ram0 is
unmounted. (When moved from / to /initrd, /dev/ram0 is not unmounted and therefore processes
can remain running from /dev/ram0. If directory /initrd does not exist on the normal root
file system and any processes remain running from /dev/ram0 when /linuxrc exits, the behavior
of the kernel is UNSPECIFIED. See the NOTES section for the current kernel behavior.)

8. The usual boot sequence (e.g., invocation of /sbin/init) is performed on the normal root file
system.
<<<<<< Please Note >>>>>>>
Your cpu pacing or speed will not be effected by the use of a initrd. The storage device usage maybe minimized initially but will be used for continued operation of the system when the kernel is given control (look at the excerpt above). You will not remove this unless you happen to run from a 'RAMDISK'. A NAND based system will not function as well as a DRAM based 'RAMDISK'. Be prepared to spend some $$ for a 'DRAM' based unit.
 
1 members found this post helpful.
  


Reply



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
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
Initrd OmnipotentOscar Debian 3 12-19-2006 06:02 PM
initrd ashlesha Linux - Software 1 12-01-2006 04:57 PM
initrd tekbuz Debian 2 08-04-2004 12:34 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 07:49 PM.

Main Menu
Advertisement
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
Open Source Consulting | Domain Registration