LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (https://www.linuxquestions.org/questions/linux-general-1/)
-   -   hardware raid (https://www.linuxquestions.org/questions/linux-general-1/hardware-raid-852945/)

darksaurian 12-28-2010 10:53 PM

hardware raid
 
I've been trying to setup hardware raid with the built in raid that comes with my m4a785td-m asus motherboard. I think I configured it correctly in the bios.

In SATA Configuration menu I got this:
OnChip SATA Channel [Enabled]
SATA Port1 - Port4 [RAID]
SATA Port5 - Port6 [RAID]

Later I did ctrl-f and opened the bios RAID thing. I picked "Define LD" and I did this:

RAID 0
Stripe Bock: 64kb
Fast Init: On
Cache Mode: WriteThru

And then I added my two drives. It says Total Drv = 2 and Capacity is what both combined would be and Status=Functional.

Now when computer reboots it says 2+0 RAID zero and lists only one drive with double capacity so it seems like I successfully merged the two drives.

But now in /dev I still have /dev/sda and /dev/sdb which are my two separate drives. Isn't there a drive name somewhere for the combined RAID0 drive?

rhadmn 12-28-2010 11:02 PM

Hi,

In /dev directory the disks would be listed.
Check whether the same is appearing in /sbin/fdisk -l output.Hopefully it should show the combined disk name.

darksaurian 12-28-2010 11:06 PM

Tried that already. It's just showing sda and sdb. Both 500.1 GB, 255 heads, etc. I don't understand.
EDIT:
I wonder if I have to pick a different kernel to boot with?

kforbus 12-28-2010 11:18 PM

Since you used the BIOS options to setup the RAID, I'm guessing that this fits the bill of "fakeraid". You may want to try searching for ways to get Linux to recognize fakeraid. Or you could change the BIOS options back and just setup software RAID in Linux. Either way, the CPU is dealing with the overhead since there probably isn't a true dedicated hardware RAID controller present. Granted, I could be wrong as I'm not 100% familiar with the fakeraid concept (just did a few quick searches).

darksaurian 12-28-2010 11:22 PM

Yeah I was kind of reading about software vs. hardware RAID today, it seems like software RAID usually wins. I was just trying hardware RAID because I thought it would be easier to setup; I thought I would just get a /dev/blah and then use it like a single hard disk. But it doesn't seem to be working. Not sure what "fakeraid" is. I'm going to try reading about that now.

I wonder if I should have posted this in the Slackware forum. Maybe I should alert a mod to move it.

kforbus 12-28-2010 11:29 PM

Actually, I'd vote in favor of hardware RAID. But what most motherboard manufacturers and makers of cheaper RAID controllers have been implementing has been given the name "fakeraid". It isn't really true hardware RAID. It's more comparable to software RAID.

darksaurian 12-28-2010 11:31 PM

Yeah I think my motherboard has fakeraid. (I'm not quite sure yet.) It looks like getting Slackware to use fakeraid is as much of a pain as setting up software RAID and it's less good. So I'd probably be better off setting up software RAID.

crts 12-29-2010 07:15 AM

Quote:

Originally Posted by darksaurian (Post 4206173)
Yeah I think my motherboard has fakeraid. (I'm not quite sure yet.) It looks like getting Slackware to use fakeraid is as much of a pain as setting up software RAID and it's less good. So I'd probably be better off setting up software RAID.

Hi,

I recently also started to use raid and found the matter of fakeraid and true hardware raid a bit confusing at first. After some research I came to the following conclusion:
True Hardware RAID:
It usually is some additional and very expensive (in the range of a new computer?) piece of hardware. This will indeed expose your Harddisks as ONE disk to your OS (and even your BIOS?).

fakeraid:
That is what usually is on the motherboard. Harddisks are still exposed as separate disks to the OS. If I understood it correctly then your OS will still need some drivers to address the array.

Software RAID:
Has a bit more computational overhead when accessing the disks. However, the performance (read/write speed) is still ?better? than fakeraid.

As my question marks indicate I am also not an expert on the subject. If anyone has more info on this, feel free to share and correct me.


Setting up software raid might seem a bit confusing at first, but it is really not. Once you have decided which raid you want to use, setting it up with mdadm is not that complicated.
Very useful links:
http://tldp.org/HOWTO/Software-RAID-HOWTO.html
http://tldp.org/HOWTO/Software-RAID-HOWTO-5.html#ss5.5

The only tricky part is formatting the raid device. You have to take the stripe size into consideration. Look here:
http://tldp.org/HOWTO/Software-RAID-HOWTO-5.html#ss5.10
http://tldp.org/HOWTO/Software-RAID-HOWTO-5.html#ss5.11

Finally, what you need to understand is that raiding two disks doubles the risk of data loss. Since RAID-0 has no redundancy this means that if one of your raided disk fails then ALL your data is irreparably damaged!

darksaurian 12-29-2010 05:24 PM

I've been reading this one:
http://mirror.leaseweb.com/slackware...EADME_RAID.TXT

I think I'm gonna try it right now.

crts 12-29-2010 06:12 PM

Quote:

Originally Posted by darksaurian (Post 4207092)
I've been reading this one:
http://mirror.leaseweb.com/slackware...EADME_RAID.TXT

I think I'm gonna try it right now.

A good and comprehensive guide. However, it does not cover the formatting issue when using a striped array. Have a look at the links I provided above before you run mke2fs.

darksaurian 12-29-2010 08:53 PM

The link I posted doesn't say anything about "/etc/raidtab". It never uses "mkraid". It never mentions "mke2fs". The links you posted don't even mention mke2fs until RAID-4.

So I'm wondering what if I just followed the instructions in my link for RAID-0 and never addressed chunk size and I never bothered switching to the generic kernel? Is the 30MB enough for my huge.s kernel or whatever I defaulted to? Did RAID-0 get setup? How can I tell for sure and where can I see what chunk sizes it defaulted to?

I looked for "/etc/raidtab" and it doesn't exist.
EDIT:
Oh, wait, I think /proc/mdstat is the answer. I gotta switch to my other computer and then I can post output.
EDIT:
Here we go:
Code:

darksaurian@darkswamp:~$ cat /proc/mdstat
Personalities : [linear] [raid0] [raid1] [raid10] [raid6] [raid5] [raid4] [multipath]
md2 : active raid1 sdb1[1] sda1[0]
      40064 blocks [2/2] [UU]
     
md1 : active raid1 sdb2[1] sda2[0]
      16787840 blocks [2/2] [UU]
     
md0 : active raid0 sdb3[1] sda3[0]
      943111680 blocks 64k chunks
     
unused devices: <none>
darksaurian@darkswamp:~$

Looks to me like it's working and it's defaulted to 64k chunks?

crts 12-29-2010 09:19 PM

Like any other device, you will have to put a filesystem on it. You cannot use it as is. So when you format it you will have to pass the appropriate parameters to mke2fs. You can obtain info on your array by
cat /proc/mdstat
sudo mdadm --misc --query /dev/md0
sudo mdadm --misc --detail /dev/md0

The manpage states that the default chunk size is 64kB.
Quote:

Is the 30MB enough for my huge.s kernel or whatever I defaulted to?
I guess you are referring to the size of the /boot partition. I am not sure about the requirements for slack, but my files in the /boot folder take up 140MB at the moment. It might get more. As stated in your link those 30MB are only a minimum requirement. 100MB would be better.
I personally always reserve 500MB for /boot.

darksaurian 12-29-2010 09:33 PM

Well my computer is working fine so does that mean the 30MB /boot partition was adequate? What would happen if it ran out of room?
I think I only used 74% of the /boot partition so I'm okay, right?:
Code:

root@darkswamp:~# df
Filesystem          1K-blocks      Used Available Use% Mounted on
/dev/root            928312296  5518244 875638468  1% /
/dev/md2                38792    27187      9602  74% /boot
tmpfs                  1682204        0  1682204  0% /dev/shm
root@darkswamp:~#

Code:

root@darkswamp:~# fdisk -l

Disk /dev/sda: 500.1 GB, 500107862016 bytes
255 heads, 63 sectors/track, 60801 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x3f6db485

  Device Boot      Start        End      Blocks  Id  System
/dev/sda1              1          5      40131  fd  Linux raid autodetect
/dev/sda2              6        2095    16787925  fd  Linux raid autodetect
/dev/sda3            2096      60801  471555945  fd  Linux raid autodetect

Disk /dev/sdb: 500.1 GB, 500107862016 bytes
255 heads, 63 sectors/track, 60801 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00ea0e5b

  Device Boot      Start        End      Blocks  Id  System
/dev/sdb1              1          5      40131  fd  Linux raid autodetect
/dev/sdb2              6        2095    16787925  fd  Linux raid autodetect
/dev/sdb3            2096      60801  471555945  fd  Linux raid autodetect

Disk /dev/md0: 965.7 GB, 965746360320 bytes
2 heads, 4 sectors/track, 235777920 cylinders
Units = cylinders of 8 * 512 = 4096 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 65536 bytes / 131072 bytes
Disk identifier: 0x00000000

Disk /dev/md0 doesn't contain a valid partition table

Disk /dev/md1: 17.2 GB, 17190748160 bytes
2 heads, 4 sectors/track, 4196960 cylinders
Units = cylinders of 8 * 512 = 4096 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000

Disk /dev/md1 doesn't contain a valid partition table

Disk /dev/md2: 41 MB, 41025536 bytes
2 heads, 4 sectors/track, 10016 cylinders
Units = cylinders of 8 * 512 = 4096 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000

Disk /dev/md2 doesn't contain a valid partition table
root@darkswamp:~#

I was installing Slackware from scratch. I ran the setup utility after creating the RAID arrays with mdadm and then it offered to format my mdX partitions so I let it. I don't think I ever have to use mke2fs. I think I'm done?

crts 12-29-2010 09:37 PM

Just saw your edit after I posted.
Read the man page for mke2fs. This is the raid specific part:
Quote:

-E extended-options
Set extended options for the filesystem. Extended options are comma separated, and may take an argument
using the equals ('=') sign. The -E option used to be -R in earlier versions of mke2fs. The -R option
is still accepted for backwards compatibility. The following extended options are supported:

stride=stride-size
Configure the filesystem for a RAID array with stride-size filesystem blocks. This is the
number of blocks read or written to disk before moving to the next disk, which is sometimes
referred to as the chunk size. This mostly affects placement of filesystem metadata like
bitmaps at mke2fs time to avoid placing them on a single disk, which can hurt performance.
It may also be used by the block allocator.

stripe-width=stripe-width
Configure the filesystem for a RAID array with stripe-width filesystem blocks per stripe.
This is typically stride-size * N, where N is the number of data-bearing disks in the RAID
(e.g. for RAID 5 there is one parity disk, so N will be the number of disks in the array
minus 1). This allows the block allocator to prevent read-modify-write of the parity in a
RAID stripe if possible when the data is written.

Since your raid1 arrays are not striped this only applies for your /dev/md0. I am going to assume that you will explicitly choose a block-size of 4096 kB when you format the array. In this case the options would be
stride=16
stripe-width=32

If you choose another block-size then make sure that the following equations are fulfilled
stride-size * block-size = chunk-size
stripe-width = N * stride-size

where N is 2 in your case.

[EDIT]
You beat me again while I was posting. I recommend to do the formatting manually at least for the RAID-0 array.

darksaurian 12-29-2010 10:04 PM

Well maybe I should have but I didn't. I just let the Slackware installer put ext4 on md0. I haven't read up on or used mke2fs yet. My computer is working fine so maybe I'm suffering some drawbacks by not manually formatting md0 with mke2fs but I think RAID-0 is functioning.


All times are GMT -5. The time now is 10:21 AM.