LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
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 01-25-2015, 04:29 PM   #1
Eeel
Member
 
Registered: Feb 2012
Location: EU
Distribution: Slackware 15 and current
Posts: 94

Rep: Reputation: Disabled
Slackware 14.1 raid install Kernel Panic


Hello,

I'm having a Kernel Panic on reboot after installed Slackware 14.1 on two sata drive with Raid 1 and 5, this is exactly what i have done:

Run Slackware 14.1 64bit install from USB, partitioning with cfdisk:

Code:
/boot	100Mo	sda1	DA	RAID 1	md3	
/	25Go	sda2	DA	RAID 5	md0
/home	50G	sda3	DA	RAID 5	md1
swap	4Go	sda4	DA	RAID 1	md2
free	~100mo

partition type DA
Duplicate partition to second 80Go drive with sfdisk:

Code:
sfdisk -d /dev/sda | sfdisk /dev/sdb
Create new array with mdadm:

Code:
/:	mdadm --create /dev/md0 --level 5 --raid-devices 2 /dev/sda2 /dev/sdb2 --metadata=1.2
/home:	mdadm --create /dev/md1 --level 5 --raid-devices 2 /dev/sda3 /dev/sdb3 --metadata=1.2
swap:	mdadm --create /dev/md2 --level 1 --raid-devices 2 /dev/sda4 /dev/sdb4 --metadata=1.2
/boot:	mdadm --create /dev/md3 --level 1 --raid-devices 2 /dev/sda1 /dev/sdb1 --metadata=0.90
Format swap partition with mkswap:

Code:
mkswap -f /dev/md2
Format other array with mkfs:

Code:
mkfs.ext4 /dev/md0
mkfs.ext4 /dev/md1
mkfs.ext4 /dev/md3
Install Slackware using "setup":

- Install LILO "simple" setup
- OS/2 Boot Manager found: NO
- Additional append parameter: root=/dev/md0
- Install LILO in MBR
- EXIT setup

Switch to installation directory with chroot:

Code:
chroot /mnt/
Edit lilo.conf:

Code:
# Start LILO global section
raid-extra-boot = mbr-only
# Append any additional kernel parameters:
append="root=/dev/md0 vt.default_utf8=0"
boot = /dev/md3

# End LILO global section
# Linux bootable partition config begins
image = /boot/vmlinuz
  initrd = /boot/initrd.gz
  root = /dev/md0
  label = Linux
  read-only
# Linux bootable partition config ends
Using the Generic Kernel or huge kernel result the same error, generic kernel:

Code:
 - cd /boot
 - rm vmlinuz System.map config
 - ln -s vmlinuz-generic-*     vmlinuz
 - ln -s System.map-generic-*  System.map
 - ln -s config-generic-*      config
huge kernel(i use this setup with previous Slackware 14):

Code:
 - cd /boot
 - rm vmlinuz System.map config
 - ln -s vmlinuz-huge-*     vmlinuz
 - ln -s System.map-huge-*  System.map
 - ln -s config-huge-*      config
Create mkinitrd.conf:

Code:
cp /etc/mkinitrd.conf.sample /etc/mkinitrd.conf
Edit mkinitrd.conf:

Code:
# mkinitrd.conf.sample
# See "man mkinitrd.conf" for details on the syntax of this file
#
SOURCE_TREE="/boot/initrd-tree"
#CLEAR_TREE="0"
OUTPUT_IMAGE="/boot/initrd.gz"
KERNEL_VERSION="$(uname -r)"
KEYMAP="fr"
MODULE_LIST="mbcache:jbd2:ext4"
#LUKSDEV="/dev/sda2"
ROOTDEV="/dev/md0"
ROOTFS="ext4"
#RESUMEDEV="/dev/sda2"
RAID="1"
#LVM="1"
#UDEV="1"
#MODCONF="0"
#WAIT="1"
i also have tested to create mkinitrd.conf with the following command:

Code:
/usr/share/mkinitrd/mkinitrd_command_generator.sh > /etc/mkinitrd.conf
Create the initrd with mkinitrd:

Code:
mkinitrd -F
Run Lilo:
Code:
lilo
Declare email and Raid array in /etc/mdadm.conf:
Code:
echo MAILADDR my-mail@somewhere.com >> /etc/mdadm.conf
mdadm -Es >> /etc/mdadm.conf
I have attached the screenshot of kernel Panic error, i continue to search on google with various quote of the error message, help appreciated
Attached Thumbnails
Click image for larger version

Name:	image.jpg
Views:	81
Size:	273.1 KB
ID:	17440  

Last edited by Eeel; 01-28-2015 at 12:37 PM. Reason: solved
 
Old 01-25-2015, 06:09 PM   #2
Richard Cranium
Senior Member
 
Registered: Apr 2009
Location: McKinney, Texas
Distribution: Slackware64 15.0
Posts: 3,858

Rep: Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225
Re-run mkinitrd and lilo now that you've initialized /etc/mdadm.conf with the current configuration.

The default /etc/mdadm.conf contains nothing but comments. The init script in the initrd does...
Code:
  # Initialize RAID:
  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
...which means that udev will mount the software RAID devices with names such as /dev/md128 versus what you chose.

If you *don't* have an /etc/mdadm.conf file in your initrd, the above code will force a rescan of the RAID devices. If you have a correct /etc/mdadm.conf, udev will get it right the first time it sees the drives.

Last edited by Richard Cranium; 01-25-2015 at 06:10 PM. Reason: Clarified first line.
 
Old 01-26-2015, 02:58 AM   #3
Eeel
Member
 
Registered: Feb 2012
Location: EU
Distribution: Slackware 15 and current
Posts: 94

Original Poster
Rep: Reputation: Disabled
Hello Richard,

Thanks for your answer, i'm at work at the moment, will be able to test in ~10 hours

From what i know i have things written in /etc/mdadm.conf and same in the /boot/initrd-tree/etc/mdadm.conf, my mdamdm.conf contain my 4 ARRAY and my mail, after reading a thread yesterday about the md128 and md129 problem, i also added 4 more lines, one for each md* (i don't remember the exact syntaxe i have used but it was something like that):

Code:
ARRAY /dev/md0 devices=sda2,sdb2
ARRAY /dev/md1 devices=sda3,sdb3
....
While i was doing some various test yesterday i have re run several time the mkinirtd -F and lilo commands with a mdadm.conf file containing my 4 ARRAYS.


Just to be shure i'm not misunderstanding:
Quote:
Originally Posted by Richard Cranium View Post
The default /etc/mdadm.conf contains nothing but comments. The init script in the initrd does...

If you *don't* have an /etc/mdadm.conf file in your initrd
the initrd you are talking is the inird-tree or the initrd.gz file?
 
Old 01-26-2015, 07:36 AM   #4
Richard Cranium
Senior Member
 
Registered: Apr 2009
Location: McKinney, Texas
Distribution: Slackware64 15.0
Posts: 3,858

Rep: Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225
Quote:
Originally Posted by Eeel View Post
Hello Richard,

Thanks for your answer, i'm at work at the moment, will be able to test in ~10 hours

From what i know i have things written in /etc/mdadm.conf and same in the /boot/initrd-tree/etc/mdadm.conf, my mdamdm.conf contain my 4 ARRAY and my mail, after reading a thread yesterday about the md128 and md129 problem, i also added 4 more lines, one for each md* (i don't remember the exact syntaxe i have used but it was something like that):

Code:
ARRAY /dev/md0 devices=sda2,sdb2
ARRAY /dev/md1 devices=sda3,sdb3
....
While i was doing some various test yesterday i have re run several time the mkinirtd -F and lilo commands with a mdadm.conf file containing my 4 ARRAYS.


Just to be shure i'm not misunderstanding:


the initrd you are talking is the inird-tree or the initrd.gz file?
They are the same. initrd.gz is built from the contents of /boot/initrd-tree. Take a look at /boot/init-tree/etc/mdadm.conf; it should match the one you have on the root file system or not exist at all for this stuff to work.

FWIW, my /etc/mdadm.conf looks like...

Code:
ARRAY /dev/md/2  metadata=1.2 UUID=77c6da43:3f4dc424:53420c4e:5806e34c name=darkstar:2
ARRAY /dev/md/0  metadata=1.2 UUID=c7868644:607a78cc:c2458ba0:0bd9416b name=darkstar:0 spares=1
ARRAY /dev/md/1  metadata=1.2 UUID=b5f4c53c:27ea290e:b00a2908:b621ba08 name=darkstar:1
 
Old 01-26-2015, 08:38 AM   #5
Eeel
Member
 
Registered: Feb 2012
Location: EU
Distribution: Slackware 15 and current
Posts: 94

Original Poster
Rep: Reputation: Disabled
Thanks Richard, i will soon be able to do further test and give some feedback
 
Old 01-26-2015, 02:47 PM   #6
Eeel
Member
 
Registered: Feb 2012
Location: EU
Distribution: Slackware 15 and current
Posts: 94

Original Poster
Rep: Reputation: Disabled
This what i just tested:

- Boot the slackware install USB key
- re run SETUP to map partitions then EXIT
- chroot /mnt/
- Check my /etc/mdadm.conf (see attached screenshot), my ARRAYS are there, note that the ARRAY /dev/md3 have a different syntax doesn't seems to be a problem my Slackware 14.0 box have the same
- Check if i have same mdadm.conf in /boot/initrd-tree/etc Ok
- Re run Mkinitrd -F and lilo command, see attached screenshot, there is error here.

no luck i have the same Kernel panic
Attached Thumbnails
Click image for larger version

Name:	mdadm.conf.jpg
Views:	54
Size:	263.3 KB
ID:	17446   Click image for larger version

Name:	mkinitrd-lilo.jpg
Views:	61
Size:	262.2 KB
ID:	17447  
 
Old 01-26-2015, 03:35 PM   #7
j_v
Member
 
Registered: Oct 2011
Distribution: Slackware64
Posts: 364

Rep: Reputation: 67
One idea I have about this issue is that I've had issues with the naming of the raid drives to be off if the mdadm.conf wasn't included in the initrd.
 
Old 01-27-2015, 02:21 AM   #8
Eeel
Member
 
Registered: Feb 2012
Location: EU
Distribution: Slackware 15 and current
Posts: 94

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by j_v View Post
One idea I have about this issue is that I've had issues with the naming of the raid drives to be off if the mdadm.conf wasn't included in the initrd.
can you explain a little bit more your idea, i'm stuck, i have installed yesterday from scratch but no luck.
 
Old 01-27-2015, 03:23 AM   #9
Richard Cranium
Senior Member
 
Registered: Apr 2009
Location: McKinney, Texas
Distribution: Slackware64 15.0
Posts: 3,858

Rep: Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225
Quote:
Originally Posted by Eeel View Post
This what i just tested:

- Boot the slackware install USB key
- re run SETUP to map partitions then EXIT
- chroot /mnt/
- Check my /etc/mdadm.conf (see attached screenshot), my ARRAYS are there, note that the ARRAY /dev/md3 have a different syntax doesn't seems to be a problem my Slackware 14.0 box have the same
- Check if i have same mdadm.conf in /boot/initrd-tree/etc Ok
- Re run Mkinitrd -F and lilo command, see attached screenshot, there is error here.

no luck i have the same Kernel panic
Before you chroot /mnt, you should also do...
Code:
mount --bind /proc /mnt/proc
mount --bind /sys /mnt/sys
mount --bind /run /mnt/run
mount --bind /dev /mnt/dev
How about renaming /boot/initrd-tree/etc/mdadm.conf to /boot/initrd-tree/etc/mdadm-nouse.conf, re-run the mkinitrd command with no parameters, and then lilo. Reboot.

The initrd init script should be able to find your raid arrays by itself. Give it a shot.
 
1 members found this post helpful.
Old 01-27-2015, 06:19 AM   #10
Labinnah
Member
 
Registered: May 2014
Location: Łódź, Poland
Distribution: Slackware-current
Posts: 185

Rep: Reputation: 112Reputation: 112
Use UUID instead of /dev/mdX in /etc/fstab. You can use it also in /etc/lilo.conf.

I found, that some kernels (for sure 3.14) have problem with RAID naming. I have /dev/md127 and /dev/md126 despite they are named differently in my /etc/mdadm.conf.
 
Old 01-27-2015, 03:36 PM   #11
Eeel
Member
 
Registered: Feb 2012
Location: EU
Distribution: Slackware 15 and current
Posts: 94

Original Poster
Rep: Reputation: Disabled
Hi all,

Good news it work, thank you all for suggestion and help, atm i don't really know where was the problem, i will check tomorrow to re create the error.
 
Old 01-27-2015, 03:54 PM   #12
j_v
Member
 
Registered: Oct 2011
Distribution: Slackware64
Posts: 364

Rep: Reputation: 67
Glad to hear you have success. Hope you discover the origin of the problem, as I think this would be a big help for others who boot to raid drives.
 
Old 01-27-2015, 05:50 PM   #13
kikinovak
MLED Founder
 
Registered: Jun 2011
Location: Montpezat (South France)
Distribution: CentOS, OpenSUSE
Posts: 3,453

Rep: Reputation: 2154Reputation: 2154Reputation: 2154Reputation: 2154Reputation: 2154Reputation: 2154Reputation: 2154Reputation: 2154Reputation: 2154Reputation: 2154Reputation: 2154
Quote:
Originally Posted by Eeel View Post
Hi all,

Good news it work, thank you all for suggestion and help, atm i don't really know where was the problem, i will check tomorrow to re create the error.
I do know. Two things.

1. Wait until your disks are in sync. Keep an eye on them like this:

Code:
# watch cat /proc/mdstat
2. You have to invoke mdadm -E -s > /etc/mdadm.conf before building your initrd, not after.

3. Extra hint. You can speed up the sync process significantly with this little trick:

Code:
# echo 50000 > /proc/sys/dev/raid/speed_limit_min
Whole process for RAID 1 and RAID 5 is documented here:

http://www.microlinux.fr/slackware/L...rver-HOWTO.txt

Cheers,

Niki

Last edited by kikinovak; 01-27-2015 at 05:53 PM.
 
2 members found this post helpful.
Old 01-27-2015, 08:36 PM   #14
Richard Cranium
Senior Member
 
Registered: Apr 2009
Location: McKinney, Texas
Distribution: Slackware64 15.0
Posts: 3,858

Rep: Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225
Quote:
Originally Posted by kikinovak View Post
2. You have to invoke mdadm -E -s > /etc/mdadm.conf before building your initrd, not after.
Or remove mdadm.conf from your initrd. The init script in the initrd will make a new one at boot.
 
Old 01-28-2015, 12:37 PM   #15
Eeel
Member
 
Registered: Feb 2012
Location: EU
Distribution: Slackware 15 and current
Posts: 94

Original Poster
Rep: Reputation: Disabled
I haven't been able to reproduce the error today, i started a complete installation except that i didn't remove all partitions with cfdisk before installation. For me the only difference in the installation of yesterday that finally work was the two things Kikinova point:

1. Wait until your disks are in sync. Keep an eye on them like this:
Code:
watch cat /proc/mdstat
2. You have to invoke mdadm -E -s > /etc/mdadm.conf before building your initrd, not after.

Many thanks all for help. And as someone suggest in this forum that i don't remember the name i have made a donation equal to the price of the Slackware 14.1 DvD since i'm now using it



For anyone interested this is exactly the steps that i have followed.


Run Slackware 14.1 64 bit install from USB, partitioning with cfdisk:

Code:
/boot	100Mo	sda1	DA	RAID 1	md3	
/	25Go	sda2	DA	RAID 5	md0
/home	50G	sda3	DA	RAID 5	md1
swap	4Go	sda4	DA	RAID 1	md2
free	~100mo

partition type DA
Duplicate partition to second 80Go drive with sfdisk:
Code:
sfdisk -d /dev/sda | sfdisk /dev/sdb
Stop eventually old raid array from previous install with mdadm:

- see wich "mdx" array may be up from a previous install
Code:
cat /proc/mdstat
- stop old "mdx" array with mdadm:
Code:
mdadm --stop /dev/mdx
Create new array with mdadm:
Code:
/:	mdadm --create /dev/md0 --level 5 --raid-devices 2 /dev/sda2 /dev/sdb2 --metadata=1.2
/home:	mdadm --create /dev/md1 --level 5 --raid-devices 2 /dev/sda3 /dev/sdb3 --metadata=1.2
swap:	mdadm --create /dev/md2 --level 1 --raid-devices 2 /dev/sda4 /dev/sdb4 --metadata=1.2
/boot:	mdadm --create /dev/md3 --level 1 --raid-devices 2 /dev/sda1 /dev/sdb1 --metadata=0.90
Wait until your disks are in sync. Keep an eye on them like this (thx Kikinovak):
Code:
watch cat /proc/mdstat
Format swap partition with mkswap:
Code:
mkswap -f /dev/md2
Format other array with mkfs:
Code:
mkfs.ext4 /dev/md0
mkfs.ext4 /dev/md1
mkfs.ext4 /dev/md3
Install Slackware using "setup":

- Install LILO "simple" setup
- Additional append parameter: root=/dev/md0
- Install LILO in MBR
- EXIT setup

Switch to installation directory with chroot:
Code:
chroot /mnt/
Edit lilo.conf:
Code:
# Start LILO global section
raid-extra-boot = mbr-only
# Append any additional kernel parameters:
append="root=/dev/md0 vt.default_utf8=0"
boot = /dev/md3

# End LILO global section
# Linux bootable partition config begins
image = /boot/vmlinuz
  initrd = /boot/initrd.gz
  root = /dev/md0
  label = Linux
  read-only
# Linux bootable partition config ends
Declare email and Raid array in /etc/mdadm.conf:
Code:
echo MAILADDR my-mail@somewhere.com >> /etc/mdadm.conf
mdadm -Es >> /etc/mdadm.conf
Create mkinitrd.conf:
Code:
cp /etc/mkinitrd.conf.sample /etc/mkinitrd.conf
Edit mkinitrd.conf:
Code:
# mkinitrd.conf.sample
# See "man mkinitrd.conf" for details on the syntax of this file
#
SOURCE_TREE="/boot/initrd-tree"
#CLEAR_TREE="0"
OUTPUT_IMAGE="/boot/initrd.gz"
KERNEL_VERSION="$(uname -r)"
KEYMAP="us"
MODULE_LIST="ext4"
#LUKSDEV="/dev/sda2"
ROOTDEV="/dev/md0"
ROOTFS="ext4"
#RESUMEDEV="/dev/sda2"
RAID="1"
#LVM="1"
#UDEV="1"
#MODCONF="0"
#WAIT="1"
Create the initrd with mkinitrd:
Code:
mkinitrd -F
Run Lilo:
Code:
lilo
Exit chroot
Code:
exit
reboot computer

Last edited by Eeel; 01-28-2015 at 12:39 PM.
 
2 members found this post helpful.
  


Reply



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
Slackware 12.0 install DVD kernel panic ??? milanbankovic Slackware - Installation 2 07-15-2007 04:36 PM
Kernel Panic (no initrd) after Slackware 10.1 Install kinadian Slackware 3 08-14-2006 07:37 PM
Slackware install Kernel panic neilcpp Slackware 2 01-27-2004 09:07 PM
Slackware Install> kernel panic andrew001 Slackware 14 12-29-2002 11:43 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 05:04 PM.

Main Menu
Advertisement
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
Open Source Consulting | Domain Registration