How to install SAMBA on Pogoplug 4

In this tutorial I will show you how to install SAMBA on Pogoplug Series 4, Pogoplug Pro and Pogoplug Office devices. Please note that this tutorial doesn’t fully apply on Pogoplug Classic and Pogoplug Mobile devices.

Prerequisites:

– note that I am NOT responsible for any errors this tutorial might cause. Also please note that installing SAMBA will void your device’s warranty;
– setup your Pogoplug as a “normal” Pogoplug (activate it, set it up, etc);
– insert a blank USB stick or SD card, formatted as FAT32. Please note that this stick/card will contain all the necessary files for running SAMBA. You will need to keep this stick/card inserted on your Pogoplug as long as you want to use SAMBA;
– go to http://my.pogoplug.com -> Settings ->  Security -> check “Enable SSH access for this Pogoplug device” and enter a password;
– SSH to your Pogoplug’s LAN IP by using Putty or any other SSH client (port 22). The username is “root” and the password is the one you’ve set at the previous point. If you don’t know how to find the LAN IP of your Pogoplug I strongly recommend you to stop at this point, as you obviously don’t have the necessary technical skills and you will probably damage/brick your device.

So, let’s begin.

1. Mount “/” as writable:

mount -o remount,rw /

2. Create the main directory:

mkdir /opt

3. Mount a USB stick/drive into the “/opt” directory:

mount -o exec,remount /tmp/.cemnt/mnt_sda1/ /opt

NOTE: you can find all the devices you’ve plugged into your Pogoplug by executing this commands:

cd /tmp/.cemnt/
ls | grep mnt

You should see something like this:

/tmp/.cemnt # ls | grep mnt
mnt_sda1

In this case our USB stick is on “/tmp/.cemnt/mnt_sda1”. This might be different, depending on your configuration.

4. Replace Pogoplug’s default “wget” command with a new one. This is because the default “wget” doesn’t supports a bunch of features which we’ll need later.

4.1. Change directory, get the new ipk, extract it, then extract its “data.tar.gz”:

cd /opt
mkdir work
cd work
wget http://ipkg.nslu2-linux.org/feeds/optware/cs08q1armel/cross/unstable/wget_1.12-2_arm.ipk
tar xf wget_1.12-2_arm.ipk
tar xf data.tar.gz

4.1. Rename the default “wget” binary and replace it with the new one:

mv /usr/bin/wget /usr/bin/wget.bak
mv /opt/work/opt/bin/wget /usr/bin/

4.2. Cleanup:

rm -rf /opt/work/*

5. Install IPKG. This will allow us to install SAMBA (or other useful binaries).

5.1. Change directory, get IPKG, extract it then extract its “data.tar.gz”:

cd /opt/work
wget http://ipkg.nslu2-linux.org/feeds/optware/cs08q1armel/cross/unstable/ipkg-opt_0.99.163-10_arm.ipk
tar xf ipkg-opt_0.99.163-10_arm.ipk
tar xf data.tar.gz

5.2. Move the new packages into their right places:

cd /opt/work/opt
mv * /opt

5.3. Cleanup

rm -rf /opt/work/*

6. Setup IPKG.

6.1. Create IPKG’s working directory:

mkdir -p /opt/etc/ipkg

6.2. Add repositories to 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

6.3. Copy dependant files:

cp /opt/lib/libipkg.so.0.0.0 /opt/lib/libipkg.so.0

NOTE: this should normally be done by creating a symlink. Unfortunately I didn’t managed to create any symlink in “/opt” (Operation not permitted). If you find any fix please let me know.

7. Update IPKG

/opt/bin/ipkg update

 8. Install SAMBA’s dependencies:

8.1. Install “libnsl”:

/opt/bin/ipkg install libnsl

8.2. Copy dependant files:

cp /opt/lib/libnsl-2.5.so /opt/lib/libnsl.so
cp /opt/lib/libnsl-2.5.so /opt/lib/libnsl.so.1

Note: same as at 6.3, this should be done by creating symlinks.

9. Install SAMBA:

/opt/bin/ipkg install samba2

10. Prepare SAMBA’s configuration files:

10.1. Backup/rename SAMBA’s default configuration file:

mv /opt/etc/samba/smb.conf /opt/etc/samba/smb.conf.bak

10.2. Create a new configuration file:

touch /opt/etc/samba/smb.conf

11. Configure SAMBA:

11.1. Edit the configuration file with VIM:

vi /opt/etc/samba/smb.conf

11.2. Press “i” on the keyboard.

11.3. Copy/paste each line, one by one, as follows:

[global]
        workgroup = workgroup
        server string = Pogoplug
        hosts allow = 192. 127. 10.
        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

[sda1]
        comment = USB1
        path = /tmp/.cemnt/mnt_sda1/
        available = yes
        public = yes
        writable = yes
        printable = no
        create mask = 0777
        guest ok = yes
        browseable = yes

NOTE: don’t try to copy/paste all the content from above. Copy/paste each line, one by one. If you want to abort/cancel any changes you should exit from VIM by pressing “Esc”, then “:”, then “q!”, then “Enter” (directly on your keyboard, obviously without quotes) and start over from point 11.1.

11.4. Save the file: press “Esc”, press “:”, press “wq”, press “Enter” (directly on your keyboard, obviously without quotes).

12. Test SAMBA:

/opt/bin/testparm

You should see something like this:

Load smb config files from /opt/etc/samba/smb.conf
Processing section “[sda1]”
Loaded services file OK.
Press enter to see a dump of your service definitions

Press “Enter” .

If you don’t see the above message please stop and ask for help in the comment form below.

13. Start SAMBA:

/opt/etc/init.d/S80samba start

Congratulations, SAMBA is running! You can now search for the shared folders on your network.

14. Useful commands:

– Restart SAMBA:

/opt/etc/init.d/S80samba restart

– Start SAMBA after device reboot/reset:

mount -o remount,rw /
mount -o exec,remount /tmp/.cemnt/mnt_sda1/ /opt
/opt/etc/init.d/S80samba start

Please let me know how this worked out for you in the comment form below. Cheers! 🙂

Inspired from: PogoMarvel, Aaron Randall, GeekWind.

51 Comments

  1. Hello, Thank you for this guide.

    Everything was goinfg quite well. I installed the samba files and got the message:

    “Load smb config files from /opt/etc/samba/smb.conf

    Processing section “[sda1]”

    Loaded services file OK.

    Press enter to see a dump of your service definitions”

    But when I tried to start Samba, there are lots of errors. Like “error retreiving current directory: getcwd: Cannot access parent directories: No such file or directory
    Stopping smbd:
    stopping nmbd:”

    I am not sure why this happened but would love some advice or solutions if you have any? I am running the install on a 1gb USB flash drive on a Pogoplug 4.

  2. Hi,

    Sorry, I realised what I did wrong and have now fixed the problem and samba is working as per your excellent guide! Thank you very much. I made a very rookie mistake by not going back to the root before doing stage 6 of your guide (how embarrasing).

    The Only thing I am not sure how to do is how to mount and share an external drive?

    I have a 1.5tb USB 3.0 hard drive connected via one of the USB 3.0 ports of my Pogoplug 4 but I cannot access any files on it using Samba. Are you able to tell me how I can do this?

    Thank you again for a wonderful guide. Any advice would be appreciated.

    1. You don’t need to mount anything, just plug the drive into the Pogo and it should appear on /tmp/.cemnt/

      If the drive appears on /tmp/.cemnt/ and on your my.pogoplug.com account, than you should add a new line in smb.conf, specific for that drive.

      Example: if your drive is mounted on /tmp/.cemnt/mnt_sdc1/, than you should create a new line in smb.conf. Simply copy/paste ALL the lines from [sda1] and replace “sda1” with “sdc1” and “path = /tmp/.cemnt/mnt_sda1/” to “path = /tmp/.cemnt/mnt_sdc1/”.

  3. Hello Razva, thank you for your reply.

    Yes, I have managed to get it working now. I changed the path in the smb.conf to just ‘.cemnt’ so now, any drive I attach is visible on my network share in Windows 7, which is ideal for me.

    The only other thing I wish I could do is make Samba launch automatically when the Pogo is rebooted or powered on from being turned off. Not sure if this is possible, but would be great to be able to do.

    Thanks again Razva

    1. You can try:

      Edit with VI: “etc/init.d” with

      “mount -o exec,remount /tmp/.cemnt/mnt_sda1/ /opt”

      and

      “/opt/etc/init.d/S80samba start”

      1. Hello Sebb,

        Is this to get Samba to auto launch when the pogoplug is turned on?

        I tried to edit “etc/init.d” but I get an error saying ‘No such file or directory exists’

        I also have Nano installed but I get a similar error when I try to do it through Nano.

        Do I need to create the ‘init.d’ first? If so, can you tell me how I do this? I have managed to do some things in the past but I am quite new to SSH into Pogoplug.

        Thank you for your help.

        Dalsim

        1. I strongly discourage messing with init.d, as a simple USB stick corruption could break your device. Personally I’ve made a “startup” directory, with “manual” commands, and I’m executing the scripts after restarting the Pogo. Thinking at the fact that I’m restarting it once a month…it’s not a big headache.

    1. i try it with: /opt/etc/samba adduser -H sebb.
      But I get a error messages: Permission Denied. -.-

  4. Hello,

    I have a problem with this command:
    tar xf wget_1.12-2_arm.ipk

    I get an error on my pogoplug pro
    tar: invalid tar magic

    it looks like the pogoplug doesn’t know the option “f”

  5. This is great, thanks so much! For my version 4.5.5 I had to do some work using some workarounds:
    >>start>>

    If you DO NOT have version “BusyBox v1.7.0″ (e.g. “BusyBox v1.16.1″)
    Newer versions of Busybox require manually updating the Wget package that comes with your version of Busybox. To do that, you should be able to run the following:

    cd /tmp/
    wget
    http://ipkg.nslu2-linux.org/feeds/optware/cs08q1armel/cross/stable/wget_1.12-2_arm.ipk
    tar xvzf wget_1.12-2_arm.ipk
    tar xzvf data.tar.gz -C /
    mv /usr/bin/wget /usr/bin/wget.old
    ln -s /opt/bin/wget /usr/bin/wget
    /opt/bin/ipkg update
    ipkg install libnsl

    >>end>>

    As well as deal with the an ipkg and wget permissions problem. I initially had to use:

    $ mount /tmp/.cemnt/mnt_sda1/ /opt

    Then afterwards remove noexec by using:
    $ mount -o exec,remount /tmp/.cemnt/mnt_sda1/ /opt

    Both of the sources are here:
    http://aaronrandall.com/blog/customising-your-pogoplug/
    http://a24life.com/wlog/?tag=pogoplug

  6. Samba2 wouldn’t work for me on mountain lion. Ended up installing (hacking) samba36 and the drive is now visible to me (and Sonos which was my final goal).

    Thanks for all your help.

      1. ipkg install samba36

        instead of

        ipkg install samba2

        otherwise its pretty much the same.
        I have /opt/etc/init.d/S08samba instead of /opt/etc/init.d/S80samba

  7. symlink in “/opt”

    Since you started with FAT32 drive, it didn’t allow creating a symlink.
    I tried with a linux formated USB drive (using linux system), I was able to create.

  8. Got it to work – great. only problem I had was the ipkg commands/config file does not point to the correct list of install packages – used wget to get them manually the used the tar, and tar to expand them then moved them manually into the correct folders – the path in the config file needs updating to match the current linux web organization. also when using tar the options xf do not work, use xzvf instead.

  9. I got to the part where I am supposed to update ipkg and get a Permission denied error:
    sh: /opt/bin/ipkg: Permission denied

    I tried updating the permissions on /opt/bin/ipkg to 777, but no dice. I am root so I don’t know what could be the problem. Any help?

    1. I finally figured it out. When I typed mount it showed the /opt mounted with noexec. I did mount -o remount,exec /opt and then I was able to run ipkg.

  10. What is it about this procedure that does not apply or is different for the PogoPlug Mobile?

    1. I don’t own a Pogoplug Mobile so I can’t answer you to this question. But if they have similar (or close) OSs…than it should work.

  11. On my pogoplug pro (ARMv6 Oxsemi NAS) I can see /tmp/.cemnt/mnt_sda1 but I am getting this error

    ~ # mount -o exec,remount /tmp/.cemnt/mnt_sda1/ /opt
    mount: mounting /tmp/.cemnt/mnt_sda1/ on /opt failed: Invalid argument

    Any help is appreciated.

    1. I did mount -o exec /tmp/.cemnt/mnt_sda1/ /opt
      and then mount -o remount /opt
      which worked for me

      1. I get: mount: mounting /tmp/.cemnt/mnt_sda1/ on /opt failed: No such file or directory

        I note that in /tmp/.cemnt/ I have (two sticks) sda and sda1 not prefixed by mnt_.

        I actually got through the configuration part without any errors. But I do have BusyBox v1.16.1. Samba even starts. I just don’t see anything. Any thoughts?

  12. Hi,

    Thanks for the tutorial!; It is very clear 🙂
    I got my pogoplug this week, and i am starting to mod it a little bit. I want to know if you know a way to do a hard reset of the device (in case i want to restore is as “out of the box”).
    The small button on its back is for ejecting drives, so wanna know if that is possible.

    Thanks in advance,
    Javier

    1. Hey! I don’t think this is possible, but I might be wrong. Contact Pogo Support for this matter.

  13. Great guide. Everything went well but I do not see the device on my home network. I am using the pogoplug plus with Windows 7 , firewall is off. Can you give me any troubleshooting tips . The thumb drive needs leaving in at all time ? Do I have to start Samba after each reboot of the device ?

    1. Hey! Try to open the share by accessing (from Windows Explorer or Total Commander) this: \YOUR.POGO.IP. If you get a “could not connect” or “location unavailable” than you have a problem with your router or Pogo setup.

    1. You need Samba in order to share files to your Windows/Linux/OSX PC, or to your smartphone/tablet/TV, without installing additional software. Samba is the main “network file sharing” protocol.

  14. I can see Pogoplug in my network but I cannot access it. A window pops out “Pogoplug is not accessible. You might not have permission to access this network source.” Any help?

  15. I’ve really tried but in 4.1 I have this error:

    -sh: wget: not found

    🙁

    Thanks anyway, It almost made me happy

    1. I finally managed to get it done 🙂

      Some issues that I had:

      1) If the wget it isn’t working, install WinSCP and manually send the files to the pogoplug

      2) The following code worked to start the SAMBA

      mount -o remount,rw /
      mount -o exec /tmp/.cemnt/mnt_sda1/ /opt
      mount -o remount,exec /opt
      /opt/etc/init.d/S80samba start

      3) If you want, in 11.3. you can use the WinSCP to edit the file in /opt/etc/samba/smb.conf, so you can copy past. Because you will have to do it for each HD you have.

      That’s thanks for you step by step.

  16. Whenever I try ‘cp /opt/lib/libnsl-2.5.so /opt/lib/libnsl.so’ or ‘cp /opt/lib/libnsl-2.5.so /opt/lib/libnsl.so.1’ I get: “cp: can’t stat ‘/opt/lib/libnsl-2.5.so’ : No such file or directory” Somebody please help

  17. Thanks for your wonderful instructions, I can now map my pogoplug as a network drive in my Windows. Thank you so much! You are a genius!

  18. Hi, Thanks for the instructions. It works well, except that I cannot manually copy LARGE files in Windows 8.1. I followed all steps above, and then I can see my Pogoplug drives in my Windows explorer if I map the disk as a network drive. Copying small files are fine. But I tried to copied a 4GB file, and it failed. Could you please share any solutions that can fix this issue? Thank you so much!

  19. Thank you very much!!

    Worked Perfect for me! I wonder if is possible share usb 2 also and rename sda1 to another name, could you show us how to do it?

    Thanks again

  20. Hi, i managed to follow all the steps and my pogoplug was working perfect. However, every time i restart it (or the system restarts for any reason) i have to start again from almost the beginning updating ipkg and downloading samba…is there any workaround for this? I have a Pogoplug V4. Thanks in advance.

  21. Symlinks are not supported on fat32, that’s why it won’t work. Format the drive as ext3 and then ln -s command will work to create symlinks.

  22. another howto for this here:  http://aaronrandall.com/blog/installing-samba-on-the-pogoplug/

    if wget doesn’t work, they install busybox and then use:  busybox wget

     

Leave a Comment

Your email address will not be published. Required fields are marked *