cifs samba mounting.

General discussion relating to the O2 Joggler, from the default O2 setup, to alternative operating systems and applications.
Posts: 1143
Joined: Fri Mar 04, 2011 3:22 pm
Location: Edinburgh

Re: cifs samba mounting.

Post by gegs » Thu May 24, 2012 11:40 pm

I tried with FAT32 but lots of "cant preserve ownership of <file name here>: Operation not permitted" errors when I tried to copy the cache to it. At least the stick is writeable because I can now create folders on it, which is a start.

--- EDIT ---

I checked this morning and the cache had copied to the USB stick. Last night it looked like nothing had copied over in WinSCP but this was obviously just a refresh problem. The error I got seems to be one of changing permissions on the files copied. I'm not sure if this will cause me problems but I'll try symlinking to the USB cache some time over the weekend.

Thanks for your help with this Max. If I can get this working I'm sure it'll be very helpful to forum members; loads of people have posted about mounting a NAS in LMS and if I can do it (with your help) anyone can.

Posts: 1143
Joined: Fri Mar 04, 2011 3:22 pm
Location: Edinburgh

Re: cifs samba mounting.

Post by gegs » Sat May 26, 2012 9:59 am

I followed all the other steps in your instructions Max and the contents of the USB cache folder were indeed listed by 'ls' after I'd set up the symlink. Unfortunately LMS wouldn't start up with the symlinked cache folder. Maybe something to do with the permissions problem I encountered writing the files to the USB stick initially.

Posts: 30
Joined: Thu Jul 14, 2011 5:48 pm

Re: cifs samba mounting.

Post by Max » Sat May 26, 2012 10:45 am


OK, try this:

cp /etc/fstab /etc/fstab.backup
vi /etc/fstab

(enter the following line at the bottom)

/dev/sda1 /mnt vfat rw,user,noauto,umask=000,uid=20,gid=20

(Note: uid and gid user id and group id, are of the squeezebox server from the /etc/passwd and /etc/group files, should be the same for yours.)

exit and save.

Stick the usb in.

Wait a couple of seconds.


umount /mnt


mount /mnt (If anyone knows how to get the automounter in the joggler to mount what is in the fstab please let me know.)

/mnt should now be owned by the squeezebox user (ls -la /).

Give the copy and symlink bit another go.

Hope that make sense.

User avatar
Posts: 18
Joined: Fri Feb 24, 2012 9:05 pm

Re: cifs samba mounting.

Post by joh » Sun May 27, 2012 9:27 am

On the newer busybox build I changed the SMB mount command to



Code: Select all

/bin/mount -t cifs // /media/music/smbshare -o user=auser,password=apass,iocharset=utf8  

Code: Select all

/bin/mount -t cifs //\\music /media/music/smbshare -o user=auser,password=apass,iocharset=utf8  
Then it works again. It looks a bit odd.

Posts: 1143
Joined: Fri Mar 04, 2011 3:22 pm
Location: Edinburgh

Re: cifs samba mounting.

Post by gegs » Mon May 28, 2012 11:01 am

@Max - I'm going to give your suggestions a spin later this week but probably more out of curiosity than anything else.

If the USB stick won't automount at boot it won't be much use to me. My family use Squeezeplay regularly and would be unfamiliar with the concept of mounting/unmounting a drive. If LMS won't start properly without intervention it would drive them nuts.

Streaming from my NAS would be the icing on the cake, but I may have to rely on and Triode's excellent Spotify plugin for most of my music needs until someone posts an automount solution.

The best solution IMO would be to have SqueezePlay OS and LMS running from an 8GB or 16GB stick if this was possible. I may even try to install LMS on a stick with roobarb's SqueezePlay OS; it apparently has apt-get capability and a command line interface tool. I may even be able to install MPlayer to play WMA streams. Roobarb may be able to confirm if this is feasible; I've posed the question on the SqueezePlay OS thread.

-- EDIT --
wrong about the CLI tool but commands can be run using SSH on Squeezeplay OS.

Posts: 25
Joined: Sat Aug 27, 2011 6:39 pm

Re: cifs samba mounting.

Post by monkeydogcat » Fri Aug 17, 2012 10:20 pm

This thread is linked from the first post in the PnP III thread with the comment "cifs/samba shares can be made to work". Well, I can't make it work. I've never attempted it before now. I only loaded PnP III a week ago.

I've got the cifs.ko module and it's loaded

Code: Select all

# lsmod | grep cifs
cifs                  221428  0
# busybox
BusyBox v1.10.4 (2010-06-25 14:21:21 EDT) multi-call binary
That version of BusyBox confuses me. I have PnP III. This thread is linked from the PnP III thread, yet the first post in this thread seems to say the problem with not being able to mount cifs is because of a problem in busybox 1.19.4. Which I don't have. As far as I can see, PnP III comes with busybox 1.10.4.

I've tried many variants of the mount command I've lost track. Either they exit with no output but the mount doesn't work (checking the exit code of the mount command shows it's 1) or I get "mount: mounting blah on foo failed: Invalid argument"

A post earlier in this thread says
I noticed that the "dummy" argument is not so "dummy", as it is assumed as the name of the remote share.
But I've no idea what that's supposed to mean. The example command after it uses the argument 'MyMusicLibrary' but I have no idea how one determines what the name of the remote share is.

The cifs share is from my router which can share a drive attached to it's USB port. I can mount it on my Mac and by Android tablet. There's no username/password required, or indeed even set up so I've been using '-o guest' with the mount command.

The IP address is when I mount that on the Mac or tablet I get a directory called Volume1 and that contains the directories that are in the root of the USB drive called Music and Video.

Can anyone explain to me how to get this mounted on my Joggler?

Posts: 25
Joined: Sat Aug 27, 2011 6:39 pm

Re: cifs samba mounting.

Post by monkeydogcat » Fri Aug 17, 2012 11:26 pm

After a a bit more flailing around I discovered this works for me

Code: Select all

# mount  -t cifs // /media/netstorage/ -o ro,username=guest,password=guest

User avatar
Posts: 264
Joined: Fri Jul 20, 2012 8:39 pm

Re: cifs samba mounting.

Post by JimbobVFR400 » Sun Aug 19, 2012 5:38 pm

Glad it works. However I might suggest adding
On the end of your mount command. This ensures that it'll wait until the network connection is available before mounting. Before I added this option on mine I found occasionally the mount would fail if the network wasn't available and would then require either running the mount manually via SSH or a reboot. Since adding _netdev I've not had any problems.

Posts: 60
Joined: Fri Mar 04, 2011 12:01 pm

Re: cifs samba mounting.

Post by danjog2 » Sun Sep 02, 2012 4:24 pm

Please have pity on a old noob?

I've got a winscp connection to my joggler and really want to get my NAS linked. Can someone gently explain which lines of code go where and how I do that?
I've downloaded the cifs.ko module which is sitting in / on the joggler. My NAS lives at the share is called \\LS-CHLF57\Share and the user name is admin and the password is ******

Thanks for your patience.

Post Reply