In this video, you'll learn about managing the INIT-RAMFS, also known as the INIT-RD.
So the main purpose of the INIT-RAMFS is to provide kernel modules, which are required
to mount the root file system. INIT-RAMFS or INIT-RD is generated automatically when
you install your system. The installer detects all the hardware that is present, and it generates
the INIT-RAMFS for you. And the INIT-RAMFS consists of a set of directories that are
required to create it, and it is bundled into a CPIO archive. CPIO is an ancient way of
making backups. Every now and then you will encounter it, and every now and then it's
still used as a format. This CPIO archive is extracted at boot time. And if all modules
that are required to mount the root file system are compiled in the kernel, booting can happen
without INIT-RAMFS. But that is never the case. INIT-RAMFS can also offer additional
functionality, which allows the system to boot from non-default storage, like LVM, encrypted
root file system, or a network-based root file system. If ever you want to reconfigure
your system later on to do something like that, you need to know how to rebuild your
INIT-RAMFS. So how does that work? Well, on Red Hat family distributions, the DRAKUT utility
has become the standard tool for building an INIT-RAMFS. And it can be configured with
settings in etcdrakut.conf. And when you are running DRAKUT without configuration arguments,
it will build an INIT-RAMFS based on current settings. So after adding new hardware, of
which you want to have the drivers in your INIT-RAMFS, first make sure that the hardware
drivers are present, and then run DRAKUT. On Ubuntu, you can use mkinitrd. And mkinitrd
is the Ubuntu alternative for generating the INIT-RAMFS. Now there's a funny thing that
we can do on Red Hat. On Red Hat, you can use the rd.breakboot argument to boot straight
into the INIT-RAMFS. And that can be useful for troubleshooting. Let me show you. So to
use this boot argument, you need to go to the group boot menu. Press E to open the editor
interface. And from there, at the end of the line that loads Linux, you type rd.break.
And then you use Ctrl-X to continue booting. So what is this doing? Well, this is entering
the emergency mode. And kind of fun, we do need to pass the root password. So I'm going
to enter the root password. And then I'm in the shell. And what is the shell? Well, if
you type mount, then you can see on the top line that I have a rootfs on slash type rootfs.
And that is my INIT-RAMFS. So when I type ls slash, the directories that I see are in
the INIT-RAMFS. And this environment can be handy for troubleshooting. Now, this is
the RAM file system that is normally processed while booting. The root file system is already
on the sysroot directory, which is in slash. And here, your booting will continue once
you have passed your options in the INIT-RAMFS. You can see that in the last line of output
of the mount command, you can also see that this slash sysroot is read-only. You see the
letters ro indicating it's read-only. So if ever you want to do something from this point
of view, then you need mount minus o remount comma rw on slash sysroot. And that is giving
access to all files on your ordinary operating system. And that's how you can boot into the
INIT-RAMFS using rd.break on Red Hat. It's a Red Hat-specific option, so it won't work
on Ubuntu, for instance.