PDA

View Full Version : How to setup a Raid1 Array(Fedora 10)



Lopezadl2ian
20th February 2009, 03:54 AM
Hello,

I dont know to much about how to setup raid arrays in Linux but I have two HDD drives that are exactly the same and I want to setup a Raid 1 array. I currently have Raid options with my motherboard(GA-EX58-UD4P Gigabyte). Also when I partitioned the HDD with the initial install I selected to partition on both HDDA and HDDB. What does that exactly do? Do I have a copy of HDDA on HDDB? Another note, I have the HDDS set to Raid in BIOS but disabled this function when POST starts, it tells me to press Ctrl+G to configure HDDS. I currently have the HDD set to non-raid so that I could install Fedora since it doesnt have any Raid suppot at install. Thanks.

knesenko
20th February 2009, 09:17 PM
The first stage is to format your hard disks and give them RAID type.Then run

su -
mdadm -C /dev/md0 -a yes -l 1 -n 2 /dev/hd{a,d} -this will create RAID 1
mkfs -t ext3 /dev/md0 -creates ext3 filesystem on your RAID 1

Your hard drives are:
HDDA-/dev/hda
HDDB-/dev/hdb

Lopezadl2ian
21st February 2009, 07:01 AM
What command can I use to see how my HDD are configured? Im showing that my HDD are combined and are in possible Raid1 but how would I really know?

knesenko
21st February 2009, 12:19 PM
What kind of partition do you want?primary or extended?

knesenko
21st February 2009, 12:27 PM
For primary partition:

[root@jack ~]# fdisk /dev/hda

Command (m for help): n
Command action
e extended
p primary partition (1-4)
p
Partition number (1-4): 1
First cylinder (1-207, default 1):
Using default value 1
Last cylinder or +size or +sizeM or +sizeK (1-207, default 207):
Using default value 207

Command (m for help): p

Disk /dev/hda: 106 MB, 106954752 bytes
16 heads, 63 sectors/track, 207 cylinders
Units = cylinders of 1008 * 512 = 516096 bytes

Device Boot Start End Blocks Id System
/dev/hda1 1 207 104296+ 83 Linux

Command (m for help): t
Selected partition 1
Hex code (type L to list codes): fd
Changed system type of partition 1 to fd (Linux raid autodetect)

Command (m for help): p

Disk /dev/hda: 106 MB, 106954752 bytes
16 heads, 63 sectors/track, 207 cylinders
Units = cylinders of 1008 * 512 = 516096 bytes

Device Boot Start End Blocks Id System
/dev/hda1 1 207 104296+ fd Linux raid autodetect

Command (m for help): w
The partition table has been altered!

Calling ioctl() to re-read partition table.
Syncing disks.
[root@jack ~]# partprobe
[root@jack ~]#



For extended:

[root@jack ~]# fdisk /dev/hda

Command (m for help): n
Command action
e extended
p primary partition (1-4)
e
Partition number (1-4): 1
First cylinder (1-207, default 1):
Using default value 1
Last cylinder or +size or +sizeM or +sizeK (1-207, default 207):
Using default value 207

Command (m for help): p

Disk /dev/hda: 106 MB, 106954752 bytes
16 heads, 63 sectors/track, 207 cylinders
Units = cylinders of 1008 * 512 = 516096 bytes

Device Boot Start End Blocks Id System
/dev/hda1 1 207 104296+ 5 Extended

Command (m for help): n
Command action
l logical (5 or over)
p primary partition (1-4)
l
First cylinder (1-207, default 1):
Using default value 1
Last cylinder or +size or +sizeM or +sizeK (1-207, default 207):
Using default value 207

Command (m for help): p

Disk /dev/hda: 106 MB, 106954752 bytes
16 heads, 63 sectors/track, 207 cylinders
Units = cylinders of 1008 * 512 = 516096 bytes

Device Boot Start End Blocks Id System
/dev/hda1 1 207 104296+ 5 Extended
/dev/hda5 1 207 104265 83 Linux

Command (m for help): t
Partition number (1-5): 5
Hex code (type L to list codes): fd
Changed system type of partition 5 to fd (Linux raid autodetect)

Command (m for help): p

Disk /dev/hda: 106 MB, 106954752 bytes
16 heads, 63 sectors/track, 207 cylinders
Units = cylinders of 1008 * 512 = 516096 bytes

Device Boot Start End Blocks Id System
/dev/hda1 1 207 104296+ 5 Extended
/dev/hda5 1 207 104265 fd Linux raid autodetect

Command (m for help): w
The partition table has been altered!

Calling ioctl() to re-read partition table.
Syncing disks.
[root@jack ~]# partprobe
[root@jack ~]#