Set Partitionable Software RAID-6 on OpenSlug
It works for me, it might even work for you :)
Step One: Making Space
This step is only necessary if you haven't turned up your Slug onto and external hard drive or memory device, and are still running with your root on the internal jffs2 file system.
To check use
Filesystem 1k-blocks Used Available Use% Mounted on /dev/mtdblock4 6528 6036 492 92% /
then your root is still using Slug's internal memory. There isn't much space left there and we need to install a few packages. So I uninstalled a few things I did not expect to be needing. Your choice may be different.
#ipkg remove lrzsz #ipkg remove reiserfsprogs #ipkg remove reiserfsprogs-reiserfsck #ipkg remove reiserfsprogs-mkreiserfs
That gave me enough space.
Step Two: Installing the Software
This will bring your package database up to date.
I strongly recommend installing
#ipkg install udev #ipkg install udev-utils
OpenSlug does not come with RAID functionality, so we need to install it too:
#ipkg install kernel-module-raid6
If thigs go according to plan,
Now install the management tool:
#ipkg install mdadm
Last step: let the kernel know about all these wonderful modules:
Some kernel modules invoke
Step Three: Creating Partitions
This is not an
Within fdisk menu use
Disk /dev/sda: 65 MB, 65536000 bytes 8 heads, 32 sectors/track, 500 cylinders Units = cylinders of 256 * 512 = 131072 bytes Device Boot Start End Blocks Id System /dev/sda1 1 500 63984 83 Linux
In this case the math is simple: 131072 bytes/cylinder * 500 cylinders = 6553600 bytes. If you see any messages about physical and logical parameters of the partition being different - take your time and sort it out. (I ignored it first time around at my own peril)
Create a partition for your raid (it does not usually make much sence to have multiple partitions of the same drive withing the same array).
Rinse and repeat for every component of your future array.
Now on with the fun.
Step Four: Creating RAID
OpenSlug kernel does NOT load RAID module automatically. (Correct me if I am wrong!) In the long run you should probably put something into your
For now let's do it manually:
#lsmod Module Size Used by ixp425_eth 15364 0 ixp400 615208 1 ixp425_eth #modprobe raid6 #lsmod Module Size Used by raid6 90896 1 md 31508 3 raid6 xor 4008 1 raid6 ixp425_eth 15364 0 ixp400 615208 1 ixp425_eth
You guessed it!
If you have been running RAID and some of your devices have been a part of it, it would halp to run
I created a partitionable array with two partitions (see the
Now, let's create the array:
#mdadm --create --verbose /dev/raid6iv --level=6 --chunk=32 \ --raid-devices=6 --auto=p2 /dev/sda1 /dev/sdb1 /dev/sdc1 \ /dev/sdd1 /dev/sde1 /dev/sdf1
mdadm: layout defaults to left-symmetric mdadm: /dev/sdb1 appears to contain an ext2fs file system
size=63872K mtime=Fri Apr 7 23:22:40 2006
mdadm: /dev/sdd1 appears to contain an ext2fs file system
size=58608K mtime=Tue Jan 3 06:58:10 2006
mdadm: size set to 63872K Continue creating array? y mdadm: array /dev/raid6iv started.
Since you have followed the links above and enthusiastically absorbed every detail ;-) very little comment is needed: clearly I reused a couple of partitions and
You can see that I named my device
Are we done yet? - Almost.
Let's confirm that our RAID is alive and kicking:
# cat /proc/mdstat Personalities : [raid6] md_d0 : active raid6 sdf1 sde1 sdd1 sdc1 sdb1 sda1 255488 blocks level 6, 32k chunk, algorithm 2 [6/6] [UUUUUU] [==========>..........] resync = 53.9% (35232/63872) finish=0.5min
It is syncing the drives now, but will be done soon.
Step Five: Finishing Up
#fdisk /dev/raid6iv1 #fdisk /dev/raid6iv2
The device names associated with the raid partitions on your system will be different from mine, but they are created automatically, no thinking required :-)
In case of flash memory the "physical" parameters of the device are likely to be WRONG. And so if you accept the default value you may end up with a partition bigger than the array. That's bad. So go to Step Three above, and use the check shown to confirm that the numbers do add up. Then create the partitions.
Format them with the filesystem of your choice. For ext2/ext3 there are important performance considerations covered here
# mke2fs -j -b 4096 -R stride=8 /dev/raid6iv1 mke2fs 1.38 (30-Jun-2005) Filesystem label= OS type: Linux Block size=4096 (log=2) Fragment size=4096 (log=2) 49408 inodes, 49404 blocks 2470 blocks (5.00%) reserved for the super user First data block=0 2 block groups 32768 blocks per group, 32768 fragments per group 24704 inodes per group Superblock backups stored on blocks: 32768 Writing inode tables: done Creating journal (4096 blocks): done Writing superblocks and filesystem accounting information: done This filesystem will be automatically checked every 38 mounts or 180 days, whichever comes first. Use tune2fs -c or -i to override.
You are DONE! Congratulations! Go ahead, mount your filesystem wherever you want, live long and prosper.
Part Six: Housekeeping Considerations
Figure it out and add to this document. Good luck!