I wanted to shout out a few instructions that I compiled to be able to build a new Samba Share on my new POGO-E02. Before I begin, I would like to offer a few words of caution. I bricked a POGO-E02 experimenting (I am pretty sure it had to do with the Arch Linux installation that I later chose not to use in favour of the description below). You too can brick that pretty pink or grey thing on your desk, so please embark on this little escapade at your own risk.
Now I wouldn't be writing this little how to if it wasn't for the amazing help of Aaron Randall. His blogs were the simplest and easiest to follow of the countless hours I spent hunting this stuff down. I tip my hat to him and thank him kindly for taking the time to provide his expertise. Aaron's blog can be found at http://aaronrandall.blogspot.com
First the back story...
So I wanted a simple way to share multiple external hard drives across my local network. My particular need for this little guy was to be able to provide all of my family home movies as a share to several AppleTVs featuring XBMC. I wasn't happy with the uPNP that comes resident on the POGOPLUG as it wouldn't work with the home movies that I had. So my configuration has 4 x 4TB external hard drives plugged into the POGOPLUG (I have a lot of recorded TV shows from OTA DTV). The POGOPLUG is connected to a 1,000 mbit ethernet switch and I have two (2) AppleTVs (2nd generation) that are jailbroken with XBMC installed.
So the goal of the POGOPLUG was to provide a bulletproof SAMBA share of my existing external hard drives without the use of a noisy power sucking computer. I spent an entire weekend working through this including the bricking of a POGOPLUG and arrived at what I think is a pretty elegant little setup. So elegant in fact that I am hoping to duplicate the setup for my father and mother in law (who aren't very technically savvy).
I normally don't blog, but I found that for what is a relatively simple process, there is remarkably little information readily available.
So without further adieu, please see the process I followed below:
- Find your POGOPLUG ip address. I found this by going to my internet gateway and looking in the DHCP table for an entry that matched the MAC ID on the bottom of the POGO. In my case this was a 192.168.0.# number. Write this number down.
- Log into your POGOPLUG online account that you created during the initial setup of the POGO. Go into the advanced tab / Security. Make sure that "Enable SSH access for this Pogoplug enabled device" is clicked. Also keep the password handy for reference. (if you didn't put a password in, it is "ceadmin"
- Use your favourite SSH protocol to login to the POGO. My favourite is putty (http://www.chiark.greenend.org.uk/~sgtatham/putty/)
- Using your favourite SSH protocol to the IP Address from 1. and the password you have you will connect to the POGO as "root" and "ceadmin" or "your password"
- The following instructions are a credit to Aaron Randall.
mount -o remount,rw /
mkdir /opt
mount /dev/mtdblock3 /opt
cd /opt
wget http://ipkg.nslu2-linux.org/feeds/optware/cs08q1armel/cross/unstable/ipkg-opt_0.99.163-10_arm.ipk
tar -xOvzf ipkg-opt_*_arm.ipk ./data.tar.gz | tar -C / -xzvf –
mkdir -p /opt/etc/ipkg
echo "src cross http://ipkg.nslu2-linux.org/feeds/optware/cs08q1armel/cross/unstable" > /opt/etc/ipkg/armel-feed.conf
echo "src native http://ipkg.nslu2-linux.org/feeds/optware/cs08q1armel/native/unstable" >> /opt/etc/ipkg/armel-feed.conf
/opt/bin/ipkg update
# Install samba server*************************************************
/opt/bin/ipkg install samba2
# Navigate to the samba config directory*******************************
cd /opt/etc/samba/
# Backup the default configuration file********************************
cp smb.conf smb.conf.backup
# Edit the configuration file******************************************
vi smb.conf # or use nano below
# Install nano text editor*********************************************
/opt/bin/ipkg install nano
# Edit the configuration file******************************************
/opt/bin/nano /opt/etc/samba/smb.conf
#insert the following information into the smb.conf file***************
[global]
workgroup = workgroup
server string = Pogoplug Samba2 Server
hosts allow = 192. 127. # you may need to put 10. here
null passwords = yes
guest account = root
log file = /opt/var/log/samba/log.%m
max log size = 50
security = share
encrypt passwords = yes
smb passwd file = /opt/etc/samba/smbpasswd
dns proxy = no
preserve case = yes
[External]
comment = external hd
path = /tmp/.cemnt/
available = yes
public = yes
writable = yes
printable = no
create mask = 0777
guest ok = yes
browseable = yes
[sda1]
comment = sda1 hard drive
path = /tmp/.cemnt/mnt_sda1/
available = yes
public = yes
writable = yes
printable = no
create mask = 0777
guest ok = yes
browseable = yes
[Root$]
comment = root
path = /
available = yes
public = yes
writable = yes
printable = no
create mask = 0777
guest ok = yes
browseable = yes
#end of smb.conf file*********************
#testing the smb.conf file*****************************************
/opt/bin/testparm
# Start the Samba Server*******************************************
/opt/etc/init.d/S80samba start
# Restart the Samba Server*****************************************
/opt/etc/init.d/S80samba restart
#subsequent adjustments to share information***********************
/opt/bin/nano /opt/etc/samba/smb.conf
# restart manually*************************************************
# this is necessary each time the power is cycled
mount -o remount,rw /
mount /dev/mtdblock3 /opt
/opt/etc/init.d/S80samba start
6. So now everything should be setup and working and you should be able to see everything on the appleTV. I first had some problems getting it to work in XBMC and discovered that if I used the IP address and the share (smb://192.168.0.#/sda1) it worked well. Those problems are also what led me to making the root share named as [Root$] to make it hidden from XBMC. You can of course adjust the smb.conf file can be configured in a multitude of ways to make it easier for you - google is a great resource here.
7. The next issue is making the restarting of the pogo automatic. I must urge extreme caution here. If you make a mistake here, you may have a new door stop (and not a very good one since it is really quite lite). So for the automatic restart, I would strongly suggest creating a script and testing that it works properly. The following is the instructions that I followed and worked well for me:
#Create a script for startup options called startup.sh****************
touch /etc/startup.sh
/opt/bin/nano /etc/startup.sh
#startup.sh script
mount -o remount,rw /
mount /dev/mtdblock3 /opt
/opt/etc/init.d/S80samba start
#give the shell permission to execute the script**********************
chmod 755 startup.sh
#subsequent reboots***************************************************
/etc/startup.sh
Once we are confident that the startup.sh script works properly and all of the shares are rebooting, we can consider (subject to my strong warnings) adjusting the rcS file and insert the startup.sh to start on bootup (similar to the autoexec.bat file, but more dangerous if you make a typo).
#building startup.sh into startup sequence****************************
/opt/bin/nano /etc/init.d/rcS
#add "/etc/startup.sh" to the end of the "rcS" file and save**********
The above method has worked flawlessly thus far for me. I have unplugged the power multiple times and each time the samba shares come back to life on the network.
The beauty of this setup is that I can remotely view all of the files on the external drives, and my in-laws still have full use of all of the files. Now I can upload family photos or home movies on demand to them without having to make a seperate trip to see them each time. Not to mention the added benefit of having offsite backups. The above setup preserves the full functionality of the POGO while allowing SAMBA sharing of the files across the network. For full HD home movies that can be a bit of a bandwidth hog, I there have been no issues with buffering which is great news.
I sincerely hope that the above has been helpful and hope you too enjoy your POGO as a very useful alternative to a full blown server! Not bad for $50.
Please leave me a comment to let me know what you think - I enjoy the feedback and hope that you found this helpful.
Thanks,
Marvels