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.
- Start with a fresh NSLU2!
- Install Unslung 6.x. Do not configure any shares or users yet!
- Insert the flash drive in port 2 and format it through the Web interface. It will remain here forever!
- Get a shell and unsling to the flash with "unsling disk2"
- 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!
- Plut the second USB drive into port 1 of the NSLU2
- Get a shell and format it as ext3 with "mkfs.ext3 /dev/sdb1"
- 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".
- 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:
# Diversion script: to mount a formatted drive under /share/flash/data
mount /dev/sdb1 /share/flash/data/sdb
- Now reboot. When it comes up, your df output should look like this:
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
- 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.
- 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.