LinuxQuestions.org
LinuxAnswers - the LQ Linux tutorial section.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices

Reply
 
Search this Thread
Old 12-17-2013, 11:12 AM   #1
kikinovak
Senior Member
 
Registered: Jun 2011
Location: Montpezat (South France)
Distribution: ElementaryOS, Ubuntu LTS, Slackware
Posts: 1,549

Rep: Reputation: 721Reputation: 721Reputation: 721Reputation: 721Reputation: 721Reputation: 721Reputation: 721
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
 
Old 12-17-2013, 12:11 PM   #2
kikinovak
Senior Member
 
Registered: Jun 2011
Location: Montpezat (South France)
Distribution: ElementaryOS, Ubuntu LTS, Slackware
Posts: 1,549

Original Poster
Rep: Reputation: 721Reputation: 721Reputation: 721Reputation: 721Reputation: 721Reputation: 721Reputation: 721
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.
 
Old 12-17-2013, 12:32 PM   #3
saxa
Member
 
Registered: Aug 2004
Posts: 273

Rep: Reputation: 12
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.
 
Old 12-17-2013, 05:20 PM   #4
tux_dude
Member
 
Registered: Dec 2008
Distribution: Slackware64 Current
Posts: 226

Rep: Reputation: 33
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.
 
Old 12-18-2013, 01:46 AM   #5
kikinovak
Senior Member
 
Registered: Jun 2011
Location: Montpezat (South France)
Distribution: ElementaryOS, Ubuntu LTS, Slackware
Posts: 1,549

Original Poster
Rep: Reputation: 721Reputation: 721Reputation: 721Reputation: 721Reputation: 721Reputation: 721Reputation: 721
Quote:
Originally Posted by tux_dude View Post
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
 
Old 12-18-2013, 05:03 AM   #6
kikinovak
Senior Member
 
Registered: Jun 2011
Location: Montpezat (South France)
Distribution: ElementaryOS, Ubuntu LTS, Slackware
Posts: 1,549

Original Poster
Rep: Reputation: 721Reputation: 721Reputation: 721Reputation: 721Reputation: 721Reputation: 721Reputation: 721
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?
 
Old 12-18-2013, 07:57 PM   #7
Richard Cranium
Senior Member
 
Registered: Apr 2009
Location: Carrollton, Texas
Distribution: Slackware64 14.1
Posts: 1,482

Rep: Reputation: 420Reputation: 420Reputation: 420Reputation: 420Reputation: 420
Quote:
Originally Posted by kikinovak View Post
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?
 
Old 12-19-2013, 05:39 PM   #8
Richard Cranium
Senior Member
 
Registered: Apr 2009
Location: Carrollton, Texas
Distribution: Slackware64 14.1
Posts: 1,482

Rep: Reputation: 420Reputation: 420Reputation: 420Reputation: 420Reputation: 420
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....
 
Old 01-07-2014, 12:49 AM   #9
WiseDraco
Member
 
Registered: Nov 2006
Location: Europe,Latvia,Riga
Distribution: slackware,slax, exMandriva
Posts: 379

Rep: Reputation: 30
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?
 
Old 01-07-2014, 01:53 AM   #10
WiseDraco
Member
 
Registered: Nov 2006
Location: Europe,Latvia,Riga
Distribution: slackware,slax, exMandriva
Posts: 379

Rep: Reputation: 30
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...
 
Old 01-07-2014, 02:28 AM   #11
Richard Cranium
Senior Member
 
Registered: Apr 2009
Location: Carrollton, Texas
Distribution: Slackware64 14.1
Posts: 1,482

Rep: Reputation: 420Reputation: 420Reputation: 420Reputation: 420Reputation: 420
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.
 
2 members found this post helpful.
Old 01-07-2014, 03:09 AM   #12
WiseDraco
Member
 
Registered: Nov 2006
Location: Europe,Latvia,Riga
Distribution: slackware,slax, exMandriva
Posts: 379

Rep: Reputation: 30
Thank you very much for situation clarification
now i understand that side a bit better than previously
 
Old 01-14-2014, 07:25 AM   #13
WiseDraco
Member
 
Registered: Nov 2006
Location: Europe,Latvia,Riga
Distribution: slackware,slax, exMandriva
Posts: 379

Rep: Reputation: 30
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...?
 
Old 01-14-2014, 09:03 AM   #14
Richard Cranium
Senior Member
 
Registered: Apr 2009
Location: Carrollton, Texas
Distribution: Slackware64 14.1
Posts: 1,482

Rep: Reputation: 420Reputation: 420Reputation: 420Reputation: 420Reputation: 420
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.
 
1 members found this post helpful.
Old 01-15-2014, 07:04 AM   #15
WiseDraco
Member
 
Registered: Nov 2006
Location: Europe,Latvia,Riga
Distribution: slackware,slax, exMandriva
Posts: 379

Rep: Reputation: 30
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...
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
kernel panic Slackware64-14.1 Jeebizz Slackware 2 11-08-2013 01:50 PM
Kernel panic after upgrading slackware64-current to 2.6.32.x kernel Lenard Spencer Slackware 4 01-22-2010 10:54 AM
Kernel Panic: Booting into RAID 1 elliotfuller Linux - Hardware 0 09-07-2005 02:01 AM
Kernel panic - HPT366 RAID breenbaron Linux - Hardware 14 10-07-2004 03:20 PM
Kernel 2.6, RAID-1 & reiserfs kernel panic Raptor Ramjet Slackware 2 01-04-2004 07:25 AM


All times are GMT -5. The time now is 10:43 PM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration