SlackwareThis 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.
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.
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
- 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
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 ).
Distribution: Slackware64 14.2 and current, SlackwareARM current
Posts: 1,646
Rep:
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.
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:
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
- 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
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).
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.
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:
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.
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
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.
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
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.