For people who flashed the WL500W with dd-wrt. Here's the steps to set up the USB HD to share. Disclaimer: Try it with your own risk!
1. Prepare the usb HD - Partition
Down load gparted -
GParted -- Download
and partition/format the USB hardrive as follow
partition 1 - ext3 - 1G - Use this to mount /opt to install optware
partition 2 - linuxswap - 512M - Use this to add swap to the router, 32M of ram is little small operation
partition 3 - ext3 - the rest of the drive - Use this for share storage
2. Turn on USB services via the web admin (
http://192.168.1.1)
Go to services tab and turn on the following
Core USB Support
USB 1.1 Support (OHCI)Enable
USB 2.0 Support
USB Storage Support
ext2 / ext3 File System Support
FAT File System Support
Reboot the router with the USB HD attached
2b. Telnet to the router - telnet 192.168.1.1
3. Check if the drive is seen by the router - type
Code :
# dmesg
look for something like this
hub.c: new USB device 01:03.2-1, assigned address 2
scsi0 : SCSI emulation for USB Mass Storage devices
Vendor: SAMSUNG Model: SP2514N Rev: VF10
Type: Direct-Access ANSI SCSI revision: 02
Attached scsi disk sda at scsi0, channel 0, id 0, lun 0
SCSI device sda: 488397168 512-byte hdwr sectors (250059 MB)
Partition check:
/dev/scsi/host0/bus0/target0/lun0: p1 p2 p3
WARNING: USB Mass Storage data integrity not assured
USB Mass Storage device found at 2
4. If they are show up in the dmesg, next step is to mount all partitions
Mount /opt and /mnt
Code:
# mount /dev/scsi/host0/bus0/target0/lun0/part1 /opt
# mount /dev/scsi/host0/bus0/target0/lun0/part3 /mnt
Set up optware
Code:
# wget
http://www.wlan-sat.com/boleo/optware/optware-install-ddwrt.sh -O - | tr -d '\r' > /tmp/optware-install.sh
# sh /tmp/optware-install.sh
# export PATH=/opt/bin:/opt/sbin:$PATH
# /opt/bin/ipkg update
We want to have swap since 32M is not enough to things like
- bittorent
- ftpd
- samba
etc...
Install optware's busybox so we can use swapon to mount the swap patition
Code:
# /opt/bin/ipkg install busybox
Turn on swap
Code:
# /opt/bin/busybox swapon /dev/scsi/host0/bus0/target0/lun0/part2
check to verify swap is on
Code:
# free
5. Install/setup samba
- Install samba
Code:
# /opt/bin/ipkg remove samba
# /opt/bin/ipkg install samba2
- create a new smb.conf using vi editor (you may have to learn vi)
Code:
# cd /opt/etc/samba
# mv smb.conf smb.conf.bak
# vi smb.conf
-------------------file begin------------------------
# Samba config file created using SWAT
# from 192.168.1.113 (192.168.1.113)
# Date: 2008/10/02 14:36:42
# Global parameters
[global]
server string = Samba Optware Server
security = SHARE
log file = /opt/var/log/samba/log.%m
max log size = 50
load printers = No
dns proxy = No
hosts allow = 192.168.1. 192.168.2. 127.
[printers]
comment = All Printers
path = /opt/var/spool/samba
printable = Yes
browseable = No
[tmp]
comment = Temporary file space
path = /tmp
read only = No
guest ok = Yes
[share]
comment = Network share
path = /mnt
writeable = yes
read only = No
guest ok = Yes
---------------file end -------------------------------
- Add nobody user
Code:
# echo "nobody:*:65534:65534:nobody:/var:/bin/false" >> /etc/passwd
- Change /mnt to nobody so that you can write to the share
Code:
# chown -R nobody /mnt
6. Connect to the share drive from windows
Click on Start->Run then type
\\192.168.1.1\share
or
\\wl500w\share (since I named my router as wl500w)
7. If everything works we want to those steps in a startup script
Open the web admin goes Administration->Commands
Past the following and click "Save startup"
#============begin startup===================
echo "Mounting Optware partition..."
mount -t ext3 /dev/scsi/host0/bus0/target0/lun0/part1 /opt
echo "Activating swap..."
/opt/bin/busybox swapon /dev/scsi/host0/bus0/target0/lun0/part2
#echo "Checking user files partition..."
#e2fsck -p /dev/scsi/host0/bus0/target0/lun0/part3
echo "Mounting user files partition..."
mount -t ext3 /dev/scsi/host0/bus0/target0/lun0/part3 /mnt
echo "Masking etc/profile with /opt/etc/profile..."
if [ -e /opt/etc/profile ]; then
cp /opt/etc/profile /tmp
mount -o bind /tmp/profile /etc/profile
fi
echo "Add nobody user"
echo "nobody:*:65534:65534:nobody:/var:/bin/false" >> /etc/passwd
echo "Starting Optware programs..."
unset LD_LIBRARY_PATH
export PATH=/opt/bin:/opt/sbin:/bin:/sbin:/usr/sbin:/usr/bin
if [ -d /opt/etc/init.d ]; then
for f in /opt/etc/init.d/S* ; do
[ -x $f ] && $f start
done
fi
#==================end=======================