LinuxQuestions.org
Review your favorite Linux distribution.
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 08-03-2006, 08:54 PM   #1
Slackovado
Member
 
Registered: Mar 2005
Location: BC, Canada
Distribution: Slackware 14.2 x64
Posts: 308

Rep: Reputation: 70
Slack 10.2 + kernel 2.6.16.27 + udev + raid


Ok people this is going to be long one, so put on your glasses and make fresh pot of coffee.
As the subject says, I mutilated Slack 10.2 by doing this.
Got kernel 2.6.16.27 from kernel.org
Got .config from Slackware Current for the same version of kernel.

Compiled new kernel using Slackware Current 2.6.16.27 .config by doing make oldconfig and then further customizing the config by including support for disk controllers and filesystems but didn't make any other changes.
I did that mainly to be able to boot without using initrd, since I couldn't figure out how to make initrd for sata + xfs on Intel ICH7R.

I have 3 sata hard drives in the system.
SDA is the boot drive with everything on it.
SDB and SDC are with one partition each and dedicated to raid1 planned for storage of originally /var but now I changed my mind and will store /home on it.

After several days of muddling around with fake raid on the Intel ICH7R and dmraid driver without getting anywhere I gave up on that and decided to use the Linux software raid.
Well,so I thought. But it's not that easy.
Well frustration continues.
I'm finding conflicting information, completely useless man pages and in general a lot of confused linux users all over google struggling with the same problems.

Initially I had some success.
I followed some howto to create the raid1.
- Edited the raidtab in /etc and put the following in there

Code:
raiddev                 /dev/md0
raid-level              1
nr-raid-disks           2
nr-spare-disks          0
chunk-size              64
persistent-superblock   1
device                  /dev/sdb1
raid-disk               0
device                  /dev/sdc1
raid-disk               1
- Then I did makeraid and created xfs filesystem on the /dev/md0
- and mounted it on /mnt/raid (for now) to test it.

So far so good.

But then I decided to upgrade udev, because from the kernel docs it says that udev must be newer than the one that comes with Slack 10.2.
So I grabbed the udev-094-i486-3pk.tgz from http://piterpunk.info02.com.br/extra/packages/ and upgraded the Slack 10.2 udev with that one.
And at that point I lost /dev/md0 and can't get it back.
Searched on google for last two days and red dozens pages and found people with same problem but no solution.
There is confusing talk about mdadm is supposed to create the /dev/md0 and that autodect of raid is supposed to be deprecated from the kernel etc. but non of that is helping me.
Interestingly the raid is working, at least I can ls the /mnt/raid and it lists the files on it so the raid drive is mounted but I don't have a clue where it's mounted from since there is no /dev/md0.
Also
Code:
cat /proc/mdstat
tells me that raid1 is there but I have no /dev/md0.
Here is my fstab
Code:
/dev/sda6        swap             swap        defaults         0   0
/dev/sda1        /                xfs         defaults         1   1
/dev/sda5        /home            xfs         defaults         1   2
/dev/cdrom       /mnt/cdrom       auto        noauto,owner,ro  0   0
# /dev/fd0         /mnt/floppy      auto        noauto,owner     0   0
/dev/md0        /mnt/raid         xfs         defaults         1   1
/dev/sdd4       /mnt/usbkey     vfat            noauto,users,exec,dmask=007,fmask=007 0 0
devpts           /dev/pts         devpts      gid=5,mode=620   0   0
proc             /proc            proc        defaults         0   0
sys             /sys            sysfs           defaults        0  0
The other problem is that I'm still very confused about Linux software raid.
And in particular what am I suppose to use? Raidtools or mdadm? How does device mapper fit into all this? Etc. etc.

I'm done reading useless man pages and googling. I swear if I don't get a straight answer I'm installing Windows 2003 server (KIDDING!)

Another funny thing.
I actually got mad at Slackware and went and downloaded Debian netinstall iso (last month release).
Since I've been experimenting with Debian on another machine lately and liking it a lot I thought I'd give Debian a try on this server.
But the bastard wouldn't even recognize any sata drives when I booted into the install.
So much for Debian. Go back to sleep grandpa.
Whereas Slack's 2.6.13 test kernel booted and recognized my sata drives no problem.
So, long live Slack! But you almost lost me to Debian if that thing had installed ok.

Anyway, to summarize my problems.
I can't get /dev/md0 back.
I don't understand what tools am I supposed to use for raid management in Slackware. Should I use raidtools or mdadm and what kernel modules should be loaded in order for it all work.
Lastly, how do I get it to make some popcorn for me

Thanks in advance to anyone that takes the time to read this.
Any help will be appreciated and will also insure successful increase in Linux used on servers (and we'll probably be adding more servers down the road too ).
 
Old 08-04-2006, 05:54 PM   #2
titopoquito
Senior Member
 
Registered: Jul 2004
Location: Lower Rhine region, Germany
Distribution: Slackware64 14.2 and current, SlackwareARM current
Posts: 1,646

Rep: Reputation: 147Reputation: 147
Quote:
Originally Posted by Slackovado
But then I decided to upgrade udev, because from the kernel docs it says that udev must be newer than the one that comes with Slack 10.2.
So I grabbed the udev-094-i486-3pk.tgz from http://piterpunk.info02.com.br/extra/packages/ and upgraded the Slack 10.2 udev with that one.
And at that point I lost /dev/md0 and can't get it back.
Sorry, but I think I may not have much to say about your problem. I just noticed Piter Punk mention some disappearing device nodes on his site. Have you tried to create your md0 device this way? Just my spare two cents ...

Quote:
Some little things you need remember: put your firmware files in /lib/firmware, this is the correct location. If you need some special device earlier at boot, create a node in /lib/udev/devices, this directory is copied to /dev each boot, before udev tries to detect the hardware.
 
Old 08-04-2006, 09:23 PM   #3
Slim Backwater
Member
 
Registered: Nov 2005
Distribution: Slackware 10.2 2.6.20
Posts: 68

Rep: Reputation: 15
I'll try

I'll try to help you. I've recently figured this out.

Quote:
Originally Posted by Slackovado
Ok people this is going to be long one, so put on your glasses and make fresh pot of coffee.
As the subject says, I mutilated Slack 10.2 by doing this.
Got kernel 2.6.16.27 from kernel.org
Got .config from Slackware Current for the same version of kernel.

Compiled new kernel using Slackware Current 2.6.16.27 .config by doing make oldconfig and then further customizing the config by including support for disk controllers and filesystems but didn't make any other changes.
I did that mainly to be able to boot without using initrd, since I couldn't figure out how to make initrd for sata + xfs on Intel ICH7R.
At this point, with 2.6.16.27 being available in current, you should install the kernel source from that. I'm only talking about kernel-source-2.6.16.27-noarch-1.tgz from slackware-current/extra/linux-2.6.16.27/ don't install anything else.
Code:
# installpkg kernel-source-2.6.16.27-noarch-1.tgz
# cd /usr/src/linux
# make menuconfig
# time make
# make modules_install
In the make menuconfig step you could set popular options like CPU type, highmem (if you have atleast 1GB), SMP (if you have dual CPUs), SMT (If you have a P4 with HyperThreading), your root filesystem (ResierFS or XFS?) and your SATA drivers.

Quote:
Originally Posted by Slackovado
I have 3 sata hard drives in the system.
SDA is the boot drive with everything on it.
SDB and SDC are with one partition each and dedicated to raid1 planned for storage of originally /var but now I changed my mind and will store /home on it.
You don't say how big your hard drives are, but I would recommend a partition strategy like this:
Code:
hda1 128M Ext2 /boot
hda2 2xRAM SWAPFS Swap
hda3 RestOfDrive ResierFS /
Quote:
Originally Posted by Slackovado
After several days of muddling around with fake raid on the Intel ICH7R and dmraid driver without getting anywhere I gave up on that and decided to use the Linux software raid.
Well,so I thought. But it's not that easy.
Skip fakeraid. It's garbage. You can't be certain that a hardware RAID drive will work in any other system, and that's kinda the point of RAID, fault tolerance. Software raid will work when moved to a new system. And Yes, there's a steep learning curve. I worked on this for about two full weeks (at my job), the second week after about a 2 month break. (I was struggling with EVMS, never did get it to do what I wanted).

Quote:
Originally Posted by Slackovado
Well frustration continues.
I'm finding conflicting information, completely useless man pages and in general a lot of confused linux users all over google struggling with the same problems.
I've found that the man pages and google results are actually correct, from their own point of view. There's seems to be a lack of upto date documentation though.

Quote:
Originally Posted by Slackovado
Initially I had some success.
I followed some howto to create the raid1.
- Edited the raidtab in /etc and put the following in there

Code:
raiddev                 /dev/md0
raid-level              1
nr-raid-disks           2
nr-spare-disks          0
chunk-size              64
persistent-superblock   1
device                  /dev/sdb1
raid-disk               0
device                  /dev/sdc1
raid-disk               1
- Then I did makeraid and created xfs filesystem on the /dev/md0
- and mounted it on /mnt/raid (for now) to test it.

So far so good.
Good, but that's definately the old documentation you're following. Everything is with mdadm now (or EVMS if you go that route).

Quote:
Originally Posted by Slackovado
But then I decided to upgrade udev, because from the kernel docs it says that udev must be newer than the one that comes with Slack 10.2.
So I grabbed the udev-094-i486-3pk.tgz from http://piterpunk.info02.com.br/extra/packages/ and upgraded the Slack 10.2 udev with that one.
And at that point I lost /dev/md0 and can't get it back.
Searched on google for last two days and red dozens pages and found people with same problem but no solution.
I can't help with this. I didn't know about this udev requirement and I've never installed it. I don't even know what udev is. Your problem may lye here.

Quote:
Originally Posted by Slackovado
There is confusing talk about mdadm is supposed to create the /dev/md0 and that autodect of raid is supposed to be deprecated from the kernel etc. but non of that is helping me.
Interestingly the raid is working, at least I can ls the /mnt/raid and it lists the files on it so the raid drive is mounted but I don't have a clue where it's mounted from since there is no /dev/md0.
I can only guess that this is udev related. You should research how udev works a bit more.


Quote:
Originally Posted by Slackovado
Also
Code:
cat /proc/mdstat
tells me that raid1 is there but I have no /dev/md0.
Here is my fstab
Code:
/dev/sda6        swap             swap        defaults         0   0
/dev/sda1        /                xfs         defaults         1   1
/dev/sda5        /home            xfs         defaults         1   2
/dev/cdrom       /mnt/cdrom       auto        noauto,owner,ro  0   0
# /dev/fd0         /mnt/floppy      auto        noauto,owner     0   0
/dev/md0        /mnt/raid         xfs         defaults         1   1
/dev/sdd4       /mnt/usbkey     vfat            noauto,users,exec,dmask=007,fmask=007 0 0
devpts           /dev/pts         devpts      gid=5,mode=620   0   0
proc             /proc            proc        defaults         0   0
sys             /sys            sysfs           defaults        0  0
What does `cat /proc/mounts`, `cat /proc/mdstat` and `df` return?

Quote:
Originally Posted by Slackovado
The other problem is that I'm still very confused about Linux software raid.
And in particular what am I suppose to use? Raidtools or mdadm? How does device mapper fit into all this? Etc. etc.
I suggest you disregard any docs you find on raidtools, stick with mdadm. Read the man page on it a couple of times (it seems complete).

Try:
Code:
# mdadm --detail --scan
# mdadm --examine /dev/hde1  # Replace /dev/hde1 with your raid member partition
# cat /proc/mdstat
personalities : [raid1]
md0 : active raid1 hdf1[1] hde1[0]
      312568576 blocks [2/2] [UU]

unused devices: <none>
Quote:
Originally Posted by Slackovado
I'm done reading useless man pages and googling. I swear if I don't get a straight answer I'm installing Windows 2003 server (KIDDING!)

Another funny thing.
I actually got mad at Slackware and went and downloaded Debian netinstall iso (last month release).
Since I've been experimenting with Debian on another machine lately and liking it a lot I thought I'd give Debian a try on this server.
But the bastard wouldn't even recognize any sata drives when I booted into the install.
So much for Debian. Go back to sleep grandpa.
Whereas Slack's 2.6.13 test kernel booted and recognized my sata drives no problem.
So, long live Slack! But you almost lost me to Debian if that thing had installed ok.

Anyway, to summarize my problems.
I can't get /dev/md0 back.
I don't understand what tools am I supposed to use for raid management in Slackware. Should I use raidtools or mdadm and what kernel modules should be loaded in order for it all work.
Lastly, how do I get it to make some popcorn for me

Thanks in advance to anyone that takes the time to read this.
Any help will be appreciated and will also insure successful increase in Linux used on servers (and we'll probably be adding more servers down the road too ).
Use mdadm for all your raid stuff, make a backup and remove your /etc/raidtab file. Read /etc/mdadm.conf and Run mdadm --detail --scan >> /etc/mdadm.conf to backup your raid configuration file (note the DOUBLE >> to APPEND that config information to the usefully documented file)

I don't exactly know what Device mapper does or is for, but I know you need it to use LVM, which is what you should use to break up your final RAID-1 (into LVM volumes, which are kinda like partitons, but you can change them, add, delete, grow, shrink without rebooting and (except for shrink) without umounting the filesystem on it.)

You _may_ need an initrd still to mount your raid partition at boot, unless the partition type is set to autodetect (FD?). I've done it both ways, I liked the autodetect, but I preferred having the mdadm.conf in the initrd.

Slackware's initrd is broken when it comes to md devices (the /dev directory is incomplete), but if you get that far, I can tell you what to do to fix it (essentially delete the broken dev/md0 and dev/md1, make new ones with mknod and run mkinitrd again (without the -c))

I hope that helps, atleast a little, please ask followup questions and let me know how it works out for you (especially the udev stuff, I've never touched it, never used it and I run a 2.6.16.27 kernel, so maybe I should).

._.
 
Old 08-05-2006, 05:36 PM   #4
Slackovado
Member
 
Registered: Mar 2005
Location: BC, Canada
Distribution: Slackware 14.2 x64
Posts: 308

Original Poster
Rep: Reputation: 70
Quote:
Originally Posted by titopoquito
Sorry, but I think I may not have much to say about your problem. I just noticed Piter Punk mention some disappearing device nodes on his site. Have you tried to create your md0 device this way? Just my spare two cents ...
Actually, your tip was extremely valuable. Thank you.
One of my major problems was that udev was not creating the /dev/md0 device so I had nowhere to put my raid array.
I haven't fitured out yet why udev will not creade the /dev/md0 but and I am assuming it's some kind of incompatibility, glitch or whatever with Slack and new udev.
I will not try to get to the bottom of this right now.
I just use the workaround you suggested.
Anyway, I created the md0 in /lib/udev/devices with the mknod md0 b 9 0 command and after that I was getting the /dev/md0.
So that problem is solved.
 
Old 08-05-2006, 06:11 PM   #5
Slackovado
Member
 
Registered: Mar 2005
Location: BC, Canada
Distribution: Slackware 14.2 x64
Posts: 308

Original Poster
Rep: Reputation: 70
Quote:
Originally Posted by Slim Backwater
I'll try to help you. I've recently figured this out.



At this point, with 2.6.16.27 being available in current, you should install the kernel source from that. I'm only talking about kernel-source-2.6.16.27-noarch-1.tgz from slackware-current/extra/linux-2.6.16.27/ don't install anything else.
Code:
# installpkg kernel-source-2.6.16.27-noarch-1.tgz
# cd /usr/src/linux
# make menuconfig
# time make
# make modules_install
In the make menuconfig step you could set popular options like CPU type, highmem (if you have atleast 1GB), SMP (if you have dual CPUs), SMT (If you have a P4 with HyperThreading), your root filesystem (ResierFS or XFS?) and your SATA drivers.



You don't say how big your hard drives are, but I would recommend a partition strategy like this:
Code:
hda1 128M Ext2 /boot
hda2 2xRAM SWAPFS Swap
hda3 RestOfDrive ResierFS /


Skip fakeraid. It's garbage. You can't be certain that a hardware RAID drive will work in any other system, and that's kinda the point of RAID, fault tolerance. Software raid will work when moved to a new system. And Yes, there's a steep learning curve. I worked on this for about two full weeks (at my job), the second week after about a 2 month break. (I was struggling with EVMS, never did get it to do what I wanted).



I've found that the man pages and google results are actually correct, from their own point of view. There's seems to be a lack of upto date documentation though.



Good, but that's definately the old documentation you're following. Everything is with mdadm now (or EVMS if you go that route).



I can't help with this. I didn't know about this udev requirement and I've never installed it. I don't even know what udev is. Your problem may lye here.



I can only guess that this is udev related. You should research how udev works a bit more.




What does `cat /proc/mounts`, `cat /proc/mdstat` and `df` return?



I suggest you disregard any docs you find on raidtools, stick with mdadm. Read the man page on it a couple of times (it seems complete).

Try:
Code:
# mdadm --detail --scan
# mdadm --examine /dev/hde1  # Replace /dev/hde1 with your raid member partition
# cat /proc/mdstat
personalities : [raid1]
md0 : active raid1 hdf1[1] hde1[0]
      312568576 blocks [2/2] [UU]

unused devices: <none>


Use mdadm for all your raid stuff, make a backup and remove your /etc/raidtab file. Read /etc/mdadm.conf and Run mdadm --detail --scan >> /etc/mdadm.conf to backup your raid configuration file (note the DOUBLE >> to APPEND that config information to the usefully documented file)

I don't exactly know what Device mapper does or is for, but I know you need it to use LVM, which is what you should use to break up your final RAID-1 (into LVM volumes, which are kinda like partitons, but you can change them, add, delete, grow, shrink without rebooting and (except for shrink) without umounting the filesystem on it.)

You _may_ need an initrd still to mount your raid partition at boot, unless the partition type is set to autodetect (FD?). I've done it both ways, I liked the autodetect, but I preferred having the mdadm.conf in the initrd.

Slackware's initrd is broken when it comes to md devices (the /dev directory is incomplete), but if you get that far, I can tell you what to do to fix it (essentially delete the broken dev/md0 and dev/md1, make new ones with mknod and run mkinitrd again (without the -c))

I hope that helps, atleast a little, please ask followup questions and let me know how it works out for you (especially the udev stuff, I've never touched it, never used it and I run a 2.6.16.27 kernel, so maybe I should).

._.
Thanks Slim Backwater.
I got it working.
Once I had the /dev/md0 problem solved I was on my way.
I will post a little howto soon.
But the key defferences between my setup and most of the howtos found is that I just want the raid1 for data, in particular for hosting web sites (domains) on this little server.
I don't use it for boot or root install of Slack.
So I have 3 hard drives. They are 300Gb each.
The first one is for Slack, it is the boot drive and has the "/" filesystem on it. It's /dev/sda with one primary partition sda1, one large partition sda5 which I haven't decided what will be on it yet, but probably will link to some directory with data files in it. And third partition sda6 is a swap.
The other two drives have one partition each, form the raid1 array, which is /dev/md0 and has one partition on it, and I mounted /home on it, since that's where most of the data will be.

My cat /proc/mounts
Code:
rootfs / rootfs rw 0 0
/dev/root / xfs rw 0 0
proc /proc proc rw 0 0
sysfs /sys sysfs rw 0 0
tmpfs /dev tmpfs rw 0 0
devpts /dev/pts devpts rw 0 0
none /proc/bus/usb usbfs rw 0 0
/dev/md0 /home xfs rw,sunit=128,swidth=256 0 0
My cat /proc/mdstat
Code:
Personalities : [raid1] 
md0 : active raid1 sdb1[0] sdc1[1]
      293049600 blocks [2/2] [UU]
      
unused devices: <none>
df gives me
Code:
Filesystem           1K-blocks      Used Available Use% Mounted on
/dev/sda1             19524768   4645500  14879268  24% /
/dev/md/0            292918272     96036 292822236   1% /home
The short procedure was.
Have to have raid1 module loading from /etc/rc.d/rc.modules to get raid working at all.
That automaticaly loads the md_mod module which as far as I understand does all the main raid work.
Then I created the raid for /dev/md0 with
Code:
mdadm --create /dev/md0 --level=1 --raid-devices=2 /dev/sdb1 /dev/sdc1
The last problem was that the raid was not starting automaticaly at system boot.
So I inserted the command
Code:
mdadm -A /dev/md0  /dev/sdb1 /dev/sdc1
into /etc/rc.S right before the
Code:
# Initialize the Logical Volume Manager
section.
I figured it was the appropriated place for it if it is for the LVM.
If anyone has any advice on this or some proper scripts I'd be interested.
I couldn't find and place where Slackware starts raid devices, just the LVM.
And as for shutdown, I'm not sure, but the rc.6 unmounts everything mounted in fstab so I figure it's ok.
But someone let me know if I need to properly stop the raid or not please.

And my fstab is
Code:
/dev/sda6        swap             swap        defaults         0   0
/dev/sda1        /                xfs         defaults         1   1
#/dev/sda5        /home            xfs         defaults         1   2
/dev/cdrom       /mnt/cdrom       auto        noauto,owner,ro  0   0
# /dev/fd0         /mnt/floppy      auto        noauto,owner     0   0
/dev/md0        /home         xfs         defaults         1   2
/dev/sdd4       /mnt/usbkey     vfat            noauto,users,exec,dmask=007,fmask=007 0 0
devpts           /dev/pts         devpts      gid=5,mode=620   0   0
proc             /proc            proc        defaults         0   0
sys             /sys            sysfs           defaults        0  0
As you can see I had /home originally mounted on the first hard disk and I changed it in the final fstab to run off the raid1 on the /dev/md0.
I hope I got it right, if not, please let me know.

I'm not going to bother with LVM since I will not need it on this server, no more storage will be added. Maybe with the next server
I dont' bother with initrd. I have everything I need for my hardware compiled into the kernel.
What's EVMS? Seen it while googling but still don't know.
All seems good so far.

Thanks for your help.
The advice to use mdadm was the key. And yes, there is not enough documentation for mdadm. The man page is not enough for noobs like me.

Oh well, now I'm off to actually start configuring the server itself
Hello Apache! MySQL! ProFTP!
Someone please come scrape the rest of my brain off the monitor in a few days
 
  


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
Kernel 2.4.31 and udev merchtemeagle Slackware 5 04-04-2006 07:35 PM
/etc/udev/permissions.d on Slack ? Kocil Slackware 3 11-29-2005 02:57 AM
kernel 2.6.9 and udev ?? CloudyWizzard Debian 3 11-27-2004 10:36 AM
udev + sw raid issues Barx Slackware 0 10-15-2004 06:36 AM
slack 9.2? kernel 2.6? support for SATA raid?? scsikid Slackware 6 03-09-2004 08:53 PM

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

All times are GMT -5. The time now is 07:16 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