Slackware64 14.1 : kernel panic using RAID
Hi,
Something must have changed in Slackware 14.1 and RAID. I am just pulling my hair out trying to setup a simple RAID 1 array. I must have done this a few dozen times on Slackware 14.0. Now on Slackware 14.1, I am just getting kernel panics on rebooting. Code:
ls: /dev/md2: No such file or directory I am completely clueless here. Any suggestions ? Niki |
Phew. Looks like I found the solution. Until now, I always edited /etc/mkinitrd.conf by hand. Now I simply redirected mkinitrd_command_generator.sh output to the file. So I guess some vital component must have been missing in my initrd. Though I still have to find out which one.
|
Here it worked out of the box without problems on 14.1. Although I have no idea on what could get wrong with your setup.
|
The shipped kernel in 14.1 requires the LVM (-L) option in the mkinitrd command in order to boot from RAID. IIRC, the switch was made in 3.7.x.
|
Quote:
Code:
mkinitrd -c -k 3.10.17 -f ext4 -r /dev/md3 -m usb-storage:ehci-hcd:ehci-pci:usbhid:hid_generic:ohci-hcd:mbcache:jbd2:ext4 -R -u -o /boot/initrd.gz |
Here's the mkinitrd.conf setup on my office server (HP Proliant ML40) with a RAID 5 setup, still running Slackware64 14.0:
Code:
SOURCE_TREE="/boot/initrd-tree" |
Quote:
|
Start reading from here.
The short version is that unless your initrd has something useful in its /etc/mdadm.conf, then udevd will start up your raid arrays using device names such as md127, md128, and so on. If your initrd doesn't have an /etc/mdadm.conf file at all (or it isn't readable), then the boot process will scan the disks for metadata and use that to start your arrays. Lvm on top of RAID will still work since the lvm code looks for metadata in each device and doesn't really care what the device is currently named. But if you are looking to mount /dev/md2 and udevd decided to call it /dev/md128.... |
interesting thread.
yesterday i try install slack64 14.1 on two sata discs in raid1 mode, and got a problem. i installing on that guide: https://sites.google.com/site/pincza...at-4kb-sectors on creation process i try mdadm --create /dev/md1 --level 1 --raid-devices 2 /dev/sda1 /dev/sdb1 on that i got a message, i cannot boot from that raid, and for i can boot i must add "--metadata=0.90" as so i add that metadata 0.90 for my first, system \ bootable partition, but for two anothers ( sda2 / sdb2 as md2 - swap, and sda3 / sdb3 as md3 - second, backup partitionas /second) - not, because i not need boot from this and so on. now, after installing slack, and reboot i have mounted only md1. swap not working, and /second also not mounted. in logs i see texts about md127 and md128. what i must do now, for get md2 and md3? and why that situation appear? |
looks like, that is a easy solving problem.
add to /etc/mdadm.conf array /dev/md2 devices=/dev/sda2,/dev/sdb2 and so on, and all works ok. on another hand - as i remember, on slack 14.0 and when on all creating arrays i use "metadata=0.90", all volumes mounted withjout making changes in mdadm,conf... |
The other solution is to remove the file /etc/mdadm.conf from your initrd image.
The init code in initrd.gz contains... Code:
if [ -x /sbin/mdadm ]; then In Slackware 14.1, mkinitrd copies whatever you have in /etc/mdadm.conf into your initrd. When you install the mdadm package, you get a readable /etc/mdadm.conf that contains only comments and that is what is copied into your initrd. Since it only contains comments, udev does not know the correct device names to use. If /etc/mdadm.conf did not exist in your initrd image, the init script will look at the RAID array metadata and create a correct /etc/mdadm.conf for you. So after an initial install you must do one of two things if you intend to use software RAID prior to creating your initrd image:
|
Thank you very much for situation clarification :)
now i understand that side a bit better than previously |
get a problems with my new installation:
slackware64 14.1, raid1 on two discs, maked based on instructions https://sites.google.com/site/pincza...at-4kb-sectors all be ok, until i try to make "using a generic kernel". i make additional entry in lilo.conf with old kernel ( default huge) for safety purposes, and make an "generic". run /usr/share/mkinitrd/mkinitrd_command_generator.sh then i do resulted command: mkinitrd -c -k 3.10.17 -f ext4 -r /dev/md1 -m mbcache:jbd2:ext4 -R -u -o /boot/initrd.gz after that i do lilo -v, and restart - and get unusable system: mounting /dev/md1 on /mnt failed: no such file or directory Error: no /sbin/init found on rootdev (or not mounted)/Trouble ahead. You can try to fix it. type "exit" when done /dev/md1 is my root partition ( /dev/sda1 / sdb1). when i reboot with old, huge kernel all boot and work ok - when on new with generic \ initrd, get that. try to remove /boot/initrd/etc/mdadm.conf - no changes...? |
Try this:
The command in bullet #2 should create a valid mdadm.conf file in your initrd-tree area. The command in bullet #3 should rebuild your initrd using only what is in your initrd-tree. Please let us know if that worked. If it doesn't work, please tell us what was put into /boot/initrd-tree/etc/mdadm.conf after you ran the command in bullet #2. |
thank you for input, but i already sort my problem out, when see your post.
the tale is that: i have on my mdadm.conf a two strings: ARRAY /dev/md2 devices=/dev/sda2,/dev/sdb2 ARRAY /dev/md3 devices=/dev/sda3,/dev/sdb3 the md2 is my swap partition, md3 is additional partition, mounted as /Second when i making raid ( raid 1 ), i make only md1 ( sda1 / sdb1) partition with --metadata=0.90, other two partition is maked without that string. but it all works good, and starting with no problems with default installed kernel. when i try install additional generic kernel with initrd in lilo.conf, i get a problem, who i describe earlier. make /boot/initrd/etc/mdadm.conf file unread, or delete it not solve problem, when /dev/md1 not mount at start. i try to add in mdadm.conf string for first partition - ARRAY /dev/md1 devices=/dev/sda1,/dev/sdb1, and after a rerun mkinitrd, and lilo -v, after reboot all works ok. for me is a bit strange, why in default boot, on huge lilo without initrd, md1 automatically mount ok, but with initrd and generic kernel not, but as now problem is solved, as so all be is good. thank you anyway... |
All times are GMT -5. The time now is 10:12 PM. |