LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 12-02-2004, 09:21 AM   #1
gmanigault
LQ Newbie
 
Registered: Dec 2004
Posts: 16

Rep: Reputation: 0
RAID 1 Setup/Configuration


This is going to be a little long winded.

I want to setup Raid 1 Mirroring on my Linux version 9.0 server. I have two WD 200 GIG drives and all the software to do this. I have read several papers on how to do this. I guess I need to get past this one point.

I have one drive configured and loaded with my OS and the partitions are laid out the way that I want. I have the other drive setup with the same partitions but of a type of Linux Raid Autodetect. Here is my problem. When I change the drive that is loaded with the software from a type of linux native (83) to Linux Raid Autodetect (fd) the following happens. When I go to define the raid devices I only see the drive with no data on it and type of linux Raid Autodetect. How do I do it to get it to work correctly.


=====

Current:

Hda type Hdd type
/dev/hda1 83 /dev/hdd1 fd
/dev/hda2 83 /dev/hdd2 fd
/dev/hda3 83 /dev/hdd3 fd
/dev/hdd4 swap /dev/hdd4 fd

When I go in to create the raid device it only shows me the hdd device and nothing on the hda side even when I use fdisk and change the type to fd. Can anyone help me?

Thanks.

Gary Manigault
 
Old 12-02-2004, 09:41 AM   #2
Sketch
LQ Newbie
 
Registered: Jun 2001
Location: Washington, D.C.
Distribution: Fedora Core 3
Posts: 16

Rep: Reputation: 0
Can you tell us what your hda and hdd partition tables looks like, according to fdisk?
 
Old 12-03-2004, 09:35 AM   #3
gmanigault
LQ Newbie
 
Registered: Dec 2004
Posts: 16

Original Poster
Rep: Reputation: 0
Additional information.

Below you will find the fdisk configuration I am working with. Here is what I want to do. I want to make the hda one mirrored to hdd. They are both the same exact drive types. I have mdadm and have issued the command to create a raid level 1 with the two drives but got the following message.

error - mdadm - invalid number of raid devices =2

1. Since I have the hda device laid out the way I want it, do I need to change the ID type of each partition to fd?

2. What would I have to do to hdd to make it the mirror? Do I need to setup the whole drive as id FD?

3. Can I issue the mdadm command as follows to create the raid device and have it mirror the whole drive?

mdadm --create --verbose /dev/md0 --level=1 --raid-devices=2 /dev/hda /dev/hdd

4. What would I have to do to grub to make both drives bootable and to make grub work once one drive fails?

Thanks
=====


[root@area51test /]# fdisk -l

Disk /dev/hdd: 200.0 GB, 200049647616 bytes
255 heads, 63 sectors/track, 24321 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot Start End Blocks Id System

Disk /dev/hda: 200.0 GB, 200049647616 bytes
255 heads, 63 sectors/track, 24321 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot Start End Blocks Id System
/dev/hda1 * 1 1912 15358108+ 83 Linux
/dev/hda2 1913 11473 76798732+ 83 Linux
/dev/hda3 11474 17847 51199155 83 Linux
/dev/hda4 17848 24321 52002405 f Win95 Ext'd (LBA)
/dev/hda5 17848 19122 10241406 82 Linux swap
[root@area51test /]#
 
Old 12-03-2004, 09:44 AM   #4
Sketch
LQ Newbie
 
Registered: Jun 2001
Location: Washington, D.C.
Distribution: Fedora Core 3
Posts: 16

Rep: Reputation: 0
Dude, you're missing the point of RAID if that's what you're doing? RAID is designed to make multiple partitions/disks function as a single. If you want to make both disks bootable you aren't trying to make a RAID
 
Old 12-03-2004, 09:48 AM   #5
gmanigault
LQ Newbie
 
Registered: Dec 2004
Posts: 16

Original Poster
Rep: Reputation: 0
Raid1

I understand what mirrorring is and how it works. I am just having a problem with the setup. I only want to make them both bootable from the standpoint of if one disk dies the other will work and take over and if the system is rebooted for any reason with the one disk down it will come back up. Does that make sense?
 
Old 12-03-2004, 09:52 AM   #6
Sketch
LQ Newbie
 
Registered: Jun 2001
Location: Washington, D.C.
Distribution: Fedora Core 3
Posts: 16

Rep: Reputation: 0
okay, you want RAID 5 then. Can I see your /etc/raidtab file?
 
Old 12-03-2004, 10:02 AM   #7
gmanigault
LQ Newbie
 
Registered: Dec 2004
Posts: 16

Original Poster
Rep: Reputation: 0
No raid 5

I don't want to use raid 5. I want to use raid 1. I only have two drives. Raid 1 would allow some redundancy and the ability for a drive to die and us to still function until we get another drive.

Do I have to cread a raidtab file first?
 
Old 12-03-2004, 10:04 AM   #8
Sketch
LQ Newbie
 
Registered: Jun 2001
Location: Washington, D.C.
Distribution: Fedora Core 3
Posts: 16

Rep: Reputation: 0
You need to partition your hdd exactly the same way as your hda. Your RAID intended partitions must be set to fd. Each drive should have a /boot partition with the boot flag set. This means that If you want to have a 10GB /usr partition, you'll want to setup /dev/hda2 and /dev/hdd2 to be 5GB each with partition types of fd. Or whatever.

Your /etc/raidtab file needs to be configured along the lines of:
Code:
raiddev /dev/md0
     raid-level     5
     nr-raid-disks     2
     chunk-size     32
     persistent-superblock     1
     parity-algorithm     left-symmetric
     device /hda2
     raid-disk 0
     device /hdd2
     raid-disk 1
Put one raiddev entry for each mountpoint you intend to have.

Then edit your /etc/fstab file so the mounts will be mounted when you bootup.

All you gotta do then is do a mkraid /dev/md0 (md1,md2...) for each raid device.

Make sure you format the RAID devices with whatever filesystem you want it to use (mke2fs -j for instance).

Then type raidstart /dev/md0 (md1, md2, etc) to get the array running.

Does that help?
 
Old 12-03-2004, 10:07 AM   #9
Sketch
LQ Newbie
 
Registered: Jun 2001
Location: Washington, D.C.
Distribution: Fedora Core 3
Posts: 16

Rep: Reputation: 0
You posted before I finfished. RAID 1 will not allow you to access your data in case of drive failure without replacing the drive and rebuilding the array.
 
Old 12-03-2004, 10:24 AM   #10
gmanigault
LQ Newbie
 
Registered: Dec 2004
Posts: 16

Original Poster
Rep: Reputation: 0
Thanks

Yes it helps but raises a few questions.

1. I have and extended partition on the hda and the swap space is in that extended partition.

Do I setup the hdd with that same sizes of the partitions and then change the type to fd?

2. Once hda is sized with that same partition layout do I then change hda's id types to fd?

3. Your statement below.

"Make sure you format the RAID devices with whatever filesystem you want it to use (mke2fs -j for instance)."

Do I run this on just hdd and all the partitions?
Do I run this on both hdd and hda? If so isn't it a destructive command to any date on the drives?

Thanks.
 
Old 12-03-2004, 10:39 AM   #11
Sketch
LQ Newbie
 
Registered: Jun 2001
Location: Washington, D.C.
Distribution: Fedora Core 3
Posts: 16

Rep: Reputation: 0
To be honest, You don't need dual swap space. You just need to figure out how many RAID partitions you need between the two disks and make sure the partitions on each drive reflect that. If you need 3 RAID devices, then you set it all up so you have three partitions on each drive that match in size, one for one.

You change the partition type with fdisk from the fdisk commandline. The t option will allow you to choosed the fd type. You do realize you are changing the types of the partitions, not the disk right?

Finally, once you start the RAID devices, they are seen by Linux as a single device/partition. It is this device/partition that you format. You don't format the partitions on each drive. You format them as a single RAID device! As long as you run it on the device (/dev/md0) or whatever, it is not damaging to anything.

Aaron
 
Old 12-03-2004, 11:36 AM   #12
gmanigault
LQ Newbie
 
Registered: Dec 2004
Posts: 16

Original Poster
Rep: Reputation: 0
This is what I have so far.

This is what I have from and fdisk stand point. Notice the type f and 82 on hda. Do I need to ceate those on hdd also and should they be setup as linux raid autodetect?


=====

[root@area51test ftp]# fdisk -l

Disk /dev/hdd: 200.0 GB, 200049647616 bytes
255 heads, 63 sectors/track, 24321 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot Start End Blocks Id System
/dev/hdd1 * 1 1912 15358108+ fd Linux raid autodetect
/dev/hdd2 1913 11473 76798732+ fd Linux raid autodetect
/dev/hdd3 11474 17847 51199155 fd Linux raid autodetect

Disk /dev/hda: 200.0 GB, 200049647616 bytes
255 heads, 63 sectors/track, 24321 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot Start End Blocks Id System
/dev/hda1 * 1 1912 15358108+ fd Linux raid autodetect
/dev/hda2 1913 11473 76798732+ fd Linux raid autodetect
/dev/hda3 11474 17847 51199155 fd Linux raid autodetect
/dev/hda4 17848 24321 52002405 f Win95 Ext'd (LBA)
/dev/hda5 17848 19122 10241406 82 Linux swap
[root@area51test ftp]#
 
Old 12-03-2004, 11:51 AM   #13
gmanigault
LQ Newbie
 
Registered: Dec 2004
Posts: 16

Original Poster
Rep: Reputation: 0
What I have so far

This is my raidtab file. You can see how it relates to the fdisk -l settings. Let me know if you see anything wrong or that won't work. Thanks.
=====
raiddev /dev/md0
raid-level 1
nr-raid-disks 2
chunk-size 64
persistent-superblock 1
#nr-spare-disks 0
device /dev/hda1
raid-disk 0
device /dev/hdd1
raid-disk 1

raiddev /dev/md1
raid-level 1
nr-raid-disks 2
chunk-size 64
persistent-superblock 1
#nr-spare-disks 0
device /dev/hda2
raid-disk 0
device /dev/hdd2
raid-disk 1

raiddev /dev/md2
raid-level 1
nr-raid-disks 2
chunk-size 64
persistent-superblock 1
#nr-spare-disks 0
device /dev/hda3
raid-disk 0
device /dev/hdd3
raid-disk 1


=====
[root@area51test ftp]# fdisk -l

Disk /dev/hdd: 200.0 GB, 200049647616 bytes
255 heads, 63 sectors/track, 24321 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot Start End Blocks Id System
/dev/hdd1 * 1 1912 15358108+ fd Linux raid autodetect
/dev/hdd2 1913 11473 76798732+ fd Linux raid autodetect
/dev/hdd3 11474 17847 51199155 fd Linux raid autodetect

Disk /dev/hda: 200.0 GB, 200049647616 bytes
255 heads, 63 sectors/track, 24321 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot Start End Blocks Id System
/dev/hda1 * 1 1912 15358108+ fd Linux raid autodetect
/dev/hda2 1913 11473 76798732+ fd Linux raid autodetect
/dev/hda3 11474 17847 51199155 fd Linux raid autodetect
/dev/hda4 17848 24321 52002405 f Win95 Ext'd (LBA)
/dev/hda5 17848 19122 10241406 82 Linux swap
 
Old 12-03-2004, 12:01 PM   #14
Sketch
LQ Newbie
 
Registered: Jun 2001
Location: Washington, D.C.
Distribution: Fedora Core 3
Posts: 16

Rep: Reputation: 0
I can't be sure, but I don't think you want to RAID your /boot partition. If hda1 is your boot partition, then I think you should start the partitions that you want to RAID on hda2. Other than that, everything looks okay to me. Admittedly, I'm looking at this while I'm trying to do work so I can get paid, but a cursory glance looks about right.

Aaron
 
Old 12-04-2004, 11:47 AM   #15
gmanigault
LQ Newbie
 
Registered: Dec 2004
Posts: 16

Original Poster
Rep: Reputation: 0
More questions

As usual, there are more questions as you get closer to finishing.

I have the following.

1. I am trying to do mkraid /dev/md1 and /dev/md2. This will mirror everything from my first drive to the second except the swap file which I understand is not necessary to mirror. I get the following error message when I try it.

error - /var device is busy.

I tried to do a umount /var and it says that it is successful but it still shows busy.

I assume that you cannot mount a device while processes are still running. How can I successfully umount each of the other partitions that I want to create raid devices for?

2. Once that is done do I then do a mkefs on the md0, md1 and md2 so that they are formatted?

3. Last I have read about a utility called mdadm which allows you to create and manage raid devices. Is this useful or should I stick with mkraid and the other tools?

Signed the confusion is clearing... I think..

Gary
 
  


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
SCSI RAID Configuration desnotes Linux - General 4 09-12-2005 09:31 AM
How many drives do I have? What is my RAID configuration? hrock Linux - Newbie 6 09-18-2004 08:00 AM
setup/configuration util for PERCRAID RAID 5 liushuai Linux - Hardware 0 08-06-2004 08:46 AM
Can this be done (raid configuration) RaceTM Linux - Hardware 8 03-04-2004 07:56 AM
RAID Configuration ritesh_aladdin Linux - Hardware 2 02-21-2004 11:05 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

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