Sponsored Content
Operating Systems Linux Red Hat help about qemu-kvm boot with initrd Post 302691565 by neutronscott on Friday 24th of August 2012 11:03:41 PM
Old 08-25-2012
why root=/dev/ram ?
 

9 More Discussions You Might Find Interesting

1. Linux

initrd

ok, I'm trying to roll an initrd from scratch for learning purposes. I'm using cramfs for the filesystem so that I can modularize ext2 and ext3. The initrd has the modules required for ext3, a static insmod, a statis 'ash', static pivot_root, and a linuxrc that mounts the needed root partition... (0 Replies)
Discussion started by: thmnetwork
0 Replies

2. UNIX for Dummies Questions & Answers

kernel and initrd on machine with little amount of RAM

(rus cp1251) Вобщем смысл поста такой: я пытаюсь сделать Linux на дискетке и всё это опробовать на 386... =D поскольку памяти там мало, а ядро и initrd вроде как зажаты, я хотел бы узнать а) я сделал ядро (bzImage) оно 600 Кб. оно в памяти займёт 600 Кб или оно ещё разожмётся? б) аналогично с initrd. и ещё: он вроде 4МБ а можно в параметрах ядра сделать поменьше, можно-ли в 1-2МБ памяти уместить initrd и ядро? (eng) i am try to make linux on diskette and run it on i386... =D there are... (0 Replies)
Discussion started by: MR.Z
0 Replies

3. UNIX for Dummies Questions & Answers

Anyone ever used qemu and networked it ?

hi i got a virtual linux machine running on qemu my problem is connecting it to the internet im a bit confused weather i have to make a virtual network card in qemu and than tun tap it? can anyone thats done it before help me out? (1 Reply)
Discussion started by: russian460
1 Replies

4. Red Hat

Fedora installation getting stuck in initrd.img

I have a 80GB hard disk with WinXP already installed.I had tried installing Fedora 10 earlier without creating new partitions(real foolish and ignorant of me :o:o ) and tried creating partitions using Fedora10 bootable.It didnt work.Then I created a free partition and again tried installing... (4 Replies)
Discussion started by: ganesh.k28
4 Replies

5. Linux

What's role of swap in initrd?

Hello, I want to know why initrd need swap for work. In the shell of mkinitrd, it look for the swap partation for "swsuspdev", then write a sentence "resume /dev/sdXX" in the file init from initrd.gz, and the /dev/sdXX is the swap partation. Why initrd need swap when it boot a system? what is... (4 Replies)
Discussion started by: ZR_Lang
4 Replies

6. UNIX for Advanced & Expert Users

Could I get the initrd.img file without recompile the kernel?

Hi, all: The vmlinuz-3.0.4.old is a kernel previous to the current running kernel vmlinuz-3.0.4 which is compiled the most currently. Could I get the initrd.img-3.0.4.old without recompile under the condition that the config-3.0.4.old, System.map-3.0.4.old and vmlinuz-3.0.4.old exist? if it... (1 Reply)
Discussion started by: liklstar
1 Replies

7. UNIX for Advanced & Expert Users

Help with adding a new driver in initrd at install time

I have a really old distro (FC7) that I am trying to make compatible with some new hardware (ie. new RAID drivers)... I put the RAID driver into the ISO so that the installer can detect the RAID set... but post-install (aka: first boot) it appears that the Anaconda-generated initrd does not have... (0 Replies)
Discussion started by: jjinno
0 Replies

8. Virtualization and Cloud Computing

QEMU performance?

Heyas So, i like doing custom a LiveImage of my OS. Using Redhats kickstart/livecd-creator method. Anyway, so i would like to test the liveimages... AND also, i WOULD like to install FreeBSD, Solaris, or whatever, onto a Virtual Machine. I used to use Oracles Virtualbox, but eversince... (3 Replies)
Discussion started by: sea
3 Replies

9. Red Hat

KVM/Qemu allocated memory not showing in guest

So we have a RHEL 7.6 workstation with 128 gigs of ram. The OS sees all the ram and 80 cors (40 HT) We have 1 guest with 8 CPUs and 32gigs of ram running RHEL 7.6 workstation as well. We are trying to create another guest with 64 CPUs and 80 gigs of ram. We setup the system using... (0 Replies)
Discussion started by: joeg1484
0 Replies
INITRD(4)						     Linux Programmer's Manual							 INITRD(4)

NAME
initrd - boot loader initialized RAM disk DESCRIPTION
The special file /dev/initrd is a read-only block device. Device /dev/initrd is a RAM disk that is initialized (e.g. loaded) by the boot loader before the kernel is started. The kernel then can use the the block device /dev/initrd's contents for a two phased 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 con- tents. 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 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 executed 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 has directory /initrd, device /dev/ram0 is moved from / to /initrd. Otherwise if directory /initrd does not exist device /dev/ram0 is unmounted. (When moved from / to /initrd, /dev/ram0 is not unmounted and therefore processes can remain run- ning 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. OPTIONS
The following boot loader options when used with initrd, affect the kernel's boot-up operation: initrd=filename Specifies the file to load as the contents of /dev/initrd. For LOADLIN this is a command line option. For LILO you have to use this command in the LILO configuration file /etc/lilo.config. The filename specified with this option will typically be a gzipped file-system image. noinitrd This boot time option disables the two phase boot-up operation. The kernel performs the usual boot sequence as if /dev/initrd was not initialized. With this option, any contents of /dev/initrd loaded into memory by the boot loader contents are preserved. This option permits the contents of /dev/initrd to be any data and need not be limited to a file system image. However, device /dev/ini- trd is read-only and can be read only one time after system startup. root=device-name Specifies the device to be used as the normal root file system. For LOADLIN this is a command line option. For LILO this is a boot time option or can be used as an option line in the LILO configuration file /etc/lilo.config. The device specified by the this option must be a mountable device having a suitable root file-system. CHANGING THE NORMAL ROOT FILE SYSTEM
By default, the kernel's settings (e.g. set in the kernel file with rdev or compiled into the kernel file), or the boot loader option set- ting is used for the normal root file systems. For a NFS-mounted normal root file system, one has to use the nfs_root_name and nfs_root_addrs boot options to give the NFS settings. For more information on NFS-mounted root see the kernel documentation file nfs- root.txt. For more information on setting the root file system also see the LILO and LOADLIN documentation. It is also possible for the /linuxrc executable to change the normal root device. For /linuxrc to change the normal root device, /proc must be mounted. After mounting /proc, /linuxrc changes the normal root device by writing into the proc files /proc/sys/kernel/real-root- dev, /proc/sys/kernel/nfs-root-name, and /proc/sys/kernel/nfs-root-addrs. For a physical root device, the root device is changed by having /linuxrc write the new root file system device number into /proc/sys/kernel/real-root-dev. For a NFS root file system, the root device is changed by having /linuxrc write the NFS setting into files /proc/sys/kernel/nfs-root-name and /proc/sys/kernel/nfs-root-addrs and then writing 0xff (e.g. the pseudo-NFS-device number) into file /proc/sys/kernel/real-root-dev. For example, the following shell command line would change the normal root device to /dev/hdb1: echo 0x365 >/proc/sys/kernel/real-root-dev For a NFS example, the following shell command lines would change the normal root device to the NFS directory /var/nfsroot on a local net- worked NFS server with IP number 193.8.232.7 for a system with IP number 193.8.232.7 and named 'idefix': echo /var/nfsroot >/proc/sys/kernel/nfs-root-name echo 193.8.232.2:193.8.232.7::255.255.255.0:idefix >/proc/sys/kernel/nfs-root-addrs echo 255 >/proc/sys/kernel/real-root-dev USAGE
The main motivation for implementing initrd was to allow for modular kernel configuration at system installation. A possible system installation scenario is as follows: 1. The loader program boots from floppy or other media with a minimal kernel (e.g. support for /dev/ram, /dev/initrd, and the ext2 file- system) and loads /dev/initrd with a gzipped version of the initial file-system. 2. The executable /linuxrc determines what is needed to (1) mount the normal root file-system (i.e. device type, device drivers, file system) and (2) the distribution media (e.g. CD-ROM, network, tape, ...). This can be done by asking the user, by auto-probing, or by using a hybrid approach. 3. The executable /linuxrc loads the necessary modules from the initial root file-system. 4. The executable /linuxrc creates and populates the root file system. (At this stage the normal root file system does not have to be a completed system yet.) 5. The executable /linuxrc sets /proc/sys/kernel/real-root-dev, unmount /proc, the normal root file system and any other file systems it has mounted, and then terminates. 6. The kernel then mounts the normal root file system. 7. Now that the file system is accessible and intact, the boot loader can be installed. 8. The boot loader is configured to load into /dev/initrd a file system with the set of modules that was used to bring up the system. (e.g. Device /dev/ram0 can be modified, then unmounted, and finally, the image is written from /dev/ram0 to a file.) 9. The system is now bootable and additional installation tasks can be performed. The key role of /dev/initrd in the above is to re-use the configuration data during normal system operation without requiring initial ker- nel selection, a large generic kernel or, recompiling the kernel. A second scenario is for installations where Linux runs on systems with different hardware configurations in a single administrative net- work. In such cases, it may be desirable to use only a small set of kernels (ideally only one) and to keep the system-specific part of configuration information as small as possible. In this case, create a common file with all needed modules. Then, only the the /linuxrc file or a file executed by /linuxrc would be different. A third scenario is more convenient recovery disks. Because information like the location of the root file-system partition is not needed at boot time, the system loaded from /dev/initrd can use a dialog and/or auto-detection followed by a possible sanity check. Last but not least, Linux distributions on CD-ROM may use initrd for easy installation from the CD-ROM. The distribution can use LOADLIN to directly load /dev/initrd from CD-ROM without the need of any floppies. The distribution could also use a LILO boot floppy and then bootstrap a bigger ram disk via /dev/initrd from the CD-ROM. CONFIGURATION
The /dev/initrd is a read-only block device assigned major number 1 and minor number 250. Typically /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 CONFIG_BLK_DEV_INITRD=y ) support 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. FILES
/dev/initrd /dev/ram0 /linuxrc /initrd SEE ALSO
chown(1), mknod(1), /dev/ram(4), freeramdisk(8), rdev(8), The documentation file initrd.txt in the kernel source package, the LILO documen- tation, the LOADLIN documentation, the SYSLINUX documentation. NOTES
1. With the current kernel, any file systems that remain mounted when /dev/ram0 is moved from / to /initrd continue to be accessible. How- ever, the /proc/mounts entries are not updated. 2. With the current kernel, if directory /initrd does not exist, then /dev/ram0 will NOT be fully unmounted if /dev/ram0 is used by any process or has any file-system mounted on it. If /dev/ram0 is NOT fully unmounted, then /dev/ram0 will remain in memory. 3. Users of /dev/initrd should not depend on the behavior give in the above notes. The behavior may change in future versions of the Linux kernel. AUTHOR
The kernel code for device initrd was written by Werner Almesberger <almesber@lrc.epfl.ch> and Hans Lermen <lermen@elserv.ffm.fgan.de>. The code for initrd was added to the baseline Linux kernel in development version 1.3.73. Linux 2.0 1997-11-06 INITRD(4)
All times are GMT -4. The time now is 11:32 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy