Go Back   maemo.org - Talk > OS / Platform > Maemo 5 / Fremantle
 
Register FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools
  #1  
Old 2011-04-28, 13:35
hadrien.jouet hadrien.jouet is offline
 
Join Date: Mar 2010
Posts: 7
Thanks!: 1
Thanked 1 Time in 1 Post
Default Mounted network shares over USB

Hi,

I'm basically trying to turn my N900 into something like this http://hsti.com/shop/wireless-media-...ew-look-4.html. The idea being that I could plug my N900 in mass storage mode and be able to access network shares that way.

Just in case somebody asks, I've already tried mounting a share inside MyDocs, and whilst this works fine by itself, it prevents the phone from being connected in mass storage mode ("device is already in use").

Any pointers would be greatly appreciated!

Thanks.
Reply With Quote
  #2  
Old 2011-04-28, 15:35
hadrien.jouet hadrien.jouet is offline
 
Join Date: Mar 2010
Posts: 7
Thanks!: 1
Thanked 1 Time in 1 Post
Default Re: Mounted network shares over USB

Just a quick update, I have tried remounting /dev/mmcblk0p1/ whilst the device is connected through USB (which works fine) and then mounting the network share inside the MyDocs folder, but no files show under the network mounted folder on the PC.
Reply With Quote
  #3  
Old 2011-05-08, 21:58
Bernard Bernard is offline
 
Join Date: Jun 2006
Posts: 468
Thanks!: 67
Thanked 610 Times in 204 Posts
Default Re: Mounted network shares over USB

USB storage mode outputs a block device through USB.
The file system is unmounted in Maemo en the (now free) device is exported through USB. Because it is unmounted in maemo, any mounts or symlinks to network drives are not available anymore.

It is possible to use an image file of a drive and mount that as a loopback device on the N900. You can then output that image over USB or mount it on the N900 itself.
Information about this is in the wiki:
http://wiki.maemo.org/Repartitioning_the_flash
I don't think it is possible to use a network share as an loopback image, but if you find otherwise, please let us know.

There are other alternatives however.
In PC Suite mode, the N900 outputs an OBEX file server over USB. In the home folder there is an .obex folder. you can put an symlink to your mounted network drive there. After that it is accessible through USB (In Windows by default, and can be made to mount in linux).
Other options are setting up a network over USB and routing a share.
Reply With Quote
The Following 2 Users Say Thank You to Bernard For This Useful Post:
  #4  
Old 2011-05-08, 22:03
misiak misiak is offline
 
Join Date: Feb 2010
Location: Gdynia, Poland
Posts: 803
Thanks!: 3,621
Thanked 1,594 Times in 557 Posts
Default Re: Mounted network shares over USB

Quote:
Originally Posted by Bernard View Post
It is possible to use an image file of a drive and mount that as a loopback device on the N900. You can then output that image over USB or mount it on the N900 itself.
[...]
There are other alternatives however.
In PC Suite mode, the N900 outputs an OBEX file server over USB. In the home folder there is an .obex folder. you can put an symlink to your mounted network drive there. After that it is accessible through USB (In Windows by default, and can be made to mount in linux).
wow, lots of useful information for me, thank you by .obex do you mean /home/user/.obex-root/ folder?
Reply With Quote
  #5  
Old 2011-05-08, 22:48
Bernard Bernard is offline
 
Join Date: Jun 2006
Posts: 468
Thanks!: 67
Thanked 610 Times in 204 Posts
Default Re: Mounted network shares over USB

yes.

If you, for example, make a symlink to your root file system:
ln -s / /home/user/.obex-root/root

you will have a folder called "root" from where you can access ALL files on your N900. I haven't tested it with network mounts, but I think that should work also. But you should be careful. The obex server runs as user, not root. So you have the access rigths of the normal user, (read-only for most directories ) .
Also it is not very smart to link to the root folder, because the obex server also exports over Bluetooth. ANY paired and trusted device will have access to ALL files on your N900 (including contacts, browsing history, ssh keys, etc. etc. etc.).
Reply With Quote
The Following 2 Users Say Thank You to Bernard For This Useful Post:
  #6  
Old 2011-05-08, 23:01
misiak misiak is offline
 
Join Date: Feb 2010
Location: Gdynia, Poland
Posts: 803
Thanks!: 3,621
Thanked 1,594 Times in 557 Posts
Default Re: Mounted network shares over USB

Quote:
Originally Posted by Bernard View Post
yes.

If you, for example, make a symlink to your root file system:
ln -s / /home/user/.obex-root/root

you will have a folder called "root" from where you can access ALL files on your N900. I haven't tested it with network mounts, but I think that should work also. But you should be careful. The obex server runs as user, not root. So you have the access rigths of the normal user, (read-only for most directories ) .
Also it is not very smart to link to the root folder, because the obex server also exports over Bluetooth. ANY paired and trusted device will have access to ALL files on your N900 (including contacts, browsing history, ssh keys, etc. etc. etc.).
Thanks for even more information And for warning. I am not a noob, and not OP anyway I'm just working now on some scripts to control phone via bluetooth and the access to some directory this way can solve one of my problems maybe
Reply With Quote
  #7  
Old 2011-05-09, 07:33
hadrien.jouet hadrien.jouet is offline
 
Join Date: Mar 2010
Posts: 7
Thanks!: 1
Thanked 1 Time in 1 Post
Default Re: Mounted network shares over USB

Bernard, thank you so much for all this information! I'll see what I can figure out about loopback images from network shares. The OBEX file solution sounds like it would be a little less intrusive so I'll probably try that first.

Networking over USB is unfortunately not an option as the device I want to plug the N900 to only accepts USB data sticks and nothing else, hence the idea of serving network shares through USB.

I'll let you know how I get on, thanks!
Reply With Quote
  #8  
Old 2011-05-09, 08:39
Bernard Bernard is offline
 
Join Date: Jun 2006
Posts: 468
Thanks!: 67
Thanked 610 Times in 204 Posts
Default Re: Mounted network shares over USB

if the device only accepts USB data sticks, than you could be out of luck. I think the obex support in windows is done through a driver that is installed with Nokia Ovi Suite. And on ubuntu you need to install a few things for OBEX USB support (obexftp and obexfs if i'm not mistaken).

I made an automount script for Ubuntu some time ago. It uses an udev rule and obexfs to automatically mount any Nokia phone connected in PC Suite/Ovi Suite mode. The only problem is that Nautilus doesn't recognize the mount as being non-local, so I need to turn thumbnail previewing off.
So if you think that mounting folders through OBEX is buggy in Ubuntu, disable all file previewing first (edit-> preferences-> preview).

But if someone can tell me how I can tell nautilus to do that on a per folder basis, please let me know. It is the only reason why I don't make the script public (I don't want lots of support questions about this problem)
Reply With Quote
  #9  
Old 2011-05-09, 10:23
Bernard Bernard is offline
 
Join Date: Jun 2006
Posts: 468
Thanks!: 67
Thanked 610 Times in 204 Posts
Default Re: Mounted network shares over USB

Like I said. IF routing a network share over USB mass storage is possible, it isn't very easy.

After thinking about it, there may be an option, that I think has a good chance of working, but is isn't easy!

What you could try is this:
1. get your N900 to export an image as a loopback device over USB (is a bit tricky, and you should control the N900 over WIFI via SSH, because over an USB networking connection makes experimenting with the USB port difficult)

2. get your ubuntu machine (I assume that the "network drive" is on this machine) to make a virtual image representation of the harddrive that you originally intended to share over a network. The tool for this is called xmount. Test the image with a virtual machine in VirtualBox for example.

3. mount the directory with the virtual image representation on the N900 over a wifi network connection using NFS or SSH.

4. make the N900 use that image as a loopback device.
that way you should be able export a harddrive over a network through USB mass storage on the N900.

IF that works, then you may try to use xmount on the N900. But I think it only can use real harddrives, not network shares.

Good luck!
Please keep in mind, I'm only speculating, I have NOT tested any of this!
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 20:41.