NSLU2-Linux
view · edit · print · history

HowTo.RAID1OnSlugOS History

Hide minor edits - Show changes to markup

January 08, 2008, at 12:17 PM by fcarolo -- formatting
Changed lines 47-48 from:

Before you move the root filesystem first properly initialise the Slug-OS further. This is described at InitialisingOpenSlug.

to:

Before you move the root filesystem first properly initialise the Slug-OS further. This is described at InitialisingOpenSlug. (Note that the link on the InitialisingDisks is linking to a document for OpenSlug 2.5 and we are on 3.10beta).

January 08, 2008, at 12:16 PM by fcarolo -- formatting
Changed lines 25-26 from:

Logon with the default root password, see [[OpenSlugDefaultPassword]. The password is likely opeNSLUg

to:

Logon with the default root password, see OpenSlugDefaultPassword. The password is likely opeNSLUg

January 08, 2008, at 12:16 PM by fcarolo -- formatting
Changed lines 17-18 from:

Details at UsingTheBinary?

to:

Details at UsingTheBinary

Changed lines 25-26 from:

Logon with the default root password, see OpenSlugDefaultPassword?. The password is likely opeNSLUg

to:

Logon with the default root password, see [[OpenSlugDefaultPassword]. The password is likely opeNSLUg

Changed lines 47-48 from:

Before you move the root filesystem first properly initialise the Slug-OS further. This is described at InitialisingOpenSlug (note that the link on the InitialiseDisks? is linking to a document for OpenSlug 2.5 and we are on 3.10beta).

to:

Before you move the root filesystem first properly initialise the Slug-OS further. This is described at InitialisingOpenSlug.

Changed line 174 from:
  1. Install and configure Samba, see GettingStartedWithSamba?
to:
  1. Install and configure Samba, see GettingStartedWithSamba
Changed lines 176-177 from:
 # root@NAS01?:/etc/dropbear# mv dropbear_rsa_host_key dropbear_rsa_host_key.orig
 # root@NAS01?:/etc/dropbear# dropbearkey -t rsa -f dropbear_rsa_host_key
to:
 # root@NAS01:/etc/dropbear# mv dropbear_rsa_host_key dropbear_rsa_host_key.orig
 # root@NAS01:/etc/dropbear# dropbearkey -t rsa -f dropbear_rsa_host_key
December 26, 2007, at 05:59 PM by js --
Added lines 172-178:

Additional steps

  1. Install and configure Samba, see GettingStartedWithSamba?
  2. Create a new ssh key to replace the key from the Slug-OS binary
    1. root@NAS01?:/etc/dropbear# mv dropbear_rsa_host_key dropbear_rsa_host_key.orig
    2. root@NAS01?:/etc/dropbear# dropbearkey -t rsa -f dropbear_rsa_host_key

After rebooting, during connect your ssh client will prompt you that the finger print has been changed. Accept the new key/finger print.

December 26, 2007, at 05:45 PM by js --
Deleted lines 171-174:

Additional steps

  1. Install and configure Samba, see GettingStartedWithSamba?
  2. Create a new ssh key to replace the key from the Slug-OS binary, see UseOpenSSHForRemoteAccess
December 26, 2007, at 12:51 PM by js -- Complete the How-To
Changed lines 170-175 from:

The configuration of the RAID-1 on Slug-OS is now completed.

to:

The configuration of the RAID-1 on Slug-OS is now completed.

Additional steps

  1. Install and configure Samba, see GettingStartedWithSamba?
  2. Create a new ssh key to replace the key from the Slug-OS binary, see UseOpenSSHForRemoteAccess
December 24, 2007, at 08:52 PM by js --
Changed lines 1-3 from:

(:title How to enable RAID1 on SluOS:)

Introduction

to:

(:title How to enable RAID1 on SlugOS:)

Introduction

Changed lines 6-7 from:

Step 1 Download the Slug-OS binary

to:

Step 1 Download the Slug-OS binary

Changed lines 10-11 from:

Step 2 Install upslug2

to:

Step 2 Install upslug2

Changed lines 15-16 from:

Step 3 Flash Slug-OS to the NSLU2

to:

Step 3 Flash Slug-OS to the NSLU2

Changed lines 21-22 from:

Step 4 Initialize the disks

to:

Step 4 Initialize the disks

Changed lines 63-64 from:

Step 5 Enable RAID-1

to:

Step 5 Enable RAID-1

Changed lines 109-110 from:

Step 6 Auto start/stop RAID

to:

Step 6 Auto start/stop RAID

Changed lines 113-114 from:

Create the myraid init script

to:

Create the myraid init script

Changed lines 163-164 from:

Install the myraid init script

to:

Install the myraid init script

December 24, 2007, at 08:50 PM by js -- Draft completed
Changed lines 4-5 from:

I tried to run Raid1 on Unslung (Raid1onUnslung6), but did not end up with a working device :-( To me it was unclear why the scripts didn't work. So I decided to try Slug-OS/BE HomePage. My first try did work and here is the overview of the steps taken. The steps are written for two empty disks, so no backup of any data is taken into account.

to:

I tried to run Raid1 on Unslung (Raid1onUnslung6), but did not end up with a working device :-( To me it was unclear why the scripts didn't work. So I decided to try Slug-OS/BE, see HomePage. My first try did work and here is the overview of the steps taken. The steps are written for two empty disks, so no backup of any data is taken into account.

Changed line 31 from:

At InitialisingDisks is described how to setup one disk. The basics of the description are valid for the setup of RAID-1 as well. So take that page as starting point and apply the changes as desccribed in here.

to:

At InitialisingDisks is described how to setup one disk. The basics of the description are valid for the setup of RAID-1 as well. So take that page as starting point and apply the changes as described in here.

Changed lines 41-42 from:

After rebooting continue with the section '"Initializing disks"'. Don't make the file system on /dev/sda3, we will do that after the raid is configured. Also initialise /dev/sdb1.

to:

After rebooting continue with the section "Initializing disks". Don't make the file system on /dev/sda3, we will do that after the raid is configured. Also initialise /dev/sdb1.

Changed lines 45-46 from:

The next section is the '"Moving root file system"' section.

to:

The next section is the "Moving root file system" section.

Changed lines 49-52 from:

So run the "turnup init", "turnup preserve" and reboot

Now it is time to move the root file system: turnup disk -i /dev/sda1 -t ext3

to:

So run the

 # turnup init
 # turnup preserve

and reboot

Now it is time to move the root file system

 # turnup disk -i /dev/sda1 -t ext3
Changed lines 59-60 from:

Continue with the '"Finishing up"' section

to:

Continue with the "Finishing up" section

December 24, 2007, at 08:40 PM by js --
Changed lines 29-31 from:

Note: the two leds for the indication of DISK1? and DISK2? will not light. It should be possible to connect more then two drives through a USB-hub. So it does not really make sense to control the lights as it does for unslung with the hard map between the ports and drives.

At InitialisingDisks is described. The basic of the description are valid for the setup of RAID1? as well.

to:

Note: the two leds for the indication of DISK-1 and DISK-2 will not light. It should be possible to connect more then two drives through a USB-hub. So it does not really make sense to control the lights as it does for unslung with the hard map between the ports and drives.

At InitialisingDisks is described how to setup one disk. The basics of the description are valid for the setup of RAID-1 as well. So take that page as starting point and apply the changes as desccribed in here.

Changed lines 59-60 from:

Step 5 Enable RAID1?

to:

Step 5 Enable RAID-1

Changed lines 67-70 from:
  1. ipkg update
  2. ipkg install udev-utils (from 1, don't know the reason))
to:
 # ipkg update

 # ipkg install udev-utils (from 1, don't know the reason))
Changed lines 72-76 from:
  1. ipkg install mdadm

Install the kernel module (md-mod is installed automatical as a dependency)

  1. ipkg install kernel-module-raid1
to:
 # ipkg install mdadm

Install the kernel module (md-mod is installed automatic as a dependency)

 # ipkg install kernel-module-raid1
Changed lines 78-80 from:
  1. insmod /lib/modules/2.6.16/kernel/drivers/md/md-mod.ko
  2. insmod /lib/modules/2.6.16/kernel/drivers/md/raid1.ko
to:
 # insmod /lib/modules/2.6.16/kernel/drivers/md/md-mod.ko
 # insmod /lib/modules/2.6.16/kernel/drivers/md/raid1.ko
Changed lines 82-84 from:
  1. cat /proc/modules or with
  2. lsmod
to:
 # cat /proc/modules or with
 # lsmod
Changed lines 86-88 from:
  1. mknod /dev/md0 b 9 4 2>/dev/null
  2. mdadm --create --verbose /dev/md0 --level=1 --raid-devices=2 /dev/sda3 /dev/sdb3
to:
 # mknod /dev/md0 b 9 4 2>/dev/null
 # mdadm --create --verbose /dev/md0 --level=1 --raid-devices=2 /dev/sda3 /dev/sdb3
Changed lines 90-91 from:
  1. mkfs.ext3 /dev/md0
to:
 # mkfs.ext3 /dev/md0
Changed lines 94-95 from:

After 10 minutes (320GB disks) continue the configuration

to:

After 10 minutes (320GB disks) waiting on building the filesystem, continue the configuration.

Changed line 97 from:
  1. cat /proc/mdstat
to:
 # cat /proc/mdstat
Changed lines 103-108 from:
  1. mount /dev/md0 /home

Step 6 Auto start/stop RAID

If the RAID is not properly then after reboot the resync will take another 10 hours.

to:
 # mount /dev/md0 /home

Step 6 Auto start/stop RAID

If the RAID is not properly stopped then after reboot the resync will take place, which will take another 10 hours.

Create the myraid init script

Changed lines 113-122 from:
  1. ! /bin/sh
  2. /etc/init.d/myraid
  3. Some things that run always

touch /var/lock/myraid

  1. Carry out specific functions when asked to by the system

case "$1" in

  start)
to:
 #! /bin/sh
 # /etc/init.d/myraid
 #

 # Some things that run always
 touch /var/lock/myraid

 # Carry out specific functions when asked to by the system
 case "$1" in
   start)
Changed lines 142-148 from:

esac

exit 0

Create the file myraid in /etc/init.d and

  1. chmod +xxx myraid
to:
 esac

 exit 0

Create the file myraid, as shown above, in /etc/init.d and

 # chmod +xxx myraid
Changed lines 151-152 from:
  1. myraid stop
  2. cat /proc/mdstat
to:
 # myraid stop
 # cat /proc/mdstat
Changed lines 155-156 from:
  1. myraid start
  2. cat /proc/mdstat
to:
 # myraid start
 # cat /proc/mdstat
Changed lines 159-160 from:

Install the myraid init script

to:

Install the myraid init script

Changed lines 162-171 from:
  1. update-rc.d myraid defaults

Now you should be able to reboot the NSLU2 keeping the RAID clean (ofcourse after the first resync has been completed).

Step 7 Install samba

Step 8 Protect the NSLU2

Generate another SSL key

to:
 # update-rc.d myraid defaults

Now you should be able to reboot the NSLU2 keeping the RAID clean (of course after the first resync has been completed).

The configuration of the RAID-1 on Slug-OS is now completed.

December 24, 2007, at 08:28 PM by js --
Changed lines 15-17 from:

Step 3 Flash SlugOS to the NSLU2

Details at http://www.nslu2-linux.org/wiki/SlugOS/UsingTheBinary

to:

Step 3 Flash Slug-OS to the NSLU2

Details at UsingTheBinary?

Changed lines 21-26 from:

Step 4 Initialize the disks

Start the NSLU2 without the disks attached. ssh to the NSLU2. ssh -l root@192.168.xx.xx Logon in with the default root password, see http://www.nslu2-linux.org/wiki/FAQ/OpenSlugDefaultPassword. The password is likely opeNSLUg

to:

Step 4 Initialize the disks

Start the NSLU2 without the disks attached. ssh to the NSLU2, ssh -l root@192.168.xx.xx

Logon with the default root password, see OpenSlugDefaultPassword?. The password is likely opeNSLUg

Added line 28:
Changed lines 31-32 from:

At http://www.nslu2-linux.org/wiki/OpenSlug/InitialisingDisks is described. The basic of the description are valid for the setup of raid1.

to:

At InitialisingDisks is described. The basic of the description are valid for the setup of RAID1? as well.

Added line 34:
Changed lines 41-42 from:

After rebooting continue with the section "Initializing disks". Don't make the file system on /dev/sda, we will do that after the raid is configured. Also initialise /dev/sdb1.

to:

After rebooting continue with the section '"Initializing disks"'. Don't make the file system on /dev/sda3, we will do that after the raid is configured. Also initialise /dev/sdb1.

Changed lines 45-46 from:

The next section is the "Moving root file system" section. Before you move the root filesystem first properly initialise the SlugOS further. This is described at http://www.nslu2-linux.org/wiki/OpenSlug/InitialisingOpenSlug (note that the link on the InitialiseDisks? is linking to a document for OpenSlug 2.5 and we are on 3.10beta).

to:

The next section is the '"Moving root file system"' section.

Before you move the root filesystem first properly initialise the Slug-OS further. This is described at InitialisingOpenSlug (note that the link on the InitialiseDisks? is linking to a document for OpenSlug 2.5 and we are on 3.10beta).

Added line 50:
Changed lines 55-56 from:

Continue with the "Finishing up" section

to:

Continue with the '"Finishing up"' section

Changed lines 59-63 from:

Step 5 Enable RAID1?

Now the NSLU2 runs SlugOS and starts from the first partition on the first USB drive. The following is inspired by http://n0tablog.wordpress.com/howtos/software-raid-6-on-openslug/ (1))and http://www.nslu2-linux.org/wiki/HowTo/Raid1onUnslung6.

to:

Step 5 Enable RAID1?

Now the NSLU2 runs Slug-OS and starts from the first partition on the first USB drive. The following is inspired by http://n0tablog.wordpress.com/howtos/software-raid-6-on-openslug/ (1))and Raid1onUnslung6.

December 24, 2007, at 08:22 PM by js --
Changed lines 6-7 from:

Step 1 Download the SlugOS binary

to:

Step 1 Download the Slug-OS binary

Changed lines 10-11 from:

Step 2 Install upslug2

to:

Step 2 Install upslug2

Changed lines 13-14 from:

Details at http://www.nslu2-linux.org/wiki/Main/UpSlug2

to:

Details at UpSlug2

December 24, 2007, at 08:20 PM by js --
Added line 1:

(:title How to enable RAID1 on SluOS:)

Changed lines 4-9 from:

I tried to run Raid1 on Unslung (Raid1onUnslung6), but did not end up with a working device :-( To me it was unclear why the scripts didn't work. So I decided to try SlugOS/BE http://www.nslu2-linux.org/wiki/SlugOS/HomePage. My first try did work and here is the overview of the steps taken. The steps are written for two empty disks, so no backup of any data is taken into account.

Step 1 Download the SlugOS

The binary is available at: http://www.slug-firmware.net/

to:

I tried to run Raid1 on Unslung (Raid1onUnslung6), but did not end up with a working device :-( To me it was unclear why the scripts didn't work. So I decided to try Slug-OS/BE HomePage. My first try did work and here is the overview of the steps taken. The steps are written for two empty disks, so no backup of any data is taken into account.

Step 1 Download the SlugOS binary

The binary is available at: http://www.slug-firmware.net/

December 24, 2007, at 08:15 PM by js -- How to enable RAID1 on SlugOS
Added lines 1-158:

Introduction

I tried to run Raid1 on Unslung (Raid1onUnslung6), but did not end up with a working device :-( To me it was unclear why the scripts didn't work. So I decided to try SlugOS/BE http://www.nslu2-linux.org/wiki/SlugOS/HomePage. My first try did work and here is the overview of the steps taken. The steps are written for two empty disks, so no backup of any data is taken into account.

Step 1 Download the SlugOS

The binary is available at: http://www.slug-firmware.net/

Step 2 Install upslug2

You need upslug2 installed on your Linux computer to flash the NSLU2. Details at http://www.nslu2-linux.org/wiki/Main/UpSlug2

Step 3 Flash SlugOS to the NSLU2

Details at http://www.nslu2-linux.org/wiki/SlugOS/UsingTheBinary Command: ./upslug2 --image=../slugosbe/openslug-3.10-beta.bin

Step 4 Initialize the disks

Start the NSLU2 without the disks attached. ssh to the NSLU2. ssh -l root@192.168.xx.xx Logon in with the default root password, see http://www.nslu2-linux.org/wiki/FAQ/OpenSlugDefaultPassword. The password is likely opeNSLUg

Connect the 2 drives to the NSLU2 Note: the two leds for the indication of DISK1? and DISK2? will not light. It should be possible to connect more then two drives through a USB-hub. So it does not really make sense to control the lights as it does for unslung with the hard map between the ports and drives.

At http://www.nslu2-linux.org/wiki/OpenSlug/InitialisingDisks is described. The basic of the description are valid for the setup of raid1. Start with the creation the three partitions on /dev/sda as described (I've increased to first partition to 4Gb). Make the change to the swap partition as described. In addition set the type of the third partition to fd (Linux raid autodetect).

Before rebooting the NSLU2 first perform the same tasks on /dev/sdb. On the second drive, the first 4Gb and the swap will not be used further. Only the large data partition will be used in the RAID.

Reboot the NSLU2 after defining the partition table for both /dev/sda and /dev/sdb.

After rebooting continue with the section "Initializing disks". Don't make the file system on /dev/sda, we will do that after the raid is configured. Also initialise /dev/sdb1.

Reboot the NSLU2 again.

The next section is the "Moving root file system" section. Before you move the root filesystem first properly initialise the SlugOS further. This is described at http://www.nslu2-linux.org/wiki/OpenSlug/InitialisingOpenSlug (note that the link on the InitialiseDisks? is linking to a document for OpenSlug 2.5 and we are on 3.10beta). So run the "turnup init", "turnup preserve" and reboot Now it is time to move the root file system: turnup disk -i /dev/sda1 -t ext3

Reboot again to boot from the file system.

Continue with the "Finishing up" section As nothing needs to be done on /dev/sda3 only update /etc/fstab for /dev/sda2

Step 5 Enable RAID1?

Now the NSLU2 runs SlugOS and starts from the first partition on the first USB drive. The following is inspired by http://n0tablog.wordpress.com/howtos/software-raid-6-on-openslug/ (1))and http://www.nslu2-linux.org/wiki/HowTo/Raid1onUnslung6.

Boot the NSLU2 and login as root

Update the installer:

  1. ipkg update
  2. ipkg install udev-utils (from 1, don't know the reason))

Install the raid admin tool

  1. ipkg install mdadm

Install the kernel module (md-mod is installed automatical as a dependency)

  1. ipkg install kernel-module-raid1

Start the raid kernel modules

  1. insmod /lib/modules/2.6.16/kernel/drivers/md/md-mod.ko
  2. insmod /lib/modules/2.6.16/kernel/drivers/md/raid1.ko

Check that modules are running

  1. cat /proc/modules or with
  2. lsmod

Define the raid

  1. mknod /dev/md0 b 9 4 2>/dev/null
  2. mdadm --create --verbose /dev/md0 --level=1 --raid-devices=2 /dev/sda3 /dev/sdb3

Build the filesystem

  1. mkfs.ext3 /dev/md0

You will see both disks active :-)

After 10 minutes (320GB disks) continue the configuration The NSLU2 might be a little less responsive as the raid is checked. See it with:

  1. cat /proc/mdstat

It will take about 10 hours to get the disks in sync. But you can continue with the next steps anyway. Don't start dumping your files here until everything is fully up and running.

I prefer to mount the raid to /home, so for all other accounts the data will be on the raid. Root already has his homedir root in /home. It's empty, so I didn't bother, root has also a home at /root.

Mount the raid partition

  1. mount /dev/md0 /home

Step 6 Auto start/stop RAID

If the RAID is not properly then after reboot the resync will take another 10 hours.

A very basic (no error checking or whatever) script for start/stop is:

  1. ! /bin/sh
  2. /etc/init.d/myraid
  3. Some things that run always

touch /var/lock/myraid

  1. Carry out specific functions when asked to by the system

case "$1" in

  start)
    echo "Starting script myraid "
    /sbin/insmod /lib/modules/2.6.16/kernel/drivers/md/md-mod.ko
    /sbin/insmod /lib/modules/2.6.16/kernel/drivers/md/raid1.ko
    /bin/umount /dev/sda3 
    /bin/umount /dev/sdb3
    /bin/mknod /dev/md0 b 9 4 2>/dev/null
    /sbin/mdadm --assemble /dev/md0 /dev/sda3 /dev/sdb3
    /bin/mount /dev/md0 /home

    ;;
  stop)
    echo "Stopping script myraid"
    /bin/umount /dev/md0
    /sbin/mdadm --stop /dev/md0
    ;;
  *)
    echo "Usage: /etc/init.d/myraid {start|stop}"
    exit 1
    ;;

esac

exit 0

Create the file myraid in /etc/init.d and

  1. chmod +xxx myraid

Test the script

  1. myraid stop
  2. cat /proc/mdstat

The output of cat shows that no raid is active

  1. myraid start
  2. cat /proc/mdstat

The output of cat shows that the raid is active and likely still resyncing :-)

Install the myraid init script

The script is at the right place now /etc/init.d. Now it must be started and stopped automatical. Go for the defaults with the install of the myraid init script.

  1. update-rc.d myraid defaults

Now you should be able to reboot the NSLU2 keeping the RAID clean (ofcourse after the first resync has been completed).

Step 7 Install samba

Step 8 Protect the NSLU2

Generate another SSL key

view · edit · print · history · Last edited by fcarolo.
Based on work by fcarolo and js.
Originally by js.
Page last modified on January 08, 2008, at 12:17 PM