LinuxQuestions.org
Latest LQ Deal: Complete CCNA, CCNP & Red Hat Certification Training Bundle
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 01-16-2004, 07:15 PM   #1
twantrd
Senior Member
 
Registered: Nov 2002
Location: CA
Distribution: redhat 7.3
Posts: 1,440

Rep: Reputation: 52
Raid 1 Newbie


Hello everyone,

I have searched through google and this forum and still can't find the answer. I'm losing hair fast. I am running debian Woody with kernel version 2.2.20.

I have installed raidtools (not 2, just the first one) so that I can do IDE software raid 1. I have two drives that are idenitical in size and in manufacturer. Running mkraid /dev/md0 gives me:

Couldn't open /dev/md0 -- No such device
mkraid: aborted.

I don't have /proc/mdstat so I can't check that out either. There is a 'md0' file in '/etc'. I have set up my /etc/raidtab correctly I think. At this point, I'm thinking I don't have raid 1 support in the kernel. How do I check for raid 1 support in the kernel??

Any help is greatly appreciated. Thank you all....

-twantrd
 
Old 01-16-2004, 07:48 PM   #2
g-rod
Member
 
Registered: Dec 2003
Location: Long Island, NY USA
Distribution: RedHat, SUSE
Posts: 336

Rep: Reputation: 30
Try inserting the modules first.
modprobe raid1;
 
Old 01-17-2004, 01:42 AM   #3
twantrd
Senior Member
 
Registered: Nov 2002
Location: CA
Distribution: redhat 7.3
Posts: 1,440

Original Poster
Rep: Reputation: 52
Hi,

Tried "/sbin/modprobe raid1" and it just says:

modprobe: Can't locate module raid1



-twantrd
 
Old 01-17-2004, 05:17 AM   #4
Crashed_Again
Senior Member
 
Registered: Dec 2002
Location: Atlantic City, NJ
Distribution: Ubuntu & Arch
Posts: 3,503

Rep: Reputation: 57
Well did you compile raid support into the kernel?
 
Old 01-18-2004, 03:47 AM   #5
twantrd
Senior Member
 
Registered: Nov 2002
Location: CA
Distribution: redhat 7.3
Posts: 1,440

Original Poster
Rep: Reputation: 52
Hi,

Well, found my problem. Yep, recompiled kernel with raid 1 support. Now raid seems to be working ok *i think*. I issued 'cat /proc/mdstat' and it will take more than 1 hour to sync. I have raided /dev/hdb1 and /dev/hdd1 to /dev/md0. I want to test my raid and see if it works. A couple of questions:

1. If I unplug /dev/hdb1 what will happen?
2. Will all the contents in hdb1 mirror onto hdd1 which I can see /dev/md0?
3. Let's say /dev/hdb1 is faulty and I put in a brand new hard-disk with no partition table. Would I just issue 'mkraid /dev/md0' again or is there some other command?

Thank you very much for your help..

-twantrd
 
Old 01-18-2004, 08:31 AM   #6
g-rod
Member
 
Registered: Dec 2003
Location: Long Island, NY USA
Distribution: RedHat, SUSE
Posts: 336

Rep: Reputation: 30
1) Don't unplug the drive while the computer is on it will hang the ide bus. If you unplug the drive while the computer is off the computer will run in degraded mode.
If your boot partition is raided you will need to setup lilo to boot to a mirror.
http://www.tldp.org/HOWTO/Boot+Root+...O-3.html#ss3.1

2)Yes, once the rebuild finishes the data will be on /dev/hdd1 too. DON'T MOUNT IT. It is constantly being updated as part of the RAID1.

3) No, you need to make a partition of the same size as /dev/hdb1 and make the partition type fd.
You can make a backup of you partition table now with
sfdisk -d /dev/hdd > /root/hdd.part
To restore the partition table
sfdisk /dev/hdd < /root/hdd.part
Then you should be able to run mkraid.
 
Old 01-18-2004, 03:50 PM   #7
twantrd
Senior Member
 
Registered: Nov 2002
Location: CA
Distribution: redhat 7.3
Posts: 1,440

Original Poster
Rep: Reputation: 52
Hi,

Thanks a lot for clearing up my questions! A couple comments in reply.

Quote:
If you unplug the drive while the computer is off the computer will run in degraded mode.
What is degraded mode? What happens during this mode?

Quote:
Yes, once the rebuild finishes the data will be on /dev/hdd1 too. DON'T MOUNT IT. It is constantly being updated as part of the RAID1.
Ok, now i start to understand. Do not mount any of the raid-devices (ie. /dev/hdd1 and /dev/hdb1). I put all my data on /dev/md0 which will then be mirrored onto those 2 partitions correct?

------------QUOTE--------------------
You can make a backup of you partition table now with
sfdisk -d /dev/hdd > /root/hdd.part
To restore the partition table
sfdisk /dev/hdd < /root/hdd.part
Then you should be able to run mkraid.
------------ENDQUOTE--------------------

Ahh i c. Ok, I've been rumaging through google and such and most people issue a 'raidhotadd' when a disk fails. What is this 'raidhotadd' command and if my /dev/hdb1 fails can I just:

1. Plug in new drive
2. 'raidhotadd /dev/hdb'?

Sorry for the noobish raid questions. I appreciate your help!

-twantrd
 
Old 01-18-2004, 04:06 PM   #8
g-rod
Member
 
Registered: Dec 2003
Location: Long Island, NY USA
Distribution: RedHat, SUSE
Posts: 336

Rep: Reputation: 30
Sorry, degraded mode is a term that is used in association with redundant raid (raid levels 1,4,5). It means that the device is no longer in redundant mode and if it looses another disk the data will be lost. Technically degraded might only be used in association with raid 4&5 and not mirrors(raid 1), but you get the idea.

The raidhotadd is used to replace the failed device with different one. Say if you had a hot spare (a drive that is in the machine, but not actively used for anything). Then you could hotadd this device to replace the failed device. The disk still needs to be partitioned correctly. There is a exception to this. If the disks are not partitioned at all but the entire drive is used (ie /dev/hda or /dev/hdd...). As a side note you never really need to partition a disk if you are going to use the entire drive. You can put a filesystem on /dev/hda. Blah Blah Blah.

What you wanted to do is physically replace /dev/hdd with a new disk and rebuild the raid. You not doing a hotadd, but a cold replace/rebuild.

Hope that helps
Gerard
 
Old 01-18-2004, 08:21 PM   #9
twantrd
Senior Member
 
Registered: Nov 2002
Location: CA
Distribution: redhat 7.3
Posts: 1,440

Original Poster
Rep: Reputation: 52
G-rod,

Thank you very much! You're awesome!

-twantrd
 
Old 01-19-2004, 08:46 PM   #10
twantrd
Senior Member
 
Registered: Nov 2002
Location: CA
Distribution: redhat 7.3
Posts: 1,440

Original Poster
Rep: Reputation: 52
Hi G-rod,

Now I have a new question . Let's say I want to partition the whole drive itself (all it's partitions including /boot, /root, everything) [I have 2 identical sized disks]. On the second hard-drive, would I need to partition everything exactly the way it is on the first (/dev/hda)? Or is there a command that will just raid the entire content of /dev/hda? Thanks so much!

-twantrd
 
Old 01-20-2004, 06:26 AM   #11
g-rod
Member
 
Registered: Dec 2003
Location: Long Island, NY USA
Distribution: RedHat, SUSE
Posts: 336

Rep: Reputation: 30
You can use the entire drive as one partition by specifying the devices as /dev/hda and /dev/hdd instead of /dev/hda1 and /dev/hdd1. You wount then have no partiting of the hard drive. If you want to make the drives identical and you want to partition them I would partition the first drive and the copy the partition table to the second
sfdisk -d /dev/hda > sfdisk -d /dev/hdd;
The above will copy the partition table from hda to hdd.
BE CAREFUL NOT To OVERWRITE THE RONG PARTION TABLE.
Again if you want to raid the entire drive all you need to do is specify the drive device and not the partitioned device in you raidtab before you run mkraid.
 
Old 01-20-2004, 12:46 PM   #12
twantrd
Senior Member
 
Registered: Nov 2002
Location: CA
Distribution: redhat 7.3
Posts: 1,440

Original Poster
Rep: Reputation: 52
G-rod,

You are the man! Ok, I got a copy of the partition table of /dev/hda and made /dev/hdd the exact same. Now, how do I make raid 1 bootable?


Also, after reading posts and googling, I'm again confused on what /dev/md0 really is. After I create /dev/md0, do I mount /dev/hda2 (whatever is relevant in /etc/raidtab) to /dev/md0? I know I don't mount the second disk (/dev/hdd2) as it is always being updated. Thanks a bunch. This lesson of RAID is teaching me a lot .

-twantrd
 
Old 01-20-2004, 12:55 PM   #13
g-rod
Member
 
Registered: Dec 2003
Location: Long Island, NY USA
Distribution: RedHat, SUSE
Posts: 336

Rep: Reputation: 30
No don't mount /dev/hda or /dev/hdd directly you will brake your mirror.
/dev/md0 is a device file that is used by the software raid to reference the raid device you created using the config file /etc/raidtab. That is the device you want to mouont.

As far as making you mirror bootable there is how I would do it and how a sane man would do it. Let's go with the latter.
http://www.faqs.org/docs/Linux-mini/...ILO.html#ss3.1
 
Old 01-20-2004, 02:44 PM   #14
twantrd
Senior Member
 
Registered: Nov 2002
Location: CA
Distribution: redhat 7.3
Posts: 1,440

Original Poster
Rep: Reputation: 52
Ahh ok. Gotcha. Thanks for the link as well!

-twantrd
 
Old 01-20-2004, 08:15 PM   #15
twantrd
Senior Member
 
Registered: Nov 2002
Location: CA
Distribution: redhat 7.3
Posts: 1,440

Original Poster
Rep: Reputation: 52
Hmmm, following the instructions I understand more and more about RAID. But when I try to make bootable Raid and try to setup /dev/hda2 & /dev/hdb2 (which is root '/') it will say that /dev/hda2 is mounted. So I do 'umount /dev/hda2' and it will say 'umount: /: device is busy'. How do I unmount root path?

-twantrd
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
Newbie Raid raptorsoft2000 Linux - Newbie 0 01-01-2004 06:40 PM
Newbie installation problem with raid 0 boatman Linux - Software 1 11-19-2003 09:40 PM
Newbie needs RAID help! fclifton Red Hat 18 11-06-2003 01:05 PM
Red Hat 9 and RAID (Newbie) Seaweed Linux - Hardware 1 05-14-2003 03:26 PM
newbie need help with RAID in 7.3 marvc Linux - Software 2 03-18-2003 04:15 PM


All times are GMT -5. The time now is 10:15 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration