view · edit · print · history

How to set up a workable two-disk configuration in R63/Unslung6

Due to the odd behavior of rc.bootbin as discussed in R63DiskBehaviour, it is not advisable to use two natively-formatted disks in R63 or Unslung6!

The following setup does work, however!

We will use a USB flash disk in port 2 (/dev/sda) and a USB hard disk in port 1 (/dev/sdb). This maximizes flexibility and compatibility.

  1. Start with a fresh NSLU2!
  2. Install Unslung 6.x. Do not configure any shares or users yet!
  3. Insert the flash drive in port 2 and format it through the Web interface. It will remain here forever!
  4. Reboot
  5. Get a shell and unsling to the flash with "unsling disk2"
  6. Reboot
  7. Use another PC to configure your USB hard disk (or second flash device) with a single large partition, if it isn't that way already. You will not be using the GUI on the NSLU2 to partition it!
  8. Plut the second USB drive into port 1 of the NSLU2
  9. Get a shell and format it as ext3 with "mkfs.ext3 /dev/sdb1"
  10. We will mount it under the flash disk at /share/flash/data/sdb. You must create this directory now from the shell with "mkdir /share/flash/data/sdb".
  11. Now we have to tell the slug to mount the drive on startup after running rc.bootbin but before starting Samba. We'll do this with a diversion script called /unslung/rc.samba. From the shell, type "cat > /unslung/rc.samba" and paste in the following text:
#! /bin/sh
# Diversion script: to mount a formatted drive under /share/flash/data
mount /dev/sdb1 /share/flash/data/sdb

return 1

  1. Now reboot. When it comes up, your df output should look like this:
# df
Filesystem 1k-blocks Used Available Use% Mounted on
rootfs 723320 34748 681224 5% /
/dev/sda1 6528 6328 200 97% /initrd
/dev/sda1 723320 34748 681224 5% /
/dev/sda1 723320 34748 681224 5% /share/flash/data
/dev/sda2 123811 4144 118389 3% /share/flash/conf
/dev/sdb1 480719056 5497276 450802580 1% /share/flash/data/sdb

  1. Now you can create users and shares. Specify "Disk 2" for shares and specify "/sdb/whatever" when creating a share. For example, a music share would be on "Disk 2" and would specify the "/sdb/music/" folder in the GUI. Don't worry - it'll actually reside on the disk you mounted on sdb.
  2. Note that any user shares you create will be created on the disk in port 2 (the flash disk) as you can't specify where to put them! So maybe you won't want to create them...


You might also want to take a look at http://www.nslu2-linux.org/wiki/HowTo/3orMoreEXT3DrivesWithAUSBHub as I have had perfect results with that method.

SRS 02/06/2010

view · edit · print · history · Last edited by SRS.
Based on work by SRS and Gary.
Originally by Gary.
Page last modified on February 08, 2010, at 12:23 PM