PDA

Bekijk de volledige versie : Raid1



DrChair
09-03-2007, 16:01
I'm trying to create a RAID1 array on my WL-500gP, but I'm only partly successfull.

I'm running lastest oleg firmware (1.9.2.7-7f), and I'm using the oleg optware repository.

My crosscompile environment is VMware running Fedora core 6 (with gcc 3.4 instead of 4.1)



Steps I've taken :

- Recompile the firmware, with Multi-device support and RAID1 support enabled as modules.
(I also had to disable LPRng, otherwise the firmware wouldn't build)

- copy md.o and raid1.o from the crosscompile pc to /opt/lib/modules on the router

- Compile mdadm:
While crosscompiling, 'make mdadm' & 'make mdadm-ipk' both build fine, but installing mdadm_2.6-1_mipsel.ipk on the router fails on a md5-checksum
While native compiling, 'make mdadm' builds fine, but 'make mdadm-ipk' fails.
So I manually copied mdadm from optware/builds/mdadm/ to /opt/sbin

- Load the raid modules:
insmod /opt/lib/modules/md.o
insmod /opt/lib/modules/raid1.o

- for test purposes, I attached a usb-cardreader, with a 128 MB sd-card and a 128 MB cf-card.
- on both discs I created one partition of 122 MB , type fb (Linux raid autodetect)

-next step would be the creation of the raid-array:

mknod /dev/md0 b 9 0
mdadm --create /dev/md0 --level=1 --raid-devices=2 /dev/discs/disc1/part1 /dev/discs/disc3/part1

However this fails with the error:
mdadm: ADD_NEW_DISK for /dev/discs/disc1/part1 failed: Invalid argument

In the systemlog, I get the following messages:
kernel: md: invalid superblock checksum on scsi/host1/bus0/target0/lun0/part1
kernel: md: scsi/host1/bus0/target0/lun0/part1 has invalid sb, not importing!
kernel: md: md_import_device returned -22

The only raid-array I can create is a legacy array without a superblock:

mknod /dev/md0 b 9 0
mdadm --build /dev/md0 --level=1 --raid-devices=2 /dev/discs/disc1/part1 /dev/discs/disc3/part1

after that, I can see the array being build, using cat /proc/mdstat


Questions:
- what could be the reason that i can't build an array with superblocks?
(could it be that mdadm isn't compatible with the raid modules?)

- what are the risks when running a mirror without superblocks?

namiri
14-06-2008, 19:41
There is a CRC computing function bug in md.c source file.

This article describes this bug.
http://linux.derkeiler.com/Mailing-Lists/Kernel/2007-05/msg03410.html

Attaches:
- md.c fixed file
- compiled kernel modules *.o (place to /opt/lib/modules/2.4.20/kernel/drivers/md)

Sterke-Jerke
17-11-2008, 23:43
I recieved my WL-500gP V2 today, and before starting i have some questions:

I have a 120Gb USB drive and a 1Tb Usb drive (and a 1Gb CF Microdrive) ready to be used.

Can I:
- Mirror the 120Gb on to the 1 Tb. (raid 1)
- Use the remaining capacity from the 1Tb not mirrored (other partition)
- Do I really need 512Mb swap?
- Can I use the Microdrive for that?
- Use the remaing 512Mb for opt? (Should be enough?)
- Give some compliments to this forum?

wpte
18-11-2008, 00:10
I recieved my WL-500gP V2 today, and before starting i have some questions:

I have a 120Gb USB drive and a 1Tb Usb drive (and a 1Gb CF Microdrive) ready to be used.

Can I:
- Mirror the 120Gb on to the 1 Tb. (raid 1)
- Use the remaining capacity from the 1Tb not mirrored (other partition)
- Do I really need 512Mb swap?
- Can I use the Microdrive for that?
- Use the remaing 512Mb for opt? (Should be enough?)
- Give some compliments to this forum?

you can put it in raid 1

you won't be able to use the remaining capacity... golden rule of raid is: the lowest capacity is used, the rest is unused.

swap file is recommended to keep everything smooth

microdrive and swap don't go together really well, they usually crash after a few hours, or weeks... hdds don't

512mb for opt is ok, depends on what you want to do with it.

raas
18-11-2008, 12:52
Hi,

like wpte said, flash drives are going to wear-out after a given amount of time. Although the performance gain is impressive (mostly due to access-times), you will see strange errors after 4-5-6 months which you can't explain.

if you have so much storage (1tb) you absolutely need a swap partition for the memory (otherwise the asus can not address all the space).

If you don't need 'hardware/software' raid settings, put a swap, /opt and data partition on the 120gb. also put a data partition on the 1 tb, and use a scheduled script (cron) to duplicate important data from the 120gb to the 1tb. this way you'll have a second accessible backup.

Sterke-Jerke
18-11-2008, 13:16
Hi,

like wpte said, flash drives are going to wear-out after a given amount of time. Although the performance gain is impressive (mostly due to access-times), you will see strange errors after 4-5-6 months which you can't explain.


It is a mini harddisk drive (not flash memeory) in a CF casing.
I there also a limit on its live span?

PS.

About the unused diskspace, it is not possible to create a non-mirrored partition then?

wpte
19-11-2008, 10:41
It is a mini harddisk drive (not flash memeory) in a CF casing.
I there also a limit on its live span?

PS.

About the unused diskspace, it is not possible to create a non-mirrored partition then?


There is always a live span on things... however, a hdd will survive for a couple of years, defenately if you let spin it down:)

The problem with raid is, that in the most simple way, 2 hdd's have to write at the same time.
now to do this, the software will write/read to a driver, wich will split, or simultaneously write or read the drive...
now when you're doing this, you can't suddenly access some other part of 1 of the 2 disks and access some information...
with a nice driver it might be possible, however, the chance on harddrive errors will be huge

DrChair
20-11-2008, 22:47
you can put it in raid 1

you won't be able to use the remaining capacity... golden rule of raid is: the lowest capacity is used, the rest is unused.


If you're using hardware raid1, that golden rule is true.... However in this case, software raid1 is used.

If you create a 120 GB partition on the 1 TB disk, you can mirror the 120GB partition from disk1 onto the 120GB partition on disk2.

If both 120 GB partitions are not exactly the same size, then the golden rule kicks back in. (eg 119 mirrored to 120 results in 119)

Beware though that rebuilding a mirror can take a very long time (because limited usb-speed).

You should make sure that the mirror gets unmounted nicely in case of a reboot. You should also check different scenarios to see how the mirror holds up... e.g. a sudden lost of power, the spinning down when idle feature on some casings.

wpte
21-11-2008, 00:19
like I said... probably works bad :p
it just sounds dangerous to do, raid isn't really that stable mutch with only 2 disks I think. it works, but you really need to watch carefully what you're doing..
raid5 works nice tho

expert_vision
15-05-2011, 19:28
I have a WL500gPV2 with Oleg Firmware - WL500gpv2-1.9.2.7-d-r2710
I installed MDADM and now I need to load modules md and raid0.
I downloaded modules from here (http://wl500g.info/showpost.php?p=100562&postcount=2).

But now if I try to load them I get this error:

[admin@WL-00221561958C root]$ insmod /opt/lib/modules/md.o
insmod: unresolved symbol _clear_page
[admin@WL-00221561958C root]$ insmod /opt/lib/modules/raid0.o
insmod: ELF file not for this architecture
[admin@WL-00221561958C root]$ insmod /opt/lib/modules/raid1.o
insmod: unresolved symbol md_interrupt_thread

Does this mean I have to recompile them for my CPU (please say no :p)?

wpte
16-05-2011, 18:02
uhm... you need new ones for your kernel:p
these are compiled for kernel 2.4.20 but the latest 1.9.2.7-d firmware is at kernel 2.4.37.11 right now;)

you can also try the 1.9.2.7-rtn firmware for your wl-500gpv2, it has a kernel version 2.6.22.19:)