How to install SAMBA on Pogoplug 4

mobile-45-front-f

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:

2. Create the main directory:

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

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

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”:

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

4.2. Cleanup:

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”:

5.2. Move the new packages into their right places:

5.3. Cleanup

6. Setup IPKG.

6.1. Create IPKG’s working directory:

6.2. Add repositories to IPKG:

6.3. Copy dependant files:

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

 8. Install SAMBA’s dependencies:

8.1. Install “libnsl”:

8.2. Copy dependant files:

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

9. Install SAMBA:

10. Prepare SAMBA’s configuration files:

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

10.2. Create a new configuration file:

11. Configure SAMBA:

11.1. Edit the configuration file with VIM:

11.2. Press “i” on the keyboard.

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

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:

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:

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

14. Useful commands:

– Restart SAMBA:

– Start SAMBA after device reboot/reset:

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

Inspired from: PogoMarvel, Aaron Randall, GeekWind.

  • Dalsim

    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.

    • Razva

      Did you got any errors previously, when installing SAMBA or the dependencies?

  • Dalsim

    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.

    • Razva

      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/”.

  • Dalsim

    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

    • sebb

      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”

      • Dalsim

        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

        • Razva

          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.

  • sebb

    Hello,

    how can I add user with a password ?

    • sebb

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

      • Razva

        Hi. Did you remounted /opt? Is the drive formatted as NTFS?

  • Ronald

    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”

    • David

      have you got on idee what to do? I have the same problem

  • 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

  • Keith Weightman

    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.

    • CaMiX

      Can you explain what you did differently to get samba36 working?

      • Michael Altobelli

        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

  • Michael Altobelli

    The reason you and the ipkg scripts cannot create the symlinks if FAT32 does not support them. I used ext2 and the package scripts created the links.

    Perhaps one of these will work if you don’t have a linux install to make an ext2 partition.
    http://www.ehow.com/how_7492668_create-ext2-partition-windows.html

  • k_nidu

    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.

  • John Pilling

    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.

  • Andy

    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?

    • Andy

      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.

      • Niels Kersic

        Thanks! I ran into the same problem but this also worked for me

  • Pingback: Wireless local backups for a Mac and PC « Huge Blog()

  • Gerhard Willemse

    You are a star!

    • Razva

      Thanks, appreciate! 🙂

  • PRINCAL

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

    • Razva

      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.

  • Vivek

    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.

    • Dave Lyon

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

      • Robert Fritz

        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?

  • Pingback: New gadget for tinkering : Pogoplug Pro | All Things Tech()

  • javramos

    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

    • Razva

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

  • steven p

    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 ?

    • Razva

      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.

  • rapser

    Why I need samba? How secure it is?

    Thanks

    • Razva

      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.

  • Philip Rommel Ascalon

    I tried

  • philip rommel ascalon

    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?

  • Guilherme Gornati

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

    -sh: wget: not found

    🙁

    Thanks anyway, It almost made me happy

    • Guilherme Gornati

      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.

  • Niels Kersic

    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

  • Pingback: How to install Archlinux, My.Pogoplug and Samba on Pogoplug 4 - Razvan Rosca - Viata in pixeli()

  • savioler

    only ext fotmat support symlinks

  • Tom

    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!

  • Tom

    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!

  • Ruben Mayorga Varela

    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

  • Felipe C

    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.

  • tduffy83

    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.