Slackware This Forum is for the discussion of Slackware Linux.
|
Notices |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
|
|
12-17-2013, 12:12 PM
|
#1
|
MLED Founder
Registered: Jun 2011
Location: Montpezat (South France)
Distribution: CentOS, OpenSUSE
Posts: 3,453
|
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
|
|
|
12-17-2013, 01:11 PM
|
#2
|
MLED Founder
Registered: Jun 2011
Location: Montpezat (South France)
Distribution: CentOS, OpenSUSE
Posts: 3,453
Original Poster
|
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.
|
|
|
12-17-2013, 01:32 PM
|
#3
|
Senior Member
Registered: Aug 2004
Location: Nova Gorica, Salvador
Distribution: Slackware
Posts: 1,349
|
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.
|
|
|
12-17-2013, 06:20 PM
|
#4
|
Member
Registered: Dec 2008
Distribution: Slackware64 Current
Posts: 278
Rep:
|
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.
|
|
|
12-18-2013, 02:46 AM
|
#5
|
MLED Founder
Registered: Jun 2011
Location: Montpezat (South France)
Distribution: CentOS, OpenSUSE
Posts: 3,453
Original Poster
|
Quote:
Originally Posted by tux_dude
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
|
|
|
12-18-2013, 06:03 AM
|
#6
|
MLED Founder
Registered: Jun 2011
Location: Montpezat (South France)
Distribution: CentOS, OpenSUSE
Posts: 3,453
Original Poster
|
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?
|
|
|
12-18-2013, 08:57 PM
|
#7
|
Senior Member
Registered: Apr 2009
Location: McKinney, Texas
Distribution: Slackware64 15.0
Posts: 3,860
|
Quote:
Originally Posted by kikinovak
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?
|
|
|
12-19-2013, 06:39 PM
|
#8
|
Senior Member
Registered: Apr 2009
Location: McKinney, Texas
Distribution: Slackware64 15.0
Posts: 3,860
|
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....
|
|
|
01-07-2014, 01:49 AM
|
#9
|
Member
Registered: Nov 2006
Location: Europe,Latvia,Riga
Distribution: slackware,slax, OS X, exMandriva
Posts: 591
Rep:
|
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?
|
|
|
01-07-2014, 02:53 AM
|
#10
|
Member
Registered: Nov 2006
Location: Europe,Latvia,Riga
Distribution: slackware,slax, OS X, exMandriva
Posts: 591
Rep:
|
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...
|
|
|
01-07-2014, 03:28 AM
|
#11
|
Senior Member
Registered: Apr 2009
Location: McKinney, Texas
Distribution: Slackware64 15.0
Posts: 3,860
|
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: - Edit /etc/mdadm.conf to contain the information required to create your RAID arrays or
- Delete /etc/mdadm.conf or rename it to some other name.
|
|
2 members found this post helpful.
|
01-07-2014, 04:09 AM
|
#12
|
Member
Registered: Nov 2006
Location: Europe,Latvia,Riga
Distribution: slackware,slax, OS X, exMandriva
Posts: 591
Rep:
|
Thank you very much for situation clarification
now i understand that side a bit better than previously
|
|
|
01-14-2014, 08:25 AM
|
#13
|
Member
Registered: Nov 2006
Location: Europe,Latvia,Riga
Distribution: slackware,slax, OS X, exMandriva
Posts: 591
Rep:
|
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...?
|
|
|
01-14-2014, 10:03 AM
|
#14
|
Senior Member
Registered: Apr 2009
Location: McKinney, Texas
Distribution: Slackware64 15.0
Posts: 3,860
|
Try this: - Boot into your system using the huge kernel.
- run the following command as root
Code:
mdadm -E -s > /boot/initrd-tree/etc/mdadm.conf
- run the following command as root
Code:
mkinitrd -o /boot/initrd.gz
- 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.
|
01-15-2014, 08:04 AM
|
#15
|
Member
Registered: Nov 2006
Location: Europe,Latvia,Riga
Distribution: slackware,slax, OS X, exMandriva
Posts: 591
Rep:
|
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 08:22 PM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|