You are not logged in.

#1 2010-04-11 20:34:51

flo
Member
Registered: 2009-10-12
Posts: 6

Encrypted root on software RAID with 2.6.33

Hi,

I ran an update earlier today on my HTPC, hoping for mantis included in the 2.6.33 kernel to work with my TV-Tuner card, when I recognized that the configuration for software-raids changed.

So I followed the instructions on: Installing with Software RAID or LVM and added the dm_mod module to the MODULES list and replaced raid with mdadm in the HOOKS list resulting in

HOOKS="base udev autodetect sata mdadm usbinput ecrypt filesystems"

After that I successfully rebuilt the kernel and decided it was time for a reboot, but after running the hooks udev, mdadm and encrypt, the screen shows:

Waiting 10 seconds for device /dev/mapper/root ...
root device '/dev/mapper/root' doesn't exist. Attempting to create it.
ERROR: Unable to determine major/minor number of root device '/dev/mapper/roo'.
You are being dropped to a recovery shell.

cat /proc/mdstat shows no configured raid arrays, while assembling them with mdassemble works.
I've tried to boot with and without specifying the raid arrays in grub's kernel line, always with the same result.
Even after booting from a live CD an chrooting in the system to rebuild the kernel - same error message.

Any ideas what I've done wrong?


Best regards

Offline

#2 2010-04-15 21:59:56

Ochi
Member
Registered: 2010-04-06
Posts: 51

Re: Encrypted root on software RAID with 2.6.33

What's your kernel line? Please note that, for encryption in general, the old style:

kernel /vmlinuz26 root=/dev/sda3 ro

...was deprecated in like 2.6.30 and might no longer work. Try the "cryptsetup=" argument instead:

kernel /vmlinuz26 cryptdevice=/dev/sda3:root root=/dev/mapper/root ro

For more info see http://wiki.archlinux.org/index.php/Sys … r_dm-crypt. I'm also using mdadm+encrypt and my kernel line in grub's menu.lst looks like this:

kernel /vmlinuz26 cryptdevice=/dev/md3:root root=/dev/mapper/root ro quiet

Let me know if this helps.

Offline

#3 2010-04-15 22:12:04

flo
Member
Registered: 2009-10-12
Posts: 6

Re: Encrypted root on software RAID with 2.6.33

Thanks for your reply. I've tried almost any combination I could think of:

kernel /vmlinuz26 cryptdevice=/dev/md2:root root=/dev/mapper/root md=2,/dev/sda3,/dev/sdb3
kernel /vmlinuz26 cryptdevice=/dev/md2:root root=/dev/mapper/root
kernel /vmlinuz26 root=/dev/mapper/root
kernel /vmlinuz26 root=/dev/md2

The hooks udev and mdadm run through, but when it comes to encrypt, the system drops to the recovery shell with the error mentioned above.

Any other ideas? smile

Offline

#4 2010-04-15 22:26:01

Ochi
Member
Registered: 2010-04-06
Posts: 51

Re: Encrypted root on software RAID with 2.6.33

Somehow I didn't realize the MD devices didn't assemble themselves correctly in the first place ^^

Are the MD devices correctly specified in /etc/mdadm.conf? I think the current mdadm hook (in contrast to the old style hook) uses this config file while mkinitcpio'ing to assemble the devices at startup. You can create it automatically by doing something like

mdadm --detail --scan > /etc/mdadm.conf

After that, run mkinitcpio again like for example

mkinitcpio -p kernel26

Last edited by Ochi (2010-04-15 22:26:52)

Offline

#5 2010-04-20 21:31:33

flo
Member
Registered: 2009-10-12
Posts: 6

Re: Encrypted root on software RAID with 2.6.33

I've already done and rechecked that. The mdadm.conf file looks fine to me.

Do I have to specify the path to this config file anywhere?
I guess not, but I've got no idea what else could be wrong ...

Offline

#6 2010-04-20 21:59:37

Ochi
Member
Registered: 2010-04-06
Posts: 51

Re: Encrypted root on software RAID with 2.6.33

flo wrote:

Do I have to specify the path to this config file anywhere?

Hm, I don't think so... mkinitcpio should (automatically) tell you something like "Using /etc/mdadm.conf for assembing arrays..." while building the image. If it doesn't, there's something wrong.

I'm kinda running out of ideas... Maybe paste the relevant parts of menu.lst, mdadm.conf, rc.conf, mkinitcpio.conf here for inspiration... ^^

Offline

#7 2010-04-20 22:11:37

lilsirecho
Veteran
Registered: 2003-10-24
Posts: 5,000

Re: Encrypted root on software RAID with 2.6.33

Perhaps the mix of dm-mod and mdadm is the cause of the difficulty.

When using mdadm for a raid0 in my machine, the assembly of the raid md0 is made during initrd.  A statement for md0 and its 2 drives appears during boot-up.

The initial creation in the system establishes the raid drives by uuid.

The setup of /etc/mdadm.conf is as follows:

mdadm -D --scan >>/etc/mdadm.conf

This is followed by:

mkinitcpio -p kernel26

This sets up initrd to recognize the raid drives by uuid.

ochi:  His reference has the slight error of only one > in the code.

I do not know the need for dm-mod in setting up mdadm raid arrays.

Something new happens every day wioth arch!!!

EDIT: One afterthought...you may have more than one raid array in mdadm.conf for some reason! (maybe dm-mod?)

Last edited by lilsirecho (2010-04-20 22:13:53)


Prediction...This year will be a very odd year!
Hard work does not kill people but why risk it: Charlie Mccarthy
A man is not complete until he is married..then..he is finished.
When ALL is lost, what can be found? Even bytes get lonely for a little bit!     X-ray confirms Iam spineless!

Offline

#8 2010-04-21 18:42:53

flo
Member
Registered: 2009-10-12
Posts: 6

Re: Encrypted root on software RAID with 2.6.33

I just checked my mdadm.conf again and compared it with the commands listed here and on the wiki-page.

# cat /etc/mdadm.conf
ARRAY /dev/md0 level=raid1 num-devices=2 metadata=0.90 UUID=13db5ec4:4d02ad99:5be3d20e:87599807
ARRAY /dev/md1 level=raid1 num-devices=2 metadata=0.90 UUID=dda2a7de:a998f117:3f649c17:a7325bd1
ARRAY /dev/md2 level=raid1 num-devices=2 metadata=0.90 UUID=26a15bc5:2345a817:f8c460fb:3d47969b
ARRAY /dev/md3 level=raid1 num-devices=2 metadata=0.90 UUID=be48517f:ebc6eabb:f8463e19:ac167733
# mdadm -D --scan
ARRAY /dev/md0 metadata=0.90 UUID=13db5ec4:4d02ad99:5be3d20e:87599807
ARRAY /dev/md1 metadata=0.90 UUID=dda2a7de:a998f117:3f649c17:a7325bd1
ARRAY /dev/md2 metadata=0.90 UUID=26a15bc5:2345a817:f8c460fb:3d47969b
ARRAY /dev/md3 metadata=0.90 UUID=be48517f:ebc6eabb:f8463e19:ac167733
# mdadm --detail --scan
ARRAY /dev/md0 metadata=0.90 UUID=13db5ec4:4d02ad99:5be3d20e:87599807
ARRAY /dev/md1 metadata=0.90 UUID=dda2a7de:a998f117:3f649c17:a7325bd1
ARRAY /dev/md2 metadata=0.90 UUID=26a15bc5:2345a817:f8c460fb:3d47969b
ARRAY /dev/md3 metadata=0.90 UUID=be48517f:ebc6eabb:f8463e19:ac167733

I'm going to change this and rebuild the kernel image.
Don't know where the difference comes from :/
Okay - the difference comes from running the command in the arch livecd system and in the chrooted environment
But both somehow don't seem to work for me.

When running "mkinitcpio -p kernel26", this is the output:

==> Building image "default"
==> Running command: /sbin/mkinitcpio -k 2.6.33-ARCH -c /etc/mkinitcpio.conf -g /boot/kernel26.img
:: Begin build
:: Parsing hook [base]
:: Parsing hook [udev]
:: Parsing hook [autodetect]
find: "/sys/devices/": Datei oder Verzeichnis nicht gefunden
:: Parsing hook [sata]
:: Parsing hook [mdadm]
Custom /etc/mdadm.conf file will be used in initramfs for assembling arrays.
:: Parsing hook [usbinput]
:: Parsing hook [encrypt]
:: Parsing hook [filesystems]
:: Generating module dependencies
:: Generating image '/boot/kernel26.img'...SUCCESS
==> SUCCESS

So /etc/mdadm.conf should be used?

lilsirecho wrote:

When using mdadm for a raid0 in my machine, the assembly of the raid md0 is made during initrd.  A statement for md0 and its 2 drives appears during boot-up.

I can't see any statement about creating any of my mdX devices.
It's just

Running Hook [udev]
Triggering udev uevents ... done 
Running hook [mdadm]
Running hook [enrypt]
Waiting 10 seconds for device /dev/md2 ... 
Waiting 10 seconds for device /dev/mapper/root ...
Root device '/dev/mapper/root' doesn't exist. Attempting to create it.
ERROR: Unable to determine majo/minor number of root device '/dev/mapper/root'.
You are being dropped to a recovery shell
...

Last edited by flo (2010-04-21 19:25:03)

Offline

#9 2010-04-21 19:51:58

lilsirecho
Veteran
Registered: 2003-10-24
Posts: 5,000

Re: Encrypted root on software RAID with 2.6.33

In my case, raid0 is not used for boot nor root but is just a package repo and video repo.

I do not have dm-mod involved.  I believe that is needed for some versions of raid devices but am not an expert on dm-mod.

Your system seems to need dm-mod since it is noted during boot sequence.

Perhaps another user can elucidate........................


Prediction...This year will be a very odd year!
Hard work does not kill people but why risk it: Charlie Mccarthy
A man is not complete until he is married..then..he is finished.
When ALL is lost, what can be found? Even bytes get lonely for a little bit!     X-ray confirms Iam spineless!

Offline

#10 2010-04-21 20:03:42

lilsirecho
Veteran
Registered: 2003-10-24
Posts: 5,000

Re: Encrypted root on software RAID with 2.6.33

Look into FS#18348 for some info on recent mkinitcpio problems with raid.


Prediction...This year will be a very odd year!
Hard work does not kill people but why risk it: Charlie Mccarthy
A man is not complete until he is married..then..he is finished.
When ALL is lost, what can be found? Even bytes get lonely for a little bit!     X-ray confirms Iam spineless!

Offline

#11 2010-05-12 23:49:50

DREMA
Member
From: México
Registered: 2009-03-09
Posts: 15

Re: Encrypted root on software RAID with 2.6.33

I got exactly this problem again, any more clues?


Just... enjoy life! big_smile

Offline

#12 2010-05-13 16:10:37

saharchie
Member
Registered: 2008-09-17
Posts: 20

Re: Encrypted root on software RAID with 2.6.33

flo wrote:

...Do I have to specify the path to this config file anywhere?
...

yes you can in mkinitcpio.conf

# FILES
# This setting is similar to BINARIES above, however, files are added
# as-is and are not parsed in anyway.  This is useful for config files.
# Some users may wish to include modprobe.conf for custom module options,
# like so:
#    FILES="/etc/modprobe.conf"
FILES="/etc/mdadm.conf"
/sbin/mkinitcpio -p kernel26

will successfully build and say that /etc/mdadm.conf is being used whether it is explicitly added or not.

I add it as a 'just in case' ... along with chipset, dm-mod & raid modules.

=]

Offline

Board footer

Powered by FluxBB