initrd vs initramfs

HMZ99

New Member
Joined
Nov 29, 2023
Messages
3
Reaction score
0
Credits
26
Hey everyone
i'm really confused between ( initrd , initramfs ) i've done some researches about these two files so i've found out that the main difference is that the distribution , in debian we use "initramfs" and redhat based "initrd" ...but the issue is that in the book :

CompTIA® Linux+® XK0-005 Exam Cram by William “Bo” Rothwell :
PART1 ,CHAPTER1 , page 46 : basic boot process . he mentioned that initramfs created by mkinitrd :
11.png
3.png


so is it possible to create initramfs using mkinitrd ? is there something i missed in this ?

thank you very much ! and sorry for my noob level , i'm really trying hard but still need some professional help to make things clear for me .
 
Last edited:


dos2unix

Well-Known Member
Joined
May 3, 2019
Messages
2,221
Reaction score
1,861
Credits
16,648
what is the difference between initrd and iniramfs

ChatGPT
initrd and initramfs (initial ramdisk and initial ram filesystem, respectively) are both used in the Linux kernel during the boot process to provide an initial root file system in memory before the actual root file system on the disk is mounted. While they serve a similar purpose, there are some key differences between them:
  1. Compression:
    • initrd: It typically uses various compression formats such as gzip or cpio. The kernel needs to have built-in support for the specific compression format used in the initrd.
    • initramfs: It is a more modern approach and is often built into the kernel as a cpio archive, which may or may not be compressed. Initramfs has broader support for various compression algorithms because the kernel can include multiple compression libraries.
  2. Flexibility:
    • initrd: Once the kernel is booted, the initrd is mounted as a temporary root file system. The contents of the initrd are then extracted into a RAM disk. It is a relatively simple and static structure.
    • initramfs: The contents of the initramfs can be more dynamic and flexible. It is mounted as a root file system directly, and the kernel has the ability to pivot to the final root file system. This flexibility allows for a more modular and dynamic approach during the boot process.
  3. Kernel Integration:
    • initrd: Requires explicit support for a specific filesystem and compression format within the kernel.
    • initramfs: Can be integrated directly into the kernel image as an archive, providing a more seamless and integrated solution.
  4. Size:
    • initrd: Can be larger in size due to the use of specific compression formats, which may limit its use in environments with tight constraints on boot image size.
    • initramfs: May be more compact, especially when using minimal compression or no compression at all.
In summary, while both initrd and initramfs serve the purpose of providing an initial root file system during the Linux boot process, initramfs is considered a more modern and flexible approach with better compression support and integration into the kernel. The choice between them may depend on specific requirements and constraints in a given system.
 
OP
H

HMZ99

New Member
Joined
Nov 29, 2023
Messages
3
Reaction score
0
Credits
26
what is the difference between initrd and iniramfs

ChatGPT
initrd and initramfs (initial ramdisk and initial ram filesystem, respectively) are both used in the Linux kernel during the boot process to provide an initial root file system in memory before the actual root file system on the disk is mounted. While they serve a similar purpose, there are some key differences between them:
  1. Compression:
    • initrd: It typically uses various compression formats such as gzip or cpio. The kernel needs to have built-in support for the specific compression format used in the initrd.
    • initramfs: It is a more modern approach and is often built into the kernel as a cpio archive, which may or may not be compressed. Initramfs has broader support for various compression algorithms because the kernel can include multiple compression libraries.
  2. Flexibility:
    • initrd: Once the kernel is booted, the initrd is mounted as a temporary root file system. The contents of the initrd are then extracted into a RAM disk. It is a relatively simple and static structure.
    • initramfs: The contents of the initramfs can be more dynamic and flexible. It is mounted as a root file system directly, and the kernel has the ability to pivot to the final root file system. This flexibility allows for a more modular and dynamic approach during the boot process.
  3. Kernel Integration:
    • initrd: Requires explicit support for a specific filesystem and compression format within the kernel.
    • initramfs: Can be integrated directly into the kernel image as an archive, providing a more seamless and integrated solution.
  4. Size:
    • initrd: Can be larger in size due to the use of specific compression formats, which may limit its use in environments with tight constraints on boot image size.
    • initramfs: May be more compact, especially when using minimal compression or no compression at all.
In summary, while both initrd and initramfs serve the purpose of providing an initial root file system during the Linux boot process, initramfs is considered a more modern and flexible approach with better compression support and integration into the kernel. The choice between them may depend on specific requirements and constraints in a given system.
thank you !
 


Latest posts

Top