LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
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 07-06-2007, 12:36 PM   #1
darklink2058
Member
 
Registered: Apr 2006
Posts: 75

Rep: Reputation: 15
mkraid & slackware 12


Hello Slackware Users.

As you know slackware release 12 its out, Ok I need to install this version on a RAID software using mkraid, I already has configurated in the past 11 version, but when I boot the Slackware 12 dvd, I type mkraid but not found, Are there another method to install software RAID in the Slackware 12 release?

I was used de following guide and works well for me in Slackware 11:

http://www.userlocal.com/articles/ra...ware-linux.php

Thank you.

Last edited by darklink2058; 07-06-2007 at 12:38 PM.
 
Old 07-06-2007, 04:06 PM   #2
darklink2058
Member
 
Registered: Apr 2006
Posts: 75

Original Poster
Rep: Reputation: 15
OK I done it easy:

from Slackware 12 dvd:

Code:
/cdrom/pasture/raidtools-1.00.3-i386-1.tgz
installpkg raidtools-1.00.3-i386-1.tgz
mkraid /dev/md0
DONE

Ok Thanks Any Way.
 
Old 07-06-2007, 08:12 PM   #3
mRgOBLIN
Slackware Contributor
 
Registered: Jun 2002
Location: New Zealand
Distribution: Slackware
Posts: 999

Rep: Reputation: 231Reputation: 231Reputation: 231
Yes the Slackware installer now has mdadm included.

Just partition the drive accordingly and use something like.
Code:
    mdadm --create /dev/md0 --level=1 --raid-devices=2 /dev/hd[ac]1
I'm sure once you get used to mdadm you'll find it's a much better toolset.

Actually I guess that article could do with an update
 
Old 07-07-2007, 01:54 AM   #4
darklink2058
Member
 
Registered: Apr 2006
Posts: 75

Original Poster
Rep: Reputation: 15
Hey mRgOBLIN what is the difference? Between mdadm and mkraid?
 
Old 07-07-2007, 04:35 AM   #5
mRgOBLIN
Slackware Contributor
 
Registered: Jun 2002
Location: New Zealand
Distribution: Slackware
Posts: 999

Rep: Reputation: 231Reputation: 231Reputation: 231
Well for one you don't need a raidtab file.

mdadm can also monitor your arrays and provide a lot more detail than raidtools does. Overall it's just a much better tool.

Lots of info in the man page.
man mdadm
 
Old 07-07-2007, 04:46 AM   #6
darklink2058
Member
 
Registered: Apr 2006
Posts: 75

Original Poster
Rep: Reputation: 15
Excellent, if is better, I will try out.

I do not know what I am using actually if raidtools or mdadm in my /etc/ directory I do not have a raidtab file.

Code:
# ls -l /etc/raidtab
ls: cannot access /etc/raidtab: No such file or directory
but...

Code:
$ df -H
Filesystem             Size   Used  Avail Use% Mounted on
/dev/md/0              501G    80G   421G  16% /
/dev/sdc1              708M    51M   657M   8% /boot
/dev/sdc3              118G    34M   118G   1% /mnt/sata
Anyway my soft RAID 0 is done, no more questions, Thank you Very Much.
 
Old 07-07-2007, 06:45 AM   #7
mRgOBLIN
Slackware Contributor
 
Registered: Jun 2002
Location: New Zealand
Distribution: Slackware
Posts: 999

Rep: Reputation: 231Reputation: 231Reputation: 231
yes you only need the raidtab file to create or repair the arrays. So unless you copied it over to your new install it probably doesn't exist anymore.

Good to hear you got things working anyway.
 
Old 07-07-2007, 01:15 PM   #8
darklink2058
Member
 
Registered: Apr 2006
Posts: 75

Original Poster
Rep: Reputation: 15
HELP mRgOBLIN...

Today in the morning I turn on my PC and the LILO not boot my system (only Slackware)

Ok I just need Boot from CD redo the raidtab, mount /dev/md0 and reinstall lilo.

Ok I boot from Slackware 12 DVD, installpkg raidtools and create /etc/raidtab:

Code:
raiddev  /dev/md0
         raid-level      0
         nr-raid-disks   2
         nr-spare-disks  0
         chunk-size      32
         persistent-superblock 1
         device          /dev/sda1
         raid-disk       0
         device          /dev/sdb1
         raid-disk       1
OK this not the first time that I repair the LILO using soft RAID, but the first time that appear to me this messege at mkraid /dev/md0

Code:
# mkraid /dev/md0
handling MD device /dev/md0
analyzing super-block
disk 0: /dev/sda1, 244196001kB, raid superblock at 244195904kB
/dev/sda1 appears to be already part of a raid array --use -f to
force the destruction of the old superblock
mkraid: aborted.
(In addition to the above messages, see the syslog and /proc/mdstat as well
 for potential clues.)
I do not undesrtand "force the destruction of the old superblock". I just do not want lose data forcing the mkraid.

Please, S.O.S.
 
Old 07-07-2007, 04:45 PM   #9
mRgOBLIN
Slackware Contributor
 
Registered: Jun 2002
Location: New Zealand
Distribution: Slackware
Posts: 999

Rep: Reputation: 231Reputation: 231Reputation: 231
Try
Code:
raidstart /dev/md0
or
Code:
mdadm -A /dev/md0 /dev/sda1 /dev/sdb1
I've also started writing a raid howto for slackware 12.0.

You can preview it here http://www.userlocal.com/articles/ra...ackware-12.php

Last edited by mRgOBLIN; 07-08-2007 at 04:33 PM.
 
Old 07-08-2007, 10:04 AM   #10
TL_CLD
Member
 
Registered: Sep 2006
Posts: 366

Rep: Reputation: 45
Quote:
Originally Posted by mRgOBLIN
I've also started writing a raid howto for slackware 12.0.

You can preview it here http://www.userlocal.com/articles/ra...ackware-12.php
Sweet howto mRgOBLIN!

I've had one I wrote for Slackware 11, using the "old" raidtools, and I had planned on doing one for Slackware 12 using mdadm, but since you've already done all the hard work, why should I?

Thomas
 
Old 07-08-2007, 03:13 PM   #11
darklink2058
Member
 
Registered: Apr 2006
Posts: 75

Original Poster
Rep: Reputation: 15
Excellent, All backs to the normal,

The problem was LILO, where In /dev/sdc1 I have the /boot directory for my raid system boot. Excellent Mini-Howto I will retake this document.

Thank you.
 
Old 10-08-2007, 12:33 PM   #12
mikejw
LQ Newbie
 
Registered: Jan 2006
Posts: 1

Rep: Reputation: 0
Updating Lilo

Help Mr Goblin!

After follwing your tutorial I want to update lilo (and the MBR) with a kernel I've compiled myself but lilo is complaining that /dev/sda (the first disk used in the RAID 1 configuration) cannot be opened.

What now?

Many thanks.
 
Old 10-11-2007, 09:18 AM   #13
hb950322
LQ Newbie
 
Registered: Dec 2006
Posts: 24

Rep: Reputation: 15
Detailed Instruction right here

A lot of thanks an respect to Software-RAID HOWTO (http://www.tldp.org/HOWTO/Software-RAID-HOWTO.html) of Jakob Ostergaard and Emilio Bueso. This HOWTO is a really in-depth document of about 40 pages ! My document is more for the unpatient sysadmin ...

Server Hardware, Kernel:

Kernel 2.6.21
Pentium Dual Core 2,66MHZ
4GB RAM
2 SATA-Drives 400GB

Boot machine with Slackware DVD and get on the console

Partioning both drives exactly the same way. I don't see the advantage by creating lot's of partitions. So I created a primary partition of 380GB (sda1, sdb1) and a swap partition (sda2, sdb2) of 20GB on each drive. Note the correct partition types: FD (linux raid autodetect) for sda1, sdb1. Type 82 as usual for the swap partitions.

If there was a former LILO or other bootloader installed in the MBR of the discs, wipe it out with:

dd if=/dev/zero of=/dev/sda bs=446 count=1
dd if=/dev/zero of=/dev/sdb bs=446 count=1

Forget about the old raidtools and raidtab files. Use the mdadm-utility (multiple discs array admin manager). A really fine tool with lots of options (man mdadm or mdadm --help). To create the array type:

mdadm –create /dev/md0 –level=1 –raid-devices=2 /dev/sda1 /dev/sda2

If there is already a filesystem on the partition(s), mdadm will ask you if you really want to proceede. Answer 'y'. You get an output like:

mdadm: array /dev/md0 started

With 'cat /proc/mdstat' you can always see the status of your array. Or use 'mdadm –detail /dev/md0' instead, which gives you nearly the same information.

By examine the outprinted information you recognize that the syncing process between the two discs (partitions) has started immediately. DON'T INTERRUPT THIS PROCESS UNTIL IT HAS FINISHED !

If the device was successfully created, the reconstruction process has now begun. Your array is not consistent until this reconstruction phase has completed. However, the array is fully functional (except for the handling of device failures of course), and you can format it and use it even while it is reconstructing.

Now you can put a filesystem on /dev/md0. I prefer ext3, but this doesn't matter. If you are an expert and want fine tuning, use mke2fs on the console. Otherwise you can type 'setup' now to enter the Slackware configuration utility.
Proceed through the configuration points as usual, exept LILO-Installation. By setting up your target partitions, you see the /dev/md0 device which MUST be setup as Root-partition.

LILO

Newer LILO distributions can handle RAID-1 devices, and thus the kernel can be loaded at boot-time from a RAID device. LILO will correctly write boot-records on all disks in the array, to allow booting even if the primary disk fails.

Some users have experienced problems with this, reporting that although booting with one drive connected worked, booting with both two drives failed. Nevertheless, running the described procedure with both disks fixed the problem, allowing the system to boot from either single drive or from the RAID-1 (this is what I did, too – changing lilo.conf and installed in MBR of both discs).

The boot device MUST be a non-raided device. The root device is your new md0 device. I did not test installing LILO in the superblock of the array. In my opinion it should work also.

Example:

boot=/dev/sda
install=/boot/boot.b
prompt
timeout=50
message=/boot/message
default=linux

image=/boot/vmlinuz
label=linux
read-only
root=/dev/md0

Enter the LILO-Configuration in Expert-Mode. Go through the steps and after you have done view the lilo.conf file very seriously, if the boot and root entries are like explained.

If everything is OK, install LILO

Be very patient. The synchronisation-process is painfully slow. For the two 400GB-Discs it took over two hours ! Read on to speed it up.

Parannoia:
Unmount /dev/md0
Stop your array with mdadm -S /dev/md0
Reboot – Everything should work perfect -

Speeding up Synchronisation

If you are in a situation where you sit in front of the console (or on a remote ssh connection) waiting for a Linux software RAID to finish rebuilding (either you added a new drive, or you replaced a failed one, etc.) then you might be frustrated by how slow this process is running. You are running cat on /proc/mdstat repeatedly (you should really use watch in this case ), and this seems to never finish… Obviously that there is a logical reason for this ‘slowness‘ and on a production system you should leave it running with the defaults. But in case you want to speed up this process here is how you can do it. This will place a much higher load on the system so you should use it with care.
To see your Linux kernel speed limits imposed on the RAID reconstruction use:
cat /proc/sys/dev/raid/speed_limit_max
200000
cat /proc/sys/dev/raid/speed_limit_min
1000
In the system logs you can see something similar to:
md: minimum _guaranteed_ reconstruction speed: 1000 KB/sec/disc.
md: using maximum available idle IO bandwidth (but not more than 200000 KB/sec) for reconstruction.
This means that the minimum guaranteed speed of the rebuild of the array is approx 1MB/s. The actual speed will be higher and will depend on the system load and what other processes are running at that time.
In case you want to increase this minimum speed you need to enter a higher value in speed_limit_min. For example to set this to approx 50 megabytes per second as minimum use:
echo 200000 >/proc/sys/dev/raid/speed_limit_min
The results are instant… you can return to the watch window to see it running, and hope that this will finish a little faster (this will really depend on the system you are running, the HDDs, controllers, etc.):
watch cat /proc/mdstat
Hardcore-Testing

After all was set up, I was curious how stable this thing is. So I made clean shutdowns, pulled of the cable of first sda, then sdb disc. Finally I pulled the AC connection without a proper shutdown (puhhhh!!).

mdadm /dev/md0 -a /dev/sdX hot-adds the degraded disc back into the array.

It work's. Not to damage so far ! Now I'm very shure, that I can rely on that system.
 
  


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
AOL UK && BT Voyager 100 && Slackware 10.2 && RP-PPPoE pitt0071 Linux - Networking 3 01-17-2006 06:10 AM
mkraid -- command not found raptorman Debian 2 09-27-2005 06:56 AM
(FreeBSD && Fedora Core 4 && Slackware 10.0) Filesystem Support taylor_venable *BSD 1 07-14-2005 02:24 PM
Trying to Locate MKRAID louisb Linux - Software 3 06-18-2005 09:32 AM
RAID 1 and mkraid GaMeS Slackware 17 03-09-2005 01:12 AM

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

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