Re: Mount a Windows share on your Chumby! (Solution inside)

My linux is rusty  -- I have a windows home server, and I love the idea of fooling the chumbys in the house into them thinking the WHS server is there /mnt/usb.

So what would I name a script that would run on boot up to do the mkdir - mount thing? 

Also is there a way to set up the WHS share so the music would run automatically?

Re: Mount a Windows share on your Chumby! (Solution inside)

I don't think you could get the music to run automatically, but for the mounting at boot, simply create a debugchumby file as described on the wiki.

Linux Guy - Occasional Chumby Hacker

Re: Mount a Windows share on your Chumby! (Solution inside)

We-eel, yes, it could be possible on a chumby One.  Though it requires modifying the startup script.

Mount / as rw, and add this to /etc/init.d/rcS.background at around line 360:

mkdir /mnt/usb && mount -tcifs //192.168.1.6/share /mnt/usb -ousername=foo,password=bar

Obviously, change the IP, share, username, and password.

What this will do is actually quite interesting.  If you plug in a USB drive and reboot the chumby, it will mount that as /mnt/usb and nothing will change.

If, however, you start up without anything in the drive, and if it boots up with the network connected, then /mnt/usb will be your Windows share.  Even more interesting is that the "debugchumby" script is evaluated sometime after this, so you could create that file on your Windows share and get it to automatically start playing something.

29 (edited by clever_screen_name 2009-12-14 20:08:39)

Re: Mount a Windows share on your Chumby! (Solution inside)

OK, so I've got my brand new chumby one smile and I've used mount -no remount,rw / to mount root as rw.

Line 360 in my /etc/init.d/rcS.background is smack in the middle of the block:

if [ -x /mnt/usb/userhook2 ]; then
    /mnt/usb/userhook2
fi

Should the new line be inserted before or after that block?

Also, I am a little unclear as to how to play the music from the windows share. Previously, I used the command

mount -t cifs //your.ip.address/share /mnt/usb -o user=username,pass=password

to mount the windows share successfully, but when I went into Control Panel==>Music==>My Music Files, Chumby thought about things for a long while before crashing. Am I going about this the wrong way? There are no mp3's in the root of the windows share, but there are thousands in the directories below. Could either of those cause the problem?

Re: Mount a Windows share on your Chumby! (Solution inside)

Yes, that's the problem - the player is expecting a relatively small number of music files on a USB dongle, not a hard drive with thousands of files.

31 (edited by kathleen 2009-12-15 05:11:34)

Re: Mount a Windows share on your Chumby! (Solution inside)

How do you mount / as w?  I've tried a couple of ways and it failed.

Re: Mount a Windows share on your Chumby! (Solution inside)

SSH to your chumby and type "mount -o remount,rw /"

Linux Guy - Occasional Chumby Hacker

Re: Mount a Windows share on your Chumby! (Solution inside)

Worked like a champ.  Thank you, and I bow down to your greatest <smile>

Re: Mount a Windows share on your Chumby! (Solution inside)

So can this be done on the classic Chumbys?  I have two.  I know it isn't the same file or same place, but is there someplace similar?

Re: Mount a Windows share on your Chumby! (Solution inside)

I had luck last night with a share containing just about 3k files, totaling almost 10GB. 14 GB was too much, however, so the breaking point is somewhere in there, at least for the C1. I used the symbolic link as did ski4404, since the folder wasn't shared out directly.

36 (edited by Materdaddy 2009-12-16 09:46:22)

Re: Mount a Windows share on your Chumby! (Solution inside)

kathleen wrote:

So can this be done on the classic Chumbys?  I have two.  I know it isn't the same file or same place, but is there someplace similar?

No, the chumby classic has a rootfs in nand using the cramfs filesystem which is READ ONLY!  If you want to create a custom rootfs, you would have to prepare it on a linux host and flash it to nand using the update utility as discusssed in this thread.

One problem I had when playing with the rootfs was that the device nodes were disappearing on my host system.  I never work as root, so those were not being created when copying a mounted cramfs to another directory.  This made my chumby classic halt after the kernel loaded.  I'm sure it was some form of kernel panic, but I don't have a serial console on mine so my debugging was slow (try and try again), but came down to missing device nodes in the rootfs.

Linux Guy - Occasional Chumby Hacker

Re: Mount a Windows share on your Chumby! (Solution inside)

You can usually run under fakeroot to get the dev nodes to be "created".  Our build system does this when it goes to create the initial images, as it doesn't run as root either.

There's also a probably a script called "mkdevs" that you can run at the top of init to create dev nodes.

Re: Mount a Windows share on your Chumby! (Solution inside)

I use fakeroot for quite a few things, but I didn't for this.  I haven't modified the rootfs much for my CC.  Basically to add a root password, and make the motd display a smaller chumby (dropbear ssh client barfs with the default init string being too large).

Linux Guy - Occasional Chumby Hacker

39 (edited by Gompka 2009-12-19 23:25:55)

Re: Mount a Windows share on your Chumby! (Solution inside)

Ok so after doing everything and then typing this:

- Type 'ls /mnt/win_share', hit ENTER.
- You should see the root of your music share

I see a list of the folders on my share, also works if i use the file browser to look into mnt/win_share


But when i go into music and my files on the chumby one i see nothing, am i missing something?


*edit*
I figured it out, i mounted to mnt/usb instead of mnt/win_share.... Had to mkdir mnt/usb first though.

Re: Mount a Windows share on your Chumby! (Solution inside)

Ok, finally got an automated script to work.

1. SSH into the chumby (use WinSCP, its free) and create a new directory:-

/psp/rfs1

2. create a file (and make sure its executable - 755), called userhook2

3. Edit the file and put the following script in it:-

mkdir /mnt/synology
insmod /drivers/cifs.ko
mount -t cifs //x.x.x.x/music /mnt/synology -o username='admin',password='zzzzzz'
ln -s /mnt/synology /mnt/usb

replace x.x.x.x with the IP address of you Synology Diskstation, and zzzzzz with your Admin password

4. Reboot the Chumby

You should now see files in 'My Music Files' within the control panel.

Re: Mount a Windows share on your Chumby! (Solution inside)

Hi there,
I tried the proceedure as well.
So far so got, I'm able create the folder and tried to connect to the NAS
But I'm always getting the feedback that 'mounting failed'

Here my input:
chumby:~# mount -t cifs //192.168.0.180/ /mnt/music -o username='USERNAME',password='PASSWORD'
mount: \\192.168.0.180\ is write-protected, mounting read-only
mount: mounting \\192.168.0.180\ on /mnt/music failed

Can anyone help me?
Thanks for feedback
Sebastian


midiwall wrote:
Lasticko wrote:

Excellent step by step... but I'm getting an error on trying to mount.  I have a windows box in the default windows "WORKGROUP"..
it IS a large drive I'm trying to mount (over 1TB)...

chumby:~# mount -t cifs //gameon/jukebox /mnt/win_share -o username='administrator',password='(passwordhidden)'   
mount: mounting \\192.168.2.17\jukebox on /mnt/win_share failed

I've tried all combos, including username='gameon/administrator'
and I have a FreeNAS box as well.. I couldn't get it to connect to that either.

Any ideas on what would trip this up?
Thanks

Yeah, mount's not the best at giving up "why". smile

When I got an error, it was from not having installed cifs. So to be sure, head back to the chumby prompt and:

#insmod /drivers/cifs.ko

(yeup, that's different than in my babble above. That command points to the module that Duane pointed out is a part of firmware 1.5)

If that goes well, then try using the IP address of the windows box instead of the machine name:

#mount -t cifs //192.168.1.101/jukebox /mnt/win_share -o username='administrator',password='(passwordhidden)'

and then, from a shell prompt in Windows, be sure that you can see the share:

c:>dir \\192.168.1.101\jukebox

(note the slashes flipped direction)



(just noticed Duane posted... he's right! I missed it! I'll revise the above)

Re: Mount a Windows share on your Chumby! (Solution inside)

Hi Folks,
    dont want to steal anyones thunder here (sorry if i am as this is all good stuff) but just wanted to mention that within a few weeks I should be releasing a widget like USB music that uses the above type capabbility to stream over the LAN. The widget works at the moment but i am adding some encryption and automated script updates that are taking longer tahn expected.

cheers

Nigel

smile smile smile

Re: Mount a Windows share on your Chumby! (Solution inside)

@embryonic Run "dmesg" and see if anything useful appears towards the bottom.

Re: Mount a Windows share on your Chumby! (Solution inside)

embryonic wrote:

Hi there,
I tried the proceedure as well.
So far so got, I'm able create the folder and tried to connect to the NAS
But I'm always getting the feedback that 'mounting failed'

Here my input:
chumby:~# mount -t cifs //192.168.0.180/ /mnt/music -o username='USERNAME',password='PASSWORD'
mount: \\192.168.0.180\ is write-protected, mounting read-only
mount: mounting \\192.168.0.180\ on /mnt/music failed

Hello embryonic. It looks as though you are trying to mount 192.168.0.180 and not an actual share on the device. You stated that it was a NAS so I can't say for certain what your setup would be, but try going one directory lower with your mounting.

In simpler terms you should make \\192.168.0.180\netmusic a folder that you can get to from your computer through the network and then try accessing the 192.168.0.180/netmusic share with the mount command. Even a "net use" from windows will fail with a "/" appended to the end, so you would try

mount -t cifs //192.168.0.180/netmusic /mnt/music -o username='USERNAME',password='PASSWORD'