I found a wonderful explanation here. However, let me try to put in a shorter format of what I understood in the answer.
While the system boots, it needs an early userspace. It can be
achieved using either initramfs or initrd.
initrd is loaded into ramdisk which is an actual FILE SYSTEM.
initramfs is not a file system.
For initrd ...
The entire kernel is loaded into memory at boot, typically along with an initramfs nowadays. (It is still possible to set up a system to boot without an initramfs but that's unusual on desktops and servers.)
The initramfs's role is to provide the functionality needed to mount the "real" filesystems and continue booting the system. That involves kernel ...
To configure the initramfs in Debian, you can modify /etc/initramfs/initramfs.conf, or add configuration files and hooks to /etc/initramfs/conf.d and /etc/initramfs/conf-hooks.d.
To rebuild the initramfs, run update-initramfs as root with the appropriate options (update-initramfs -u to update the initramfs of the newest kernel).
All this is in the ...
As you stated, the purpose of initramfs is to get the "real" root filesystem mounted (it can do other things too, but this is the common task).
Without an initramfs, the kernel will normally mount a partition up as read-only and then pass control over to /sbin/init. An initramfs just takes over this task from the kernel, usually when the root filesystem isn'...
If you know the array UUID, then mdadm --assemble /dev/md0 --uuid <uuid> (note the slight difference in parameter order) will do what you want: scan all unused volumes for ones that have md metadata for the given UUID. Other options:
mdadm --assemble /dev/md0 --name <name> (does the same thing as --uuid, but with an array name instead of a UUID....
There is some information about this in the gentoo wiki: https://wiki.gentoo.org/wiki/Custom_Initramfs#Salvaging
It recommends the usage of binwalk which works exceedingly well.
I'll give a quick walk-through with an example:
first extract the bzImage file with binwalk:
> binwalk --extract bzImage
DECIMAL HEXADECIMAL DESCRIPTION
Modify your kernel boot parameter by setting the root=/dev/sdaX option. sdaX would be your / or root partition. Upon booting the next time, you will see that your initramfs tries to mount the partition before trying to access /etc/fstab and mounting the file systems.
See question "Does initramfs use /etc/fstab?" for more details.
Why cpio rather than tar?
This decision was made back in December, 2001. The discussion started
And spawned a second thread (specifically on tar vs cpio), starting
The size increase of having an initramfs is not due to the ramfs driver (it's only a few kB, and needed for other things anyway) but to the initramfs itself. The initramfs contains programs that are necessary to assemble and mount the real root filesystem.
Initramfs makes it a lot easier, and in some cases possible (e.g. encrypted /), to boot the system. It ...
My solution to LUKS and keyboard layout problems is to add the passphrase twice. So the same sequence of key presses will be accepted in both US/qwerty layout and whatever you usually use (in my case, DE/qwertz).
If you use more than one keyboard layout you can add more passphrases for them; LUKS supports up to 8 in total, and most people never use more ...
What you need to understand about initramfs is that it is a filesystem. Since kernel 2.6 it is, basically, the only kernel-imposed filesystem ( leaving aside VFS, which is arguably also a filesystem ) on your machine. Your initramfs image is a disk image.
Within your initramfs image will be whatever files your distribution decided were crucial enough to ...
It's very reliable and supported by all kernel versions that support initrd, AFAIK. It's a feature of the cpio archives that initramfs are made up of. cpio just keeps on extracting its input....we might know the file is two cpio archives one after the other, but cpio just sees it as a single input stream.
Debian advises use of exactly this method (...
You can find the answer in the wiki: the idea is that one does not use /etc/modprobe.d/blacklist.conf.
Instead, say you want to blacklist pcspkr. You create a pcspkr.conf file in /etc/modprobe.d and put blacklist pcspkr inside. Then run
depmod -ae && update-initramfs -u
OK, so I do have a working read-only system on an SD card that allows the read/write switch to be set to read-only mode. I'm going to answer my own question, since I have a feeling I'll be looking here again for the steps, and hopefully this will help someone else out.
While setting various directories in /etc/fstab as read-only on a Red Hat Enterprise ...
thank you for all your answers. I solved the problem by using ps faux and identified that sync does nothing/waits forever.
As i had an usb drive which somehow died and got disconnected the drive still showed up as being mounted.
I renamed /bin/sync to /bin/sync2, copied /bin/ls to /bin/sync and ran apt-get upgrade. It was successful so I renamed the files, ...
The dracut documentation implies that any md raid arrays should be automatically assembled, and that the rd.md.uuid parameter should only be used if you only want certain arrays assembled as part of the boot process.
It seems that in reality, the arrays are not assembled automatically, and are in fact only assembled when the rd.md.uuid parameter is set (for ...
The UUID in /etc/crypttab has to be the UUID of the device that the crypt container sits on top of, not the UUID of the container. Or in other words, if you have /dev/sda1 with /dev/mapper/sda1_crypt on top of it, the /etc/crypttab file should contain the name of the mapper device, sda1_crypt with the UUID of /dev/sda1 not the UUID of /dev/mapper/sda1_crypt.
The initramfs OpenWRT/LEDE kernel builds are including the rootfs image into initramfs, attaching it to the kernel so it will put the filesystem in a ramdisk during bootup and utilize it as /. You don't need such builds if the regular flash-based storage works for you, as it won't allow any persistent configuration by default. Such a configuration is useful ...
Unlike the initrd, Linux does not allow to unmount the initramfs. Apparently this helped keep the kernel code simple.
Instead of pivot_root, you can use the switch_root command. It implements the following procedure. Notice that switch_root deletes all the files on the old root, to free the initramfs memory, so you need to be careful where you run this ...
It is given at boot time by your bootloader, for example Grub.
To see with which arguments your kernel was started, do this:
$ cat /proc/cmdline
For me, this ouputs:
BOOT_IMAGE=/vmlinuz-3.5.0-13-generic root=/dev/mapper/crypt-precise--root ro
So the initrd/initramfs will try to mount my /dev/mapper/crypt-precise--root (encrypted LVM) logical volume as /....
The bootloader stores the initrd into a location in memory, and tells the kernel the memory address of the initrd image. Most modern linux systems use the initramfs scheme using dracut, which is actually a cpio archive (rather than a disk image) that is unpacked into a tmpfs filesystem created by the kernel shortly after execution.
A read-only /etc is increasingly common on embedded devices. A rarely-changing /etc is also increasingly common on desktop and server installations, with files like /etc/mtab and /etc/resolv.conf located on another filesystem and symbolically linked in /etc (so that files in /etc need to be modified when installing software or when the computer's ...
EDIT: Answer updated/corrected.
Although the kernel documentation about this topic says that "Rootfs is a special instance of ramfs (or tmpfs, if that's enabled) [...]",
it is in reality still a ramfs, as a short look in the code shows (rootfs
is not mentioned in mm/shmem.c).
Some patches (see e.g. here and here) were sent to the Linux kernel mailing list ...
This is an old question, but since I searched quite long for a solution, I want to share my result:
ARRAY <ignore> UUID=3f620e6d:4e655d66:b931eb71:baf7cf3a
From man mdadm.conf:
ARRAY The ARRAY lines identify actual arrays. The second word on the line may be the name of the device where the array
Have a look at /usr/lib/locale/. If your output looks like this, read on:
The warning isn't critical, as far as I can tell, but you may try:
sudo locale-gen --purge --no-archive
This command deletes the archive file and replaces it with the .utf8 files.
Afterwards you may look at /usr/lib/locale/ again, it ...
In dracut emergency shell:
Dracut offers a shell for interactive debugging in the event dracut fails to locate your root filesystem. To enable the shell:
Add the boot parameter ''rd.shell'' to your bootloader configuration file (e.g. /etc/grub.conf)
rhgb = redhat graphical boot - This is a GUI mode booting screen with most of the information hidden while ...
It appears the answer was the whole time in front of my eyes.
I have finally found the right package: firmware-linux, which installs all the missing firmware. Install it with:
sudo apt-get install firmware-linux
Those warnings should be gone afterward.