
Both ways work. If your kernel is a EFI stub, the initrd must be built in as only one file is loaded.- Should I compile initramfs into the kernel or use an external image?
Maybe. You can pass an ready made initramfs, or have the kernel build sytem wake it for you.- Do I need "initrd path/to/external/image" in grub.cfg if I compiled initramfs into bzImage?
Yes but you mention full disc raid. That's an extra complication.- Can grub2 load a kernel from a RAID-1 volume?
That's harder without knowing your disc layout.- What's the correct root= parameter?
No. It just saves a few milliseconds mounting root as the kernel does not need to try all the filesystems it knows about.- Do I need rootfstype?
For SATA HDD, no. For root on USB and the like, yes.- Do I need rootdelay/rootwait?
What sort of raid do you have?Final goal is the following setup:
- (OK) BIOS assembles RAID1 mirror "Volume0" on SATA disks sdb and sdc (full-disk raid)
Yep. It also loads the initrd if if been told to.- (OK) BIOS loads grub2 from "Volume0"
- (OK?) Grub2 loads kernel from sdb1 (or sdc1 - or Volume0p1?)
I'd prefer to compile initramfs into linux, then, and have the kernel wake it. I'd like the bootloader to do as little as possible.NeddySeagoon wrote:Both ways work. [...] You can [...] have the kernel build sytem wake it for you.cami wrote:- Should I compile initramfs into the kernel or use an external image?
- Do I need "initrd path/to/external/image" in grub.cfg [...]?
I think it's FakeRaid. The array was created using BIOS (EFI?) menus. When Linux is running, I'm using mdadm to assemble it. It's definitely not hardware RAID.NeddySeagoon wrote:Fakeraid, mdadm raid or real hardware raid
This is an unmodded ASRock X58 Extreme board from 2009, Intel X58 chipset. It might be EFI, if I had to guess I'd say it is not, but I really don't know.NeddySeagoon wrote:Are we really talking BIOS or is it UEFI?
It's just a stub so far, as I want to focus on the earlier parts of the boot process to work before elaborating it. (Sidenote: I'm using initramfs, not initramdisk, but I guess initrd is used as shorthand for both.)NeddySeagoon wrote:Post the init script from your initrd.


You need console and null. /dev/forget is not necessary.You need console, null and one other, I forget.
Code: Select all
# base system
dir /dev 755 0 0
dir /dev/md 755 0 0
nod /dev/console 600 0 0 c 5 1
nod /dev/sdb 600 0 0 b 8 16
nod /dev/sdc 600 0 0 b 8 32
dir /etc 755 0 0
dir /lib64 755 0 0
file /lib64/libc.so.6 /lib64/libc.so.6 755 0 0
file /lib64/libgcc_s.so.1 /usr/lib/gcc/x86_64-pc-linux-gnu/4.9.3/libgcc_s.so.1 755 0 0
file /lib64/ld-linux-x86-64.so.2 /lib64/ld-linux-x86-64.so.2 755 0 0
dir /proc 755 0 0
dir /root 700 0 0
dir /run 755 0 0
dir /sbin 755 0 0
dir /sys 755 0 0
# init
file /init /usr/src/initramfs/init 755 0 0
# mdadm
file /sbin/mdadm /sbin/mdadm 755 0 0
file /etc/mdadm.conf /etc/mdadm.conf 644 0 0
dir /run/mdadm 755 0 0
Code: Select all
#!/bin/sh
# mount /proc and /sys
mount -t proc proc /proc
mount -t sysfs sysfs /sys
# run mdadm
mdadm --assemble --scan --auto=mdp
# mount /
mount -t xfs /dev/md/Volume0_0p3 /mnt
# run /sbin/init
/sbin/switch_root /mnt /sbin/init