NSLU2-Linux
view · edit · print · history

HowTo.EnableRAIDSupport History

Hide minor edits - Show changes to markup

February 16, 2005, at 10:46 AM by dyoung --
Added lines 7-8:

If you don't understand the commands listed below DO NOT ATTEMPT THIS.

February 16, 2005, at 10:43 AM by dyoung --
Added lines 5-6:

In fact, DO NOT ATTEMPT THIS unless you are *ABSOLUTELY* sure you know what youre doing. You can LOSE DATA if you are not careful when constructing the RAID.

February 11, 2005, at 02:33 AM by glc --
Changed lines 94-96 from:
 =]
to:
February 09, 2005, at 12:05 PM by dyoung --
Added lines 3-4:

Before attempting this, be sure you know how RAID works under Linux.

Changed line 9 from:
  1. Disable USB_Detect
to:
  1. Disable USB_Detect, and possibly rc.bootbin using diversion scripts.
Changed line 38 from:
 # ./busybox.dy hdparm -t /dev/md0
to:
 # ./busybox hdparm -t /dev/md0
Changed line 73 from:
 # ./busybox.dy hdparm -t /dev/md0
to:
 # ./busybox hdparm -t /dev/md0
Changed line 94 from:
 =]
to:
 =]
January 01, 2005, at 11:01 PM by dyoung --
Deleted line 5:
  1. Build a special BusyBox that includes fdisk from Unslung CVS
Changed line 8 from:
  1. Using the BusyBox fdisk built in (4), change the partition type to fd (raid autodetect)
to:
  1. Using the BusyBox fdisk (call it like "/opt/bin/busybox fdisk /dev/sdx?), change the partition type to fd (raid autodetect)
January 01, 2005, at 09:39 PM by rwhitby --
Changed line 3 from:
  1. Build the -able firmware using OE.
to:
  1. Build the Unslung 3.x or later firmware using OE.
December 26, 2004, at 09:39 PM by rwhitby --
Changed line 1 from:

RAID can be enabled in the -able family of Unslung-2.x firmware.

to:

RAID can be enabled in the -able family of Unslung-2.x firmware or in the -standard family of Unslung 3.x firmware.

December 07, 2004, at 01:36 AM by ChrisE --
Changed line 4 from:
  1. Build mdadm from Unslung CVS.
to:
  1. Download the mdadm ipk.
December 06, 2004, at 09:42 PM by garethpaulwebber --
Added line 12:
  1. Unmount the drives that will form the raid array (e.g. umount /dev/sda)
November 08, 2004, at 05:19 AM by Gerald L Clark --
Changed line 10 from:
  1. ipkg install kernel-module-md kernel-module-raid1 (or raid0 if you prefer.) This will require access to the ipk directory created from the oe build, and a change to /etc/ipkg.conf to make it accessable. Expect depmod errors when loading installing these packages.
to:
  1. ipkg install kernel-module-md kernel-module-raid1 (or raid0 if you prefer.) This will require access to the ipk directory created from the oe build, and a change to /etc/ipkg.conf to make it accessable. Expect depmod errors when installing these packages.
November 08, 2004, at 05:12 AM by Gerald L Clark --
Changed line 10 from:
  1. ipkg install kernel-module-md kernel-module-raid1 (or raid0 if you prefer)
to:
  1. ipkg install kernel-module-md kernel-module-raid1 (or raid0 if you prefer.) This will require access to the ipk directory created from the oe build, and a change to /etc/ipkg.conf to make it accessable. Expect depmod errors when loading installing these packages.
Added lines 77-92:

Add a /etc/mdadm.conf file such as:

 
DEVICE /dev/sd[ab]1
ARRAY /dev/md0 devices=/dev/sda1,/dev/sdb1
        level=1
        num-devices=2
 

You will need to add lines to your diversion scripts. The following may be added to rc.local:

 
/opt/sbin/insmod md
/opt/sbin/insmod raid1
/opt/sbin/mdadm -As
 
November 04, 2004, at 09:47 PM by tman --
Changed line 1 from:

RAID can be enabled in the -able family of UNSLUNG-2.x firmware.

to:

RAID can be enabled in the -able family of Unslung-2.x firmware.

Changed lines 3-13 from:
 1) Build the -able firmware using OE.
 2) Build mdadm from Unslung CVS.
 3) format 2 identical disks using the NSLU2 web interface
 4) Build a special busybox that includes fdisk from Unslung CVS
 5) Unsling
 6) Disable USB_Detect
 7) Using the busybox built in (4), change the partition type to fd (raid autodetect)
 8) ipkg install kernel-module-md kernel-module-raid1 (or raid0 if you prefer)
 9) mknod /dev/md0 b 9 0 
 10) Create the raid with mdadm.
 11) done.
to:
  1. Build the -able firmware using OE.
  2. Build mdadm from Unslung CVS.
  3. Format 2 identical disks using the NSLU2 web interface
  4. Build a special BusyBox that includes fdisk from Unslung CVS
  5. Unsling
  6. Disable USB_Detect
  7. Using the BusyBox fdisk built in (4), change the partition type to fd (raid autodetect)
  8. ipkg install kernel-module-md kernel-module-raid1 (or raid0 if you prefer)
  9. mknod /dev/md0 b 9 0
  10. Create the RAID array with mdadm.
  11. Done.
November 04, 2004, at 10:15 AM by dyoung --
Changed lines 11-12 from:
 9) Create the raid with mdadm.
 10) done.
to:
 9) mknod /dev/md0 b 9 0 
 10) Create the raid with mdadm.
 11) done.
Added lines 24-25:
 # mke2fs -j /dev/md0
 (messages)
Changed lines 59-79 from:
 mke2fs 1.34 (25-Jul-2003)
 Filesystem label=
 OS type: Linux
 Block size=4096 (log=2)
 Fragment size=4096 (log=2)
 10010624 inodes, 20008384 blocks
 1000419 blocks (5.00%) reserved for the super user
 First data block=0
 611 block groups
 32768 blocks per group, 32768 fragments per group
 16384 inodes per group
 Superblock backups stored on blocks: 
         32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208, 
         4096000, 7962624, 11239424

 Writing inode tables: done                            
 Creating journal (8192 blocks): done
 Writing superblocks and filesystem accounting information: done 

 This filesystem will be automatically checked every 22 mounts or
 180 days, whichever comes first.  Use tune2fs -c or -i to override.
to:
 (messages)
Changed line 61 from:
 # df
to:
 # df /mnt/tmpmnt
Deleted lines 62-64:
 rootfs                  123955     15465    107210  13% /
 /dev/sdb2               123955     15465    107210  13% /
 /dev/sdb2               123955     15465    107210  13% /share/flash/conf
November 04, 2004, at 10:12 AM by dyoung --
Added lines 33-38:
 # ./busybox.dy hdparm -t /dev/md0

 /dev/md0:
  Timing buffered disk reads:  64 MB in  7.42 seconds =  8.63 MB/sec

 #
Changed lines 91-94 from:
 # 
to:
 # ./busybox.dy hdparm -t /dev/md0

 /dev/md0:
  Timing buffered disk reads:  64 MB in  5.78 seconds = 11.07 MB/sec
Added line 96:
 #
November 04, 2004, at 10:09 AM by dyoung --
Changed line 14 from:

sample:

to:

sample raid1:

Changed lines 34-86 from:

Enjoy!

to:

sample raid0:

 # insmod raid0
 Using /lib/modules/2.4.22-xfs/kernel/drivers/md/raid0.o
 # ./mdadm --create --level=0 --raid-devices=2 /dev/md0 /dev/sda1 /dev/sdb1
 mdadm: /dev/sda1 appears to contain an ext2fs file system
     size=40016880K  mtime=Wed Nov  3 23:17:26 2004
 mdadm: /dev/sda1 appears to be part of a raid array:
     level=1 devices=2 ctime=Wed Nov  3 23:16:38 2004
 mdadm: /dev/sdb1 appears to contain an ext2fs file system
     size=40016880K  mtime=Wed Nov  3 23:17:26 2004
 mdadm: /dev/sdb1 appears to be part of a raid array:
     level=1 devices=2 ctime=Wed Nov  3 23:16:38 2004
 Continue creating array? y
 mdadm: array /dev/md0 started.
 # mke2fs -j /dev/md0
 mke2fs 1.34 (25-Jul-2003)
 Filesystem label=
 OS type: Linux
 Block size=4096 (log=2)
 Fragment size=4096 (log=2)
 10010624 inodes, 20008384 blocks
 1000419 blocks (5.00%) reserved for the super user
 First data block=0
 611 block groups
 32768 blocks per group, 32768 fragments per group
 16384 inodes per group
 Superblock backups stored on blocks: 
         32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208, 
         4096000, 7962624, 11239424

 Writing inode tables: done                            
 Creating journal (8192 blocks): done
 Writing superblocks and filesystem accounting information: done 

 This filesystem will be automatically checked every 22 mounts or
 180 days, whichever comes first.  Use tune2fs -c or -i to override.
 # mount /dev/md0 /mnt/tmpmnt
 # df
 Filesystem           1k-blocks      Used Available Use% Mounted on
 rootfs                  123955     15465    107210  13% /
 /dev/sdb2               123955     15465    107210  13% /
 /dev/sdb2               123955     15465    107210  13% /share/flash/conf
 /dev/md0              78777008     32828  74742504   0% /mnt/tmpmnt
 # cat /proc/mdstat
 Personalities : [raid0] [raid1] 
 read_ahead 1024 sectors
 md0 : active raid0 sdb1[1] sda1[0]
       80033536 blocks 64k chunks

 unused devices: <none>
 # 
November 04, 2004, at 09:49 AM by dyoung --
Changed lines 3-12 from:

1) Build the -able firmware using OE. 2) Build mdadm from Unslung CVS. 3) format 2 identical disks using the NSLU2 web interface 4) Build a special busybox that includes fdisk from Unslung CVS 5) Unsling 6) Disable USB_Detect 7) Using the busybox built in (4), change the partition type to fd (raid autodetect) 8) ipkg install kernel-module-md kernel-module-raid1 (or raid0 if you prefer) 9) Create the raid with mdadm. 10) done.

to:
 1) Build the -able firmware using OE.
 2) Build mdadm from Unslung CVS.
 3) format 2 identical disks using the NSLU2 web interface
 4) Build a special busybox that includes fdisk from Unslung CVS
 5) Unsling
 6) Disable USB_Detect
 7) Using the busybox built in (4), change the partition type to fd (raid autodetect)
 8) ipkg install kernel-module-md kernel-module-raid1 (or raid0 if you prefer)
 9) Create the raid with mdadm.
 10) done.
November 04, 2004, at 09:45 AM by dyoung --
Changed lines 1-34 from:

Describe EnableRAIDSupport here.

to:

RAID can be enabled in the -able family of UNSLUNG-2.x firmware.

1) Build the -able firmware using OE. 2) Build mdadm from Unslung CVS. 3) format 2 identical disks using the NSLU2 web interface 4) Build a special busybox that includes fdisk from Unslung CVS 5) Unsling 6) Disable USB_Detect 7) Using the busybox built in (4), change the partition type to fd (raid autodetect) 8) ipkg install kernel-module-md kernel-module-raid1 (or raid0 if you prefer) 9) Create the raid with mdadm. 10) done.

sample:

 # ./mdadm --create --level=1 --raid-devices=2 /dev/md0 /dev/sda1 /dev/sdb1
 mdadm: /dev/sda1 appears to contain an ext2fs file system
     size=40016880K  mtime=Wed Nov  3 23:08:47 2004
 mdadm: /dev/sdb1 appears to contain an ext2fs file system
     size=40016880K  mtime=Wed Nov  3 23:08:45 2004
 Continue creating array? y
 mdadm: array /dev/md0 started.
 # cat /proc/mdstat
 Personalities : [raid1] 
 read_ahead 1024 sectors
 md0 : active raid1 sdb1[1] sda1[0]
       40016768 blocks [2/2] [UU]
       [>....................]  resync =  0.2% (103040/40016768) finish=77.4min speed=8586K/sec
 unused devices: <none>
 # mount /dev/md0 /mnt/tmpmnt
 Filesystem           1k-blocks      Used Available Use% Mounted on
 /dev/md0              39388776     32832  38955776   0% /mnt/tmpmnt

Enjoy!

view · edit · print · history · Last edited by dyoung.
Based on work by dyoung, tman, Gerald L Clark, garethpaulwebber, ChrisE, rwhitby, and glc.
Originally by dyoung.
Page last modified on April 14, 2005, at 10:26 PM