Skip to contentSkip to conversation

boot time autoassembly: how come it works?

DISCUSSION Jules Bean 3 participants 4 messages Jun 4, 2008 – Jun 5, 2008 MD RAID

lore
Share & tools
lore

Jules Bean

author
#0 lore raw

I'm trying to understand the boot sequence of new kernels (2.6.24, initramfs) better and I really don't understand how the RAID assembly works.

The docs (md.txt) say that auto-assembly only occurs if the RAID arrays are marked as 'RAID autodetect' aka partition type 0xfd. On the other hand mdadm needs mdadm.conf to get going.

My RAID arrays (including the one which contains the root file system, /dev/md2) are not marked as 0xfd, and they are not correctly listed in /etc/mdadm/mdadm.conf on the initramfs filesystem either. (There are some listings in there but they are out of date : UUIDs wrong and number of devices wrong).

So how come it works?

Jules

#1 lore raw
Quoted 3 lines · Jules Bean

The docs (md.txt) say that auto-assembly only occurs if the RAID arrays are marked as 'RAID autodetect' aka partition type 0xfd. On the other hand mdadm needs mdadm.conf to get going.

You may to pull apart your initrd image and look at your init script (or whatever your startup script is called) to see how it is assembling your arrays. If you're using user space to assemble your arrays at boot time (i.e. mdadm via initrd) it is most likely using the mdadm.conf file located in the initrd. Typically, mkinitrd is called when a new kernel is installed. The mkinitrd script will grab the necessary files (i.e. mdadm.conf) needed to mount the root filesystem.

I'm not sure I've seen a system auto assemble an array when the partitions were not set to 0xfd. My bet is that you have a mdadm.conf file in your initrd and that the init script is starting the array in user space via mdadm.

Though, I could be wrong :-)

Bryan

#3 lore raw
In reply to Jules Bean
Quoted 4 lines · Jules Bean

I'm trying to understand the boot sequence of new kernels (2.6.24, initramfs) better and I really don't understand how the RAID assembly works.

The docs (md.txt) say that auto-assembly only occurs if the RAID arrays are marked as 'RAID autodetect' aka partition type 0xfd. On the other hand mdadm needs mdadm.conf to get going.

Initramfs is a tiny linux. It (usually) either has simple mdassamble or mdassemble.auto, or full-blown mdadm - and when you use those, partition type is ignored.

Partitions with 0xfd relate to [deprecated in times of early userpsace] method of assembling the arrays by the kernel itself, before any userspace code (initramfs/rd, your system) takes action.

author
#2 lore raw
In reply to Bryan Mesich
Quoted 4 lines · Bryan Mesich

I'm not sure I've seen a system auto assemble an array when the partitions were not set to 0xfd. My bet is that you have a mdadm.conf file in your initrd and that the init script is starting the array in user space via mdadm.

Yes, there is an mdadm.conf and a full copy of mdadm in my initramfs.

However the mdadm.conf is wrong. weird.

It has the wrong number of devices listed for both arrays, and the wrong UUIDs. Somehow that must be close enough to work.

Jules