cancel
Showing results for 
Search instead for 
Did you mean: 
Trevor
Starfighter Starfighter
Starfighter
  • 285 Views

initrd or initramfs

In Linux, the initrd (initial RAM disk) and initramfs (initial RAM File System) are different methods that can be used to load a temporary root file system to the RAM or system memory for successful booting. Initramfs, or initrd, is used as the first root filesystem that a Linux machine has access to.

Is there a command that I can execute that will allow me to see which method is being used by a RHEL system?

 

Trevor "Red Hat Evangelist" Chandler
Labels (3)
7 Replies
Blue_bird
Flight Engineer
Flight Engineer
  • 274 Views

you can use ls -la /boot/  followed by another command uname -r

Blue_bird_0-1744697697138.png

Blue_bird_1-1744697735162.png

 

Other distributions like SUSE linux uses initrd..!

Thanks

Trevor
Starfighter Starfighter
Starfighter
  • 234 Views

Blue_bird, I like what you've given me, but I still have to know in advance that I need to look in the /boot directory.  I was looking for a command that would provide that information, for the user(s) that aren't knowledgeable of where to look.

Thanks for what you did provide.  Anything that will advance the knowledge of the community is definitely of benefit.

Trevor "Red Hat Evangelist" Chandler
0 Kudos
Chetan_Tiwary_
Community Manager
Community Manager
  • 239 Views

@Trevor could not find a single command that can answer this. However, tried something to gather more info on the same :

Chetan_Tiwary__0-1744745149244.pngChetan_Tiwary__1-1744745164373.png

Then you also have the /boot folder - check inside it and especially grub.cfg, may be you can get any info about it too.

Trevor
Starfighter Starfighter
Starfighter
  • 233 Views

Chetan, if you don't have a command that will display this information, then there isn't one!!!

Your approach is resourceful for sure, and provides an exercise with one of my favorite commands, journalctl.

Thanks Chetan!!!

 

Trevor "Red Hat Evangelist" Chandler
Chetan_Tiwary_
Community Manager
Community Manager
  • 183 Views

@Trevor Another thing that I can think of is that all kernels 2.6 onwards contains the cpio archive that is the initramfs ( i.e RHEL 7 onwards ) and hence that is the mechanism that is used.

If initrd was used , as far as I can remember,  the old initrd ran program called /initrd and not /init.

from the kernel doc :

"All 2.6 Linux kernels contain a gzipped "cpio" format archive, which is
extracted into rootfs when the kernel boots up. After extracting, the kernel
checks to see if rootfs contains a file "init", and if so it executes it as PID1. 

If found, this init process is responsible for bringing the system the
rest of the way up, including locating and mounting the real root device (if
any). If rootfs does not contain an init program after the embedded cpio
archive is extracted into it, the kernel will fall through to the older code
to locate and mount a root partition, then exec some variant of /sbin/init
out of that."

 

sam2019
Moderator
Moderator
  • 225 Views

Just thinking if dmesg can provide some clues here : 

sam2019_0-1744762857249.png

 

Trevor
Starfighter Starfighter
Starfighter
  • 208 Views

sam2019, it's still not what I'm seeking.

I'm looking for that one command, that will communicate to me in its output, that initramfs was the method used, or initrd was the method used - I want this WITHOUT using any additional commands to filter any output.

While your suggestion isn't providing what I'm seeking, I certainly applaud the educational value that it provides!!!

Many thanks for your response!!!

 

Trevor "Red Hat Evangelist" Chandler
Join the discussion
You must log in to join this conversation.