SlackwareThis Forum is for the discussion of Slackware Linux.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
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.
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.
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
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.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.