LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware
User Name
Password
Linux - Hardware This forum is for Hardware issues.
Having trouble installing a piece of hardware? Want to know if that peripheral is compatible with Linux?

Notices

Reply
 
LinkBack Search this Thread
Old 11-26-2012, 03:29 PM   #1
Felipe
Member
 
Registered: Oct 2006
Posts: 289

Rep: Reputation: 31
Access remote USB as local USB


Hello:

I've an Avermedia DVB-T, which connect to a remote computer using USB.
The computer where is connected is very slow, so I try to access the remote usb as if it where a local usb.
I've found different solutions as:
- usbredirectserver: But I've not found a usbredirect client. I see it can be used by virtual machines like QEMU, but don't know if there is a program which access the remote usb and offers it to applications as if it were local.
- USB network gateway. But it's no free.
Can any tell an easy way to access remote USB devices as if they were local?

Thanks

Last edited by Felipe; 11-26-2012 at 03:30 PM.
 
Old 11-27-2012, 08:38 AM   #2
jschiwal
Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 654Reputation: 654Reputation: 654Reputation: 654Reputation: 654Reputation: 654
You could use NBD (network block device). It won't speed up the USB drive, but you may see faster access with nbd over NFS.
 
Old 11-27-2012, 03:05 PM   #3
jefro
Guru
 
Registered: Mar 2008
Posts: 10,252

Rep: Reputation: 1255Reputation: 1255Reputation: 1255Reputation: 1255Reputation: 1255Reputation: 1255Reputation: 1255Reputation: 1255Reputation: 1255
I agree that the base system is still the weakest point. How can one overcome that by further using remote access which will consume more resources?
 
Old 11-27-2012, 05:54 PM   #4
Felipe
Member
 
Registered: Oct 2006
Posts: 289

Original Poster
Rep: Reputation: 31
Thanks for the answer.

I've installed nbd-server and nbd-client and configured server with:
Quote:
/etc/nbd-server# cat config
[generic]
# If you want to run everything as root rather than the nbd user, you
# may either say "root" in the two following lines, or remove them
# altogether. Do not remove the [generic] section, however.
# user = nbd
# group = nbd
allowlist = true
user = root
group = root
includedir = /etc/nbd-server/conf.d

# What follows are export definitions. You may create as much of them as
# you want, but the section header has to be unique.
[dvr0]
exportname = /dev/dvb/adapter0/dvr0

[demux0]
exportname = /dev/dvb/adapter0/demux0

[frontend0]
exportname = /dev/dvb/adapter0/frontend0

[net0]
exportname = /dev/dvb/adapter0/net0
Accessing from client, now I can see:
Quote:
linux-b2rk:/dev/dvb/adapter0 # nbd-client -l raspberrypi
Negotiation: ..
dvr0
demux0
frontend0
net0
I've created manually on /dev directories dvb/adapter0.
But if try to connect, I receive a message and nothing happens:
Quote:
nbd-client raspberrypi /dev/dvb/adapter0/dvr0 -name dvr0
Negotiation: ..
dvr0
demux0
frontend0
net0
File is not created. If I create a regular file, then I receive:
Quote:
touch dvr0
linux-b2rk:/dev/dvb/adapter0 # nbd-client raspberrypi /dev/dvb/adapter0/dvr0 -name dvr0
Negotiation: ..size = 16384MB
Error: Ioctl/1.1a failed: Inappropriate ioctl for device

Exiting.
So, what can I do?
 
Old 11-27-2012, 06:44 PM   #5
jschiwal
Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 654Reputation: 654Reputation: 654Reputation: 654Reputation: 654Reputation: 654
Share the block device for the USB file system instead e.g. /dev/sdb1 instead. Using the /dev/disk/by-uuid/ device symlink might be better. You might want to use udev rules to create and destroy the nbd device on the server side if it is removable.

Look at the simple example at the bottom of the "man 5 nbd-server" man page.
http://manpages.ubuntu.com/manpages/...-server.5.html
 
Old 11-28-2012, 03:14 PM   #6
jefro
Guru
 
Registered: Mar 2008
Posts: 10,252

Rep: Reputation: 1255Reputation: 1255Reputation: 1255Reputation: 1255Reputation: 1255Reputation: 1255Reputation: 1255Reputation: 1255Reputation: 1255
Let us know how well this works. I assume you are trying to use a low power system some place where you can get tv and then moving the use to a different location. I have considered such a plan but never attempted your way.
 
Old 11-28-2012, 05:43 PM   #7
Felipe
Member
 
Registered: Oct 2006
Posts: 289

Original Poster
Rep: Reputation: 31
Hello:

I'd like to come back and put the solution, but go on with questions (I use to put solutions to my questions when I find them).

I've never used nbd-sever or nbd-client so I've installed both packages on the same computer and tried with something simple. Ex: A file containing a disk image. Serve it with nbd-server, access it with nbd-client. I mount it on "/root/dirdisco/mnt" for nbd-server and "/root/dirdisco/mnt2" for nbd-client.

What I've done:
-Created a file for the disk:
Quote:
mkdir /root/dirdisco/disco.img
mkfs -t ext3 /roo/dirdisco/disco.img
- Configured nbd-server to server it. This is the configuration file:
Quote:
[generic]
# If you want to run everything as root rather than the nbd user, you
# may either say "root" in the two following lines, or remove them
# altogether. Do not remove the [generic] section, however.
# user = nbd
# group = nbd
allowlist = true
oldstyle = true
user = root
group = root
includedir = /etc/nbd-server/conf.d

# What follows are export definitions. You may create as much of them as
# you want, but the section header has to be unique.
[AverTv]
exportname = /dev/bus/usb/001/006
port = 1234

[Disco]
exportname = /root/dirdisco/disco.img
port = 1235

- Started nbd-server
Quote:
/etc/init.d/nbd-server start
- In the same computer (to be sure there is no problem with nbd-server and nbd-client releases), I've configured nbd-client:
Quote:
NBD_DEVICE[0]=/dev/nbd0
NBD_TYPE[0]="f"
NBD_HOST[0]="raspberrypi"
NBD_PORT[0]="1235"

- Started nbd-client
Quote:
/etc/nbd-client start
- I can see devices
Quote:
nbd-client -l raspberrypi
Negotiation: ..
AverTv
Disco
- Now, I mount the disco.img on directory /root/dirdisco/mnt and /dev/nbd0 on mnt2 as you can see:
Quote:
#mount
...
root/dirdisco/disco.img on /root/dirdisco/mnt type ext2 (rw,relatime,sync,dirsync,user_xattr,barrier=1)
/dev/nbd0 on /root/dirdisco/mnt2 type ext2 (rw,relatime,user_xattr,barrier=1)
- If I write something on mnt, I doesn't appear on mnt2. I've to umount /root/dirdisco/mnt2 and mount it again and files created/deleted are reflected in mnt2. But I've to umount/mount mnt2 to update directory (mount -o remount doesn't update files).

So something is wrong or I don't understand nbd. I've also tried with "sync" command, but files modified on mnt are not reflected on mnt2.

Whats wrong?

Thanks
 
Old 11-29-2012, 04:23 PM   #8
Felipe
Member
 
Registered: Oct 2006
Posts: 289

Original Poster
Rep: Reputation: 31
nbd-server and nbd-client don't work

Hello again:

I've repeated the same process, but instead of using raspberrypi with Raspbian, I've used my laptop with OpenSuse 12.2.

I mount the disk image with nbd-server and just from the same computer, I can list it with
Quote:
nbd-client -l mylaptop
Something strange is that Disco1 is listed twice:
Quote:
nbd-client -l mylaptop
Negotiation: ..
Disco1
Disco1
Now, I try to connect nbd-server and nbd-client:
Quote:
nbd-client -N Disco1 mylaptop /dev/nbd0
But then I can see this error in messages:
Quote:
Nov 29 23:09:59 mylaptop kernel: block nbd0: Receive control failed (result -32)
Nov 29 23:09:59 mylaptop kernel: block nbd0: shutting down socket
Nov 29 23:09:59 mylaptop kernel: block nbd0: queue cleared
And unable to mount /dev/nbd0
Quote:
mount /dev/nbd0 mnt2
mount: /dev/nbd0: can't read superblock
Please, can any give me an example of nbd on OpenSuse 12.2 (or raspbian) than works.

Thanks
 
  


Reply

Tags
remote, usb


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Debian Squeeze - remote access vs. local access permissions ?? billbrach Linux - Server 2 09-26-2012 04:29 PM
remote can't access local virtual machine flreey Linux - Desktop 2 09-19-2011 10:23 PM
Inquiry:USB external modem and Remote PC Access? hadimotamedi Linux - Newbie 3 10-26-2009 09:33 AM
Remote Windows access Linux USB disk 1kyle Suse/Novell 1 02-06-2007 04:18 PM
USB LexarMedia 32MB Data-Key + KDE 3.2=USB/HD Access problems that_guy Slackware 0 02-03-2005 08:27 AM


All times are GMT -5. The time now is 08:12 PM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration