boot - Why is the root filesystem is loaded into a ramdisk? -


i studying boot process in linux. came across sentence "ram several orders of magnitude faster floppy disk, system operation fast ramdisk"

the kernel anyway load root filesystem in ram executing it. question why need ramdisk loading the root filesystem, if kernel loads root file system ram ?

the documentation suse linux provides explanation of why linux booted ramdisk:

as linux kernel has been booted , root file system (/) mounted, programs can run , further kernel modules can integrated provide additional functions. to mount root file system, conditions must met. kernel needs corresponding drivers access device on root file system located (especially scsi drivers). the kernel must contain code needed read file system (ext2, reiserfs, romfs, etc.). conceivable root file system encrypted. in case, password needed mount file system.

for problem of scsi drivers, number of different solutions possible. kernel contain imaginable drivers, might problem because different drivers conflict each other. also, kernel become large because of this. possibility provide different kernels, each 1 containing 1 or few scsi drivers. method has problem large number of different kernels required, problem increased differently optimized kernels (athlon optimization, smp). the idea of loading scsi driver module leads general problem resolved concept of initial ramdisk: running user space programs before root file system mounted.

this prevents potential chicken-or-egg situation root file system cannot loaded until device on located can accessed, device can't accessed until root file system has been loaded:

the initial ramdisk (also called initdisk or initrd) solves precisely problems described above. linux kernel provides option of having small file system loaded ram disk , running programs there before actual root file system mounted. loading of initrd handled boot loader (grub, lilo, etc.). boot loaders need bios routines load data boot medium. if boot loader able load kernel, can load initial ramdisk. special drivers not required.

of course, ramdisk not strictly necessary boot process take place. example, compile kernel contained necessary hardware drivers , modules loaded @ startup. apparently work people, , ramdisk proved simpler, more scalable solution.


Comments

Popular posts from this blog

android - Spacing between the stars of a rating bar? -

html - Instapaper-like algorithm -

c# - How to execute a particular part of code asynchronously in a class -