LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware (https://www.linuxquestions.org/questions/slackware-14/)
-   -   Slackware64 14.1 : kernel panic using RAID (https://www.linuxquestions.org/questions/slackware-14/slackware64-14-1-kernel-panic-using-raid-4175488307/)

kikinovak 12-17-2013 11:12 AM

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
ash: write error: Invalid argument
mount: mounting /dev/md3 on /mnt failed: No such file or directory

I have been trying this now for the fourth time, to no avail. With Slackware 14.0, I could setup RAID 1 and RAID 5 almost with my eyes closed.

I am completely clueless here. Any suggestions ?

Niki

kikinovak 12-17-2013 12:11 PM

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.

saxa 12-17-2013 12:32 PM

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.

tux_dude 12-17-2013 05:20 PM

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.

kikinovak 12-18-2013 01:46 AM

Quote:

Originally Posted by tux_dude (Post 5082764)
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.

Funny thing, I don't have this option... and my RAID setup works.

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

kikinovak 12-18-2013 05:03 AM

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"
CLEAR_TREE="1"
OUTPUT_IMAGE="/boot/initrd.gz"
#KERNEL_VERSION="$(uname -r)"
KERNEL_VERSION="3.2.45"
KEYMAP="fr_CH-latin1"
MODULE_LIST="ext4:usb-storage:ehci-hcd:usbhid"
ROOTDEV="/dev/md3"
ROOTFS="ext4"
RESUMEDEV="/dev/md2"
RAID="1"
LVM="0"
UDEV="1"
MODCONF="0"
WAIT="1"

Any idea why this sort of configuration wouldn't work on Slackware 14.1?

Richard Cranium 12-18-2013 07:57 PM

Quote:

Originally Posted by kikinovak (Post 5082497)
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
ash: write error: Invalid argument
mount: mounting /dev/md3 on /mnt failed: No such file or directory

I have been trying this now for the fourth time, to no avail. With Slackware 14.0, I could setup RAID 1 and RAID 5 almost with my eyes closed.

I am completely clueless here. Any suggestions ?

Niki

What is in /boot/initrd-tree/etc/mdadm.conf?

Richard Cranium 12-19-2013 05:39 PM

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....

WiseDraco 01-07-2014 12:49 AM

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?

WiseDraco 01-07-2014 01:53 AM

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...

Richard Cranium 01-07-2014 02:28 AM

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
    # If /etc/mdadm.conf is present, udev should DTRT on its own;
    # If not, we'll make one and go from there:
    if [ ! -r /etc/mdadm.conf ]; then
      /sbin/mdadm -E -s >/etc/mdadm.conf
      /sbin/mdadm -S -s
      /sbin/mdadm -A -s
      # This seems to make the kernel see partitions more reliably:
      fdisk -l /dev/md* 1> /dev/null 2> /dev/null
    fi
  fi

...and I've marked the important comment in bold.

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:
  1. Edit /etc/mdadm.conf to contain the information required to create your RAID arrays or
  2. Delete /etc/mdadm.conf or rename it to some other name.

WiseDraco 01-07-2014 03:09 AM

Thank you very much for situation clarification :)
now i understand that side a bit better than previously

WiseDraco 01-14-2014 07:25 AM

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...?

Richard Cranium 01-14-2014 09:03 AM

Try this:
  1. Boot into your system using the huge kernel.
  2. run the following command as root
    Code:

    mdadm -E -s > /boot/initrd-tree/etc/mdadm.conf
  3. run the following command as root
    Code:

    mkinitrd -o /boot/initrd.gz
  4. reboot and try using the generic kernel

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.

WiseDraco 01-15-2014 07:04 AM

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.