Unix & Linux Stack Exchange
Q&A for users of Linux, FreeBSD and other Unix-like operating systems
Latest Questions
0
votes
2
answers
2079
views
Kernel panic - not syncing: Requested init /init failed (error -2)
Attaching a bit more of the boot log. ``` HugeTLB registered 1.00 GiB page size, pre-allocated 0 pages HugeTLB registered 32.0 MiB page size, pre-allocated 0 pages HugeTLB registered 2.00 MiB page size, pre-allocated 0 pages HugeTLB registered 64.0 KiB page size, pre-allocated 0 pages iommu: Default...
Attaching a bit more of the boot log.
HugeTLB registered 1.00 GiB page size, pre-allocated 0 pages
HugeTLB registered 32.0 MiB page size, pre-allocated 0 pages
HugeTLB registered 2.00 MiB page size, pre-allocated 0 pages
HugeTLB registered 64.0 KiB page size, pre-allocated 0 pages
iommu: Default domain type: Translated
iommu: DMA domain TLB invalidation policy: strict mode
SCSI subsystem initialized
EDAC MC: Ver: 3.0.0
clocksource: Switched to clocksource arch_sys_counter
workingset: timestamp_bits=62 max_order=19 bucket_order=0
Block layer SCSI generic (bsg) driver version 0.4 loaded (major 252)
io scheduler mq-deadline registered
cacheinfo: Unable to detect cache hierarchy for CPU 0
brd: module loaded
VFS: Mounted root (tmpfs filesystem) on device 0:15.
Freeing unused kernel memory: 704K
Run /init as init process
with arguments:
/init
with environment:
HOME=/
TERM=linux
Kernel panic - not syncing: Requested init /init failed (error -2).
CPU: 0 PID: 1 Comm: swapper/0 Not tainted 5.15.0-rc7-00001-g8d7daa446b53-dirty #33
Call trace:
dump_backtrace+0x0/0x1d0
show_stack+0x14/0x20
dump_stack_lvl+0x64/0x7c
dump_stack+0x14/0x2c
panic+0x158/0x304
kernel_init+0xf0/0x150
ret_from_fork+0x10/0x20
Kernel Offset: disabled
CPU features: 0x00001001,20000802
Memory Limit: none
---[ end Kernel panic - not syncing: Requested init /init failed (error -2). ]---
I am building an embedded linux OS for an experimental FPGA platform. I used upstream U-boot(boot-loader), linux(kernel) and buildroot(just for filesystem).
I followed some examples and enabled the required initrd/initramfs support in my linux config.
CONFIG_BLK_DEV_INITRD=y
CONFIG_BLK_DEV_RAM=y
CONFIG_BLK_DEV_RAM_COUNT=1
CONFIG_BLK_DEV_RAM_SIZE=10240
I used the bootm command in u-boot to load a FIT image that comprises of the linux kernel, dtb and the rootfs.cpio(compiled from buildroot). Relevant info here:FIT_Test
These are the bootargs passed to the kernel:
console=ttyS0,9600 earlyprintk maxcpus=1 earlycon root=/dev/ram init=/init rw rootfstype=tmpfs debug
**Note:**
Couple of other things I tried , but resulted in the same error.
- Passing the kernel,dtb and fs image separately.
- Tried a basic initramfs with just an init script , simple directory structure and a separately compiled busybox placed in /bin/busybox with symbolic links.
- Rather than passing an external FS, I passed the path to the initramfs source and compiled it into the kernel with CONFIG_INITRAMFS_SOURCE.
I would appreciate any feedback/pointers on what I could be missing, been stuck on this for while now.
rish_1n4
(1 rep)
Dec 16, 2021, 07:02 PM
• Last activity: Jul 4, 2025, 01:07 PM
1
votes
2
answers
1338
views
How to boot OpenWRT FROM PXE?
I have downloaded OpenWRT files for PC from [OpenWRT site][1]. I have installed `DHCP` and `TFTP` (in my LAN) and can boot (other) kernels from them. Now I want to boot these OpenWRT files. I wrote in PXE config DEFAULT minimallinux SAY Now booting Minimal Linux... LABEL minimallinux MENU LABEL Mini...
I have downloaded OpenWRT files for PC from OpenWRT site . I have installed
DHCP
and TFTP
(in my LAN) and can boot (other) kernels from them.
Now I want to boot these OpenWRT files.
I wrote in PXE config
DEFAULT minimallinux
SAY Now booting Minimal Linux...
LABEL minimallinux
MENU LABEL Minimal Linux
KERNEL vmlinuz
INITRD rootfs-squashfs.img.gz
It boots, loads kernel, then loads image, then starts boot printouts and finaly crashes with kernel panic and reboots
VFS:Cannot open root device "(null)" or unknown-block(0,0): error-6
Please append a correct "root=" boot option; here are the available partitions:
Kernel panic - not syncing: VFS: Unable to mount root fs on unknown un-blokc(0,0)
I also tried
KERNEL vmlinuz
APPEND initrd=rootfs-squashfs.img.gz boot=live toram=rootfs-squashfs.img.gz
and some other combinations but failed.
Any hints appreciated :)
Dims
(3425 rep)
Aug 23, 2019, 06:21 PM
• Last activity: Apr 28, 2025, 05:43 PM
2
votes
2
answers
4374
views
Booting kernel (FIT image) with no rootfs
An embedded Linux device I am working with has the following kernel parameter: `root=/dev/ram0` Additionally, the kernel image is bundled together with an initrd and device tree to make a *flattened image tree*, or [FIT][1] image. When fully booted the device does not have persistent storage. That i...
An embedded Linux device I am working with has the following kernel parameter:
root=/dev/ram0
Additionally, the kernel image is bundled together with an initrd and device tree to make a *flattened image tree*, or FIT image.
When fully booted the device does not have persistent storage. That is, anything written to the file system is completely volatile. Considering the root=
parameter passed to the kernel, this is not surprising.
My questions is: How does this work?
- I do know that Uboot copies the kernel into ram and executes it with a bootm
command, but where do the filesystem files come from? Are they contained within the initrd? My understanding of an initrd is that it is a temporary construct. If so, it would be an offset into FIT image blob. So, how is just passing root=/dev/ram0
sufficient for the kernel to know where its file system is?
- Does the kernel perform introspection and read the FIT image's header to determine placement of constituent components?
- How are file system changes supported inside a FIT image considering it will be packed together with both the kernel and device tree blob?
sherrellbc
(2601 rep)
Jun 28, 2016, 05:49 PM
• Last activity: Apr 27, 2025, 02:04 PM
0
votes
1
answers
119
views
Issue with Custom RHEL 8.10 ISO Boot
I'm facing an issue while booting a custom RHEL 8.10 ISO. During the boot process, I encounter the following error: ```none initqueue[1065]: /usr/sbin/fetch-kickstart-disk: line 24: rmdir: command not found ``` I extracted `initrd.img`, modified `/usr/sbin/fetch-kickstart-disk`, and then rebuilt the...
I'm facing an issue while booting a custom RHEL 8.10 ISO. During the boot process, I encounter the following error:
initqueue: /usr/sbin/fetch-kickstart-disk: line 24: rmdir: command not found
I extracted initrd.img
, modified /usr/sbin/fetch-kickstart-disk
, and then rebuilt the ISO. However, the problem persists.
Has anyone encountered this issue before? Any suggestions on how to properly modify initrd.img
or ensure rmdir
is available during boot?
Thanks
This is what I tried:
* Extract the image:
-sh
xzcat initrd.img | cpio -idmv
* Modify line 24 to remove rmdir
command:
-sh
vi usr/sbin/fetch-kickstart-disk
* Recreate the image file
-sh
find . | cpio -o -H newc | xz --check=crc32 -9 > /WORK/isolinux/initrd.img
* Build the ISO file
-sh
xorriso -as mkisofs -o /RHEL-8-10-0-BaseOS-x86_64.iso -b isolinux/isolinux.bin -c isolinux/boot.cat -no-emul-boot -boot-load-size 4 -boot-info-table /WORK/
Ferdinando96
(1 rep)
Mar 13, 2025, 07:09 AM
• Last activity: Mar 13, 2025, 09:08 PM
1
votes
5
answers
17197
views
How to change the boot kernel of a usb live w/ persistent running Kali
First, the issue that I'm having is being unable to run VirtualBox on Kali 2.0. I set up a usb live with persistence running Kali 2.0, which at the time had the 4.6.0-kali1-amd64 kernel. I have since updated/upgraded/dist-upgraded etc with all of the recommended sources. As a part of this, the new h...
First, the issue that I'm having is being unable to run VirtualBox on Kali 2.0.
I set up a usb live with persistence running Kali 2.0, which at the time had the 4.6.0-kali1-amd64 kernel. I have since updated/upgraded/dist-upgraded etc with all of the recommended sources. As a part of this, the new headers/kernels that have been installed are 4.9.0-kali4-amd64. However, even after boot, the kernel is 4.6.0, as confirmed by uname -r and the error thrown by vbox. I know normally grub needs to be config'd, though there is no grub bootloader in the usb live boot.
The error thrown by virtualbox says that no suitable driver was found for the 4.6.0 kernel, and also that the system is not set up to dynamically create drivers (though I believe that this is due to the fact that it is making the driver for the 4.9.0, but this is not the running kernel).
Micfireball
(51 rep)
May 11, 2017, 04:11 PM
• Last activity: Jan 4, 2025, 11:31 PM
3
votes
3
answers
3334
views
Is there a way to get Linux to treat an initramfs as the final root filesystem?
I want to boot a system with an initramfs that's the actual final filesystem, not a temporary initramfs for loading drivers. Unfortunately, Linux imposes different (and in my case, undesirable) behaviors when using initramfs, including at least the following differences: - devtmpfs is not auto-mount...
I want to boot a system with an initramfs that's the actual final filesystem, not a temporary initramfs for loading drivers. Unfortunately, Linux imposes different (and in my case, undesirable) behaviors when using initramfs, including at least the following differences:
- devtmpfs is not auto-mounted, at least not at first, but seems to get auto-mounted at some point later which I can't figure out.
- Instead of running
/sbin/init
(or the init program specified by init=
on the command line) the kernel attempts to invoke /init
.
I know it's possible to work around these by putting some extra junk on the initramfs, but I'd rather it just behave like a normal root fs. Is there any way to achieve this?
If I do need to work around it with userspace scripting in the initramfs, I at least want to understand what triggers the auto-mounting of devtmpfs.
R.. GitHub STOP HELPING ICE
(2964 rep)
Oct 10, 2015, 09:02 PM
• Last activity: Nov 22, 2024, 03:06 PM
0
votes
1
answers
144
views
Old distro version on new hardware
I am trying to install CentOS 6 on new hardware for testing because our software is dependent on the package versions in CentOS 6. The trivial answer would be to update the software to run on a newer version since CentOS 6 is well past EOL, but I'm not a software dev and we will be looking at the LO...
I am trying to install CentOS 6 on new hardware for testing because our software is dependent on the package versions in CentOS 6. The trivial answer would be to update the software to run on a newer version since CentOS 6 is well past EOL, but I'm not a software dev and we will be looking at the LOE soon.
The current state:
- The machine has an Intel 13th gen i5-1335U processor with a UEFI only BIOS (no legacy mode) and secure boot disabled
- CentOS 7.5+ and Debian 10.0+ works, but earlier versions do not
- I am using x86_64 installers and burning them to removable media with Rufus in UEFI mode
- I have verified that when installing they are using GPT partitions
- The installers themselves will boot into GRUB (legacy or 2), but when it tries to load the kernel and initrd/initramfs it fails
- Currently I have Debian 12 installed with CentOS 6 so Debian is controlling Grub 2, but it still won't boot into CentOS 6
-Older hardware which have legacy mode in their BIOS is able to use both MBR & GPT partitions and boot CentOS 6 (Intel Atom E3845)
- I am able to virtulize RHEL 6 in Qemu running in Debian 12
Failed attempts to fix so far:
- Recreated the RHEL 6 initramfs in Debian 12
- Modify the RHEL 6 GRUB 2 entry
- Use the GRUB 2 OS prober to create a RHEL 6 entry
- When loading an installer it either goes to a blinking cursor or the GRUB splash image is frozen on screen. In that state I am not able to switch to any TTYs
- Adding echo statements to a custom GRUB entry makes it seem that it loads the initramfs. It shows the echo statements before loading the kernel, after loading the kernel but before loading initramfs, and after loading initramfs. After the echo statements show on screen it either reboots the machine or hangs with no TTYs.
My current theories:
- The kernels are not compiled with necessary modules/parameters
- There is something with initrd/iniramfs which is preventing the kernel from booting
- The intel microcode included with the installers does not support the newer processor
- Even though secure boot has been disabled I need to install a self-signed MOK & shim
Any ideas on why an older distro won't load on new hardware?
GrandInformation
(1 rep)
Nov 15, 2024, 03:54 PM
• Last activity: Nov 15, 2024, 07:22 PM
0
votes
0
answers
132
views
Encrypted multiboot usb / adding cryptsetup to initrd
I'm trying to create a multiboot usb drive for Debian images including a live system, netinst, and DVD-1 iso. I've got as far as creating the partitions 1. EFI fat32 2. Boot luks2 3. ISOs luks2 Then I install grub targeting the efi and boot partitions, add a vmlinuz and initrd to the boot partition...
I'm trying to create a multiboot usb drive for Debian images including a live system, netinst, and DVD-1 iso.
I've got as far as creating the partitions
1. EFI fat32
2. Boot luks2
3. ISOs luks2
Then I install grub targeting the efi and boot partitions, add a vmlinuz and initrd to the boot partition along with a custom grub.cfg.
Grub successful unlocks the boot partition and then runs the kernel. However, at this point I can't get the kernel to unlock the ISOs partition where the iso images are.
As far as I understand it, the initrd file downloaded from:
https://deb.debian.org/debian/dists/bookworm/main/installer-amd64/current/images/hd-media/
does not include support for cryptsetup, nor does any other initrd image I've tried. It looks like I need to edit or make my own. My host system (also Debian) is able to unlock a luks partition so it is obviously possible, but I don't know the steps to take to set this up on a usb drive.
My
grub.cfg
menuentries look a bit like:
# Workaround for "out of memory" error
rmmod tpm
menuentry "Install" {
set isofile="/debian-${VERSION}-amd64-${installer}.iso"
set options="cryptdevice=UUID=${cryptuuid}:luks root=/dev/mapper/luks quiet splash"
linux /vmlinuz iso-scan/filename=$isofile $options
initrd /initrd.img
}
menuentry "Live" {
loopback loop ($root)$isofile
linux (loop)/live/vmlinuz boot=live findiso=$isofile
initrd (loop)/live/initrd.img
}
At the moment the iso-scan fails to find the iso image and it appears that the 3rd partition is never unlocked.
I'm a little bit over my head with creating a custom initrd and am not sure where to start. A lot of the documentation assumes you are running commands on the local system for the local system.
EDIT:
I've had some success using debootstrap
and then chroot
, installing a few things and then using mkinitramfs
, however it doesn't load properly
> Gave up waiting for root file system device. Common problems:
...
ALERT! /dev/mapper/luks does not exist. Dropping to a shell!
a2k42
(131 rep)
Nov 5, 2024, 01:57 PM
• Last activity: Nov 5, 2024, 04:54 PM
0
votes
0
answers
110
views
How to limit the number of initrd images kept in /boot under Debian Linux?
initramfs failed to do its job a few days ago and I've just noticed today that my boot partition was almost full because of useless initrd images. Is there a way of telling Debian to keep only two or three initrd images at most? I'm not sure that I have the same problem under Mobian which is derived...
initramfs failed to do its job a few days ago and I've just noticed today that my boot partition was almost full because of useless initrd images. Is there a way of telling Debian to keep only two or three initrd images at most? I'm not sure that I have the same problem under Mobian which is derived from Debian. I'm under Debian 12 as far as I know.
gouessej
(121 rep)
Sep 1, 2024, 11:09 AM
0
votes
1
answers
131
views
Custom initrd script failing to init "Attempted to kill init"
I am trying to create a custom ramdisk, but it keeps failing right before launching init. Here is the script: https://gist.github.com/amanuel2/f3e8bb9399f3b3bd36a90cd925ecf63d Logs: [![enter image description here][1]][1] Edit 2: Logs: https://pastebin.com/FUxUtiSE Script: https://gist.github.com/am...
I am trying to create a custom ramdisk, but it keeps failing right before launching init.
Here is the script: https://gist.github.com/amanuel2/f3e8bb9399f3b3bd36a90cd925ecf63d
Logs:
Edit 2:
Logs: https://pastebin.com/FUxUtiSE
Script: https://gist.github.com/amanuel2/f3e8bb9399f3b3bd36a90cd925ecf63d

amanuel2
(101 rep)
Jul 8, 2024, 03:05 AM
• Last activity: Jul 9, 2024, 02:07 AM
-1
votes
1
answers
238
views
Grub2 not booting initrd
I have a laptop (with UEFI) that used to be able to boot from a usb stick, but can't any more. The problem started when I interrupted a fresh install of Devuan Live. The laptop has a non-removable mmcblk device and a removable (real) hard disk. Both have several linux kernels on them (Debian, Ubuntu...
I have a laptop (with UEFI) that used to be able to boot from a usb stick, but can't any more. The problem started when I interrupted a fresh install of Devuan Live. The laptop has a non-removable mmcblk device and a removable (real) hard disk. Both have several linux kernels on them (Debian, Ubuntu). At power on I get the usual grub2 menu, but whatever I choose: it loads the kernel, then the initrd, but then nothing else happens. If I just load a kernel (no initrd) and boot, it starts booting but halts with a kernel panic (VFS syncing problem). memtest won't boot either.
What could be the source of problem, and is there anything I could do to save the laptop? The only tool I have on the laptop itself is the grub2 console. Otherwise I could move the hard disk to another PC, put something on it, put it back in the laptop and try to get it booted.
Bruzzel
(29 rep)
Jun 21, 2024, 12:38 PM
• Last activity: Jun 21, 2024, 01:27 PM
0
votes
1
answers
113
views
How do I keep init from pivot_root and stay in ramdisk?
in short, I was not satisfied with the available distros as they are either roo large or are missing the features I need ootb, I also want it to boot it into ramdisk, so I made my own ISO. This ISO contains the isolinux bootloader, the linux kernel and the initrd which contains busybox and a few oth...
in short, I was not satisfied with the available distros as they are either roo large or are missing the features I need ootb, I also want it to boot it into ramdisk, so I made my own ISO.
This ISO contains the isolinux bootloader, the linux kernel and the initrd which contains busybox and a few other tools.
Now the issue I'm having is that busybox init is trying to pivot_root and I haven't specified root, I also don't want to pivot as all I need is already in the ramdisk, however setting root=/dev/ram0 doesn't work(invalid partition/root) and it still causes a kernel panic
Under "Operation" in this [link](https://www.kernel.org/doc/html/latest/admin-guide/initrd.html) I want to get to step 5 and no further, I haven't found much yet, so I am asking here.
How would I prevent linux/busybox/init from trying to leave the ramdisk?
qwerty_in_me
(23 rep)
Feb 26, 2024, 10:08 AM
• Last activity: Feb 26, 2024, 02:01 PM
0
votes
0
answers
159
views
noinitrd is ignored, always runs initrd copy of /init
I use an initrd currently on an imx8 processor that uses buildroot for a base filesystem. (kernel is 5.10.52) For debugging purposes, I want to bypass the initrd and load the filesystem I copied to a real device partition (`/dev/mmcblk2p2`) -- so I pass: noinitrd root=/dev/mmcblk2p2 init=/linuxrc to...
I use an initrd currently on an imx8 processor that uses buildroot for a base filesystem. (kernel is 5.10.52)
For debugging purposes, I want to bypass the initrd and load the filesystem I copied to a real device partition (
/dev/mmcblk2p2
) -- so I pass:
noinitrd root=/dev/mmcblk2p2 init=/linuxrc
to the kernel command line.
It gets completely ignored and boots /linuxrc that is in the initrd.
console shows:
Run /init as init process
no matter what... and /proc/cmdline shows the parameters I pass in...
Is noinitrd ignored? Are there any magic paramters that allow my system to boot off a physical partition with noinitrd specified?
Floyd Brown
(1 rep)
Oct 26, 2023, 05:09 PM
• Last activity: Nov 5, 2023, 10:19 AM
9
votes
2
answers
778
views
Eliminate inclusion of X11 libs in initrd
I'm running Debian Bookworm on a TS412 (QNAP); it stores the kernel & initrd in flash. It has a total of 16MB of flash. So even after tweaking with the MD partitions the best I can get is a 12MB initrd . I'm using xz compression. But even so, the initial initrd was 12.5MB. I know the common fix is t...
I'm running Debian Bookworm on a TS412 (QNAP); it stores the kernel & initrd in flash. It has a total of 16MB of flash. So even after tweaking with the MD partitions the best I can get is a 12MB initrd . I'm using xz compression. But even so, the initial initrd was 12.5MB. I know the common fix is to reduce modules, but they are not the real issue.
2984 .../usr/lib/modules
6036 .../usr/share
18824 .../usr/lib/arm-linux-gnueabi
Looking in arm-linux-gnueabi it had stuff like libX11... This machine does not even have a console (even getting a serial line is difficult) it certainly does not need "X".
So I removed lots of packages totally (apt-get remove ...) in fact rather more than I should really. But the result was a much smaller initrd (about 5MB IIRC) which boots and runs just fine.
Problem is, if I ssh onto the box and run say emacs(1) it'd be nice to project the GUI version back to my normal desktop (which has lots of memory and big displays, etc.) but this would require installing the X client libraries on the TS412.
Now I don't see why just because I have the package with the X client libraries installed, that a copy needs to be kept on initrd, they aren't needed during boot. Is there a way to limit other stuff from getting onto initrd, not just modules (which are not the culprit)
I've already tried document searches for guides to limit initrd.
GraemeV
(348 rep)
Oct 21, 2023, 02:05 PM
• Last activity: Oct 24, 2023, 01:23 AM
0
votes
0
answers
87
views
Linux without initrd: unable to mount rootfs
## Setup Partitions: ``` # fdisk -l /dev/sda ... Device Boot Start End Sectors Size Id Type /dev/sda1 * 2048 51199 49152 24M c W95 FAT32 (LBA) /dev/sda2 51200 204799 153600 75M 83 Linux ``` [Syslinux](https://wiki.archlinux.org/title/Syslinux) configuration: ```syslinux UI menu.c32 LABEL linux LINUX...
## Setup
Partitions:
# fdisk -l /dev/sda
...
Device Boot Start End Sectors Size Id Type
/dev/sda1 * 2048 51199 49152 24M c W95 FAT32 (LBA)
/dev/sda2 51200 204799 153600 75M 83 Linux
[Syslinux](https://wiki.archlinux.org/title/Syslinux) configuration:
UI menu.c32
LABEL linux
LINUX ../bzImage
APPEND nomodeset rootfstype=ext4 root=/dev/sda2
/init
:
#!/bin/sh
mount -t proc proc proc
mount -t sysfs sysfs sys
mount -t devtmpfs udev dev
/bin/sh
poweroff -f
## Testing
Booting via QEMU works:
# qemu-system-x86_64 /dev/sda
However, booting on my laptop gives:
Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(0,0)
If I use an initrd:
...
APPEND nomodeset rootfstype=tmpfs initrd=../initrd.img
...then my laptop boots fine, despite the initrd not having any kernel modules
## See also
- https://unix.stackexchange.com/questions/9451/booting-without-initrd
- [Unable to mount
...](https://unix.stackexchange.com/a/414662/450817)
GooseDeveloper
(37 rep)
Oct 16, 2023, 05:35 PM
• Last activity: Oct 18, 2023, 04:39 PM
1
votes
0
answers
1137
views
Alpine linux how to load system into RAM
I need advice if possible to load entire system into RAM. Let's imagine following situation: Booting LIVE OS from DVD and login as root lsblk shows ``` NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINTS loop0 7:0 0 2.9G 1 loop sda 8:0 0 19.1G 0 disk |-sda1 8:1 0 1G 0 part `-sda2 8:2 0 18.1G 0 part sr0 11:0 1...
I need advice if possible to load entire system into RAM.
Let's imagine following situation:
Booting LIVE OS from DVD and login as root
lsblk shows
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINTS
loop0 7:0 0 2.9G 1 loop
sda 8:0 0 19.1G 0 disk
|-sda1 8:1 0 1G 0 part
`-sda2 8:2 0 18.1G 0 part
sr0 11:0 1 1024M 0 rom
I cannot do netboot with ipxe because I will need to have VPN.
The only option here is to use DD and overwrite existing /dev/sda with my custom alpine.img
I will use qemu and apline linux virt image.
Here are the steps I have done so far:
- Booted Alpine linux from iso and created /dev/sda
- sda will bave only boot partition as mounting point as following:
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINTS
sda 8:0 0 1G 0 disk
├─sda1 8:1 0 300M 0 part /boot
- in /boot directory I have copied following:
/boot/
├── alpine-rootfs.tar.gz
├── System.map-virt
├── boot -> .
├── config-virt
├── extlinux.conf
├── initramfs-virt
├── ldlinux.c32
├── ldlinux.sys
├── libcom32.c32
├── libutil.c32
├── lost+found
├── mboot.c32
├── menu.c32
├── vesamenu.c32
└── vmlinuz-virt
extlinux.conf contains
# Generated by update-extlinux 6.04_pre1-r15
DEFAULT menu.c32
PROMPT 0
MENU TITLE Alpine/Linux Boot Menu
MENU HIDDEN
MENU AUTOBOOT Alpine will be booted automatically in # seconds.
TIMEOUT 10
LABEL virt
MENU LABEL Linux virt
LINUX vmlinuz-virt
INITRD initramfs-virt
APPEND root=/dev/ram0 modules=sd-mod,usb-storage,ext4 quiet rootfstype=ext4
In the initramfs-virt I have added following code:
# Create a RAM disk with a filesystem (adjust the size as needed)
mkdir -p /sysroot
mount -t tmpfs -o size=512M tmpfs /sysroot
# Extract the contents of your root filesystem (e.g., Alpine Linux) to the RAM disk
tar -xzvf /path/to/your/alpine-rootfs.tar.gz -C /sysroot
# Pivot to the RAM disk as the new root filesystem
exec switch_root /sysroot /sbin/init
Unfortunately boot process fails,
Can someone advice what am I doing wrong here
The whole point here is to have following solution:
- Once rescue DVD is booted use dd to overwrite existing /dev/sda with my custom alpine.img
- next boot from custom alpine.img and load system into RAM
- once you login to shell create ssh tunnelling and deploy final operating system
Rafal Niznik
(333 rep)
Oct 15, 2023, 01:46 PM
2
votes
2
answers
1556
views
Nixos install results in error during boot of "Timed out waiting for device /dev/dis/by-uuid/... to appear" with external NVME drive via USB
I have an issue when using an external NVME drive, grub successfully boots but once entering the entry `default configuration` (nixos generation) it gives me the below error: > "Timed out waiting for device /dev/dis/by-uuid/... to appear" I've double checked the UUID of the `/` partiton and it corre...
I have an issue when using an external NVME drive, grub successfully boots but once entering the entry
default configuration
(nixos generation) it gives me the below error:
> "Timed out waiting for device /dev/dis/by-uuid/... to appear"
I've double checked the UUID of the /
partiton and it correctly matches what is in /etc/fstab
and hardware-configuration.nix
(which got generated with nixos-generate-config
). In the grub recovery console if I do a ls -l
I can see the partition with the correct UUID as well.
I've also added "nvme"
to boot.initrd.availableKernelModules
.
I'm able to nixos-enter
the system via an external "live usb" with no issue.
I suspect I need an additional initrd kernel module to be able to boot this, but I'm not sure which one?
I've tried:
1. Adding these modules (got these from https://help.ubuntu.com/community/BootFromUSB) :
usbcore
sd_mod
ehci_hcd
uhci_hcd
ohci_hcd
usb_storage
scsi_mod
which still results in the same error.
2. Copying the partition to the internal drive (as opposed to the external NVME drive which still results in the same error.
Chris Stryczynski
(6593 rep)
Jul 8, 2023, 06:01 PM
• Last activity: Jul 23, 2023, 11:30 AM
0
votes
2
answers
400
views
Why initrd size is not fixed?
After **update-initramfs -c -k KERNELVERSION**(I didn't do any change and just type this command), the initrd will always has different size with the previous initrd. And this situation happen on Debian 11 and Ubuntu 20.04. Does initrd has different compression method each time?
After **update-initramfs -c -k KERNELVERSION**(I didn't do any change and just type this command), the initrd will always has different size with the previous initrd.
And this situation happen on Debian 11 and Ubuntu 20.04.
Does initrd has different compression method each time?
Azreal
(43 rep)
Mar 25, 2022, 05:35 AM
• Last activity: May 31, 2023, 02:21 AM
12
votes
2
answers
16549
views
How to populate /dev directory when building my own initrd?
I am trying to learn stuff about initrd. I have followed [this tutorial][1] to build my own initrd from scratch, and I installed busybox on it. Then I made an .iso from it with isolinux, so I could test it in virtualbox. It works great! I have the basic commands from busybox, so I wanted to mount a...
I am trying to learn stuff about initrd. I have followed this tutorial to build my own initrd from scratch, and I installed busybox on it. Then I made an .iso from it with isolinux, so I could test it in virtualbox. It works great!
I have the basic commands from busybox, so I wanted to mount a filesystem. But the /dev directory is almost empty (no sda), except for some files I created while following the tutorial. I learned about udev and I think this is what I need. However I am not sure how to go on this.
Should I just grab the latest source code from udev, compile it and add it to my initrd? And then call /bin/udev or something like that in my init script? Or is there an other/better way to populate the /dev directory?
**Edit:** Some additional info and updates on what I have done already.
- I test everything in virtual box. I just installed ubuntu minimal in virtual box, made an .iso from my initrd, and then boot from the iso in virtualbox.
- I used the vmlinuz and
/lib/modules
that were present on a debian-businesscard.iso and copied those over to my initrd which I created by following the tutorial I linked earlier.
- Kernel has CONFIG_DEVTMPFS=y
- Some devices show up in /dev
, like tty0-tty63 and some others, but no sda/hda.
- Ran lspci -k
in my currently running OS and in a virtual box to check which modules are in use. SATA Controller
says it uses ahci
as module.
- When I execute modprobe -v ahci
it complains a lot about "unknown symbol: ata_some_stuff", but after that it returns something like SCSI Subsystem initialized
, ATA-6: VBOX HARDDISK
and Direct-Access ATA VBOX HARDDISK
. However, still no harddrive devices found in /dev
.
My current /init/
script is as follows:
#!/bin/ash
mount -t devtmpfs none /dev
mount -t proc /proc /proc
mount -t sysfs none /sys
modprobe -v ahci
echo "Hello world"
exec /bin/ash --login
Does anyone has any idea what I am doing wrong and what I should be doing instead?
Carlito
(578 rep)
Oct 23, 2012, 08:31 PM
• Last activity: May 10, 2023, 08:25 AM
1
votes
1
answers
2827
views
CentOS 7.6 - Initrd.img not loading updated driver
I have been trying to load an updated initrd.img file with updated drivers on booting the Centos 7.6 ISO, however it seems to still load the old driver even though I have replaced the driver. ##Steps taken:## ###Extracted initrd image from ISO:### 1. Mounted CentOS 7.6 ISO 2. Copied the initrd.img f...
I have been trying to load an updated initrd.img file with updated drivers on booting the Centos 7.6 ISO, however it seems to still load the old driver even though I have replaced the driver.
##Steps taken:##
###Extracted initrd image from ISO:###
1. Mounted CentOS 7.6 ISO
2. Copied the initrd.img from isolinux/initrd.img to temporary folder (/tmp/image)
3. Created a new folder at /tmp/image/initrd
4. Extracted the initrd.img the folder by running
xz -dc /dev/null | cpio -c -o | xz -9 --check=crc32 > ../initrd.img
3. Copy the generated initrd.img back into the ISO at isolinux/initrd.img and images/pxe/initrd.img
##Expected Results##
After updating the driver in the initrd.img and copying it into the ISO, I expect the new driver (e1000e version 3.6.0) to be loaded in after the ISO install boot process is complete.
##Actual Results##
I am able to boot from the ISO and install Centos 7 from it, however after installing Centos, running the following command:
modinfo e1000e
Gives the old version of the driver that was on the initrd.img initially (e1000e version 3.2.6) rather than version 3.6.0 which I loaded onto the initrd.img image.
I am not too sure what I am doing wrong, whether I am creating the driver incorrectly, loading the driver incorrectly, creating the initrd.img incorrectly or anything else.
Any help would be appreciated as I have been trying to get this working for the past few days. This is my first post, so let me know if I am doing anything wrong or if any additional information is required debug this issue.
Cheers
luj
(11 rep)
Apr 8, 2020, 03:54 AM
• Last activity: Apr 28, 2023, 06:07 AM
Showing page 1 of 20 total questions