LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 11-24-2012, 11:26 AM   #1
Find
Member
 
Registered: Jan 2012
Posts: 32

Rep: Reputation: Disabled
Make a folder act like USB Storage Device


I want to make a folder on linux act like a USB Storage Device.

Edit: This is on only one machine. I want to select a folder (via X11 Terminal is fine, if not preferred) and make it act as a fake USB Storage Device via some form of loop-back.



Old: If/Once I can do this, then I can then use it to transfer stuff back and forth withing a Virtual Machine and some old software of mine which requires files to be on a USB Storage Device. This will enable me to properly recycle or donate an old dedicated machine.

Last edited by Find; 11-24-2012 at 02:58 PM.
 
Old 11-24-2012, 01:25 PM   #2
michaelk
Moderator
 
Registered: Aug 2002
Posts: 14,931

Rep: Reputation: 1520Reputation: 1520Reputation: 1520Reputation: 1520Reputation: 1520Reputation: 1520Reputation: 1520Reputation: 1520Reputation: 1520Reputation: 1520Reputation: 1520
Are you asking if you can connect another computer via USB and have it act like a mass storage device? It depends on the hardware but probably not. USB has special hardware so you can not plug to host devices together. This hardware on a client i.e mouse or keyboard etc signals the computer the something has been plugged in but isn't on a host controller.

Is this a laptop?

Why do the files have to be on a USB device?
 
Old 11-24-2012, 02:54 PM   #3
Find
Member
 
Registered: Jan 2012
Posts: 32

Original Poster
Rep: Reputation: Disabled
Didn't mean to be confusing, please ignore the virtual machines (VM) comment.
You know how you can turn a folder into an image (.IMG or .ISO), or a zip file (.ZIP or .TAR), etc.? I want to convert the file into something which the same machine now registers as a USB Storage Device - it should be possible with some form of loop-back, you know, because files, devices, and such are all the same on linux.

Quote:
Originally Posted by michaelk View Post
Are you asking if you can connect another computer via USB and have it act like a mass storage device?
No, that wasn't what I was asking about, but if you know how I'd be interested in learning how to do that.

Quote:
Originally Posted by michaelk View Post
Is this a laptop?
I can't imagine that the form factor of the host machine should matter.

Quote:
Originally Posted by michaelk View Post
Why do the files have to be on a USB device?
Because that's the terrible way I wrote the software in the 90's. No source still exists due to a bad HDD failing. The software backsup its own configuration to a USB port.

Last edited by Find; 11-24-2012 at 03:06 PM.
 
Old 01-16-2013, 03:59 PM   #4
Find
Member
 
Registered: Jan 2012
Posts: 32

Original Poster
Rep: Reputation: Disabled
Any ideas on this front?
 
Old 01-16-2013, 04:14 PM   #5
suicidaleggroll
LQ Guru
 
Registered: Nov 2010
Location: Colorado
Distribution: OpenSUSE, CentOS
Posts: 5,258

Rep: Reputation: 1947Reputation: 1947Reputation: 1947Reputation: 1947Reputation: 1947Reputation: 1947Reputation: 1947Reputation: 1947Reputation: 1947Reputation: 1947Reputation: 1947
Quote:
Originally Posted by Find View Post
The software backsup its own configuration to a USB port.
How does the software determine what is and is not a USB drive, as opposed to a local SATA drive or some other kind of USB device? Is the USB drive supposed to be mounted at the time the code is ran?

Last edited by suicidaleggroll; 01-16-2013 at 04:15 PM.
 
Old 01-16-2013, 04:45 PM   #6
Find
Member
 
Registered: Jan 2012
Posts: 32

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by suicidaleggroll View Post
How does the software determine what is and is not a USB drive, as opposed to a local SATA drive or some other kind of USB device? Is the USB drive supposed to be mounted at the time the code is ran?

I need the folder on the Host machine to be recognized as a USB Storage Device on the Host machine. Just like you can mount and unmount a drive - that procedure. That way, VirtualBox will see the "USB Device" (really the folder in some form of loopback setup I guess). Windows can then mount what it thinks is a USB Drive, and then Windows tells the program that there is a usb storage device plugged in. This is then followed by I/O to the USB Drive via the software.

I suppose if Windows saw a USB connected SATA Drive that might work as well.
 
Old 01-16-2013, 05:04 PM   #7
suicidaleggroll
LQ Guru
 
Registered: Nov 2010
Location: Colorado
Distribution: OpenSUSE, CentOS
Posts: 5,258

Rep: Reputation: 1947Reputation: 1947Reputation: 1947Reputation: 1947Reputation: 1947Reputation: 1947Reputation: 1947Reputation: 1947Reputation: 1947Reputation: 1947Reputation: 1947
So it's not about fooling the software into thinking it's a USB drive, it's about fooling VirtualBox into thinking it's a USB drive so that it will pass the "device" into the VM. I'm afraid I have no idea how to do that.
 
Old 01-16-2013, 05:43 PM   #8
Find
Member
 
Registered: Jan 2012
Posts: 32

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by suicidaleggroll View Post
So it's not about fooling the software into thinking it's a USB drive, it's about fooling VirtualBox into thinking it's a USB drive so that it will pass the "device" into the VM. I'm afraid I have no idea how to do that.
It isn't really a Virtualbox specific question, rather it is about the USB and Filesystem in linux. I just want linux to recognize a folder as a USB Storage Device. I can make linux think a file is a storage device and mount it - such as an image or ISO - but I want to mount it as a USB Storage Device not just a Storage device.
 
Old 01-16-2013, 08:24 PM   #9
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,331
Blog Entries: 55

Rep: Reputation: 3529Reputation: 3529Reputation: 3529Reputation: 3529Reputation: 3529Reputation: 3529Reputation: 3529Reputation: 3529Reputation: 3529Reputation: 3529Reputation: 3529
I would just add a blank fd or HD image but if you must emulate an USB device check out the Backing Storage for the File-backed Storage Gadget and File-backed Storage Gadget, part 2.
 
  


Reply


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



Similar Threads
Thread Thread Starter Forum Replies Last Post
USB drive not working properly, read only device? (USB key storage device) Arodef Linux - Hardware 14 01-01-2010 08:32 AM
make linux act as a USB mouse for a windows computer 70k51k Linux - Software 1 11-22-2009 08:37 PM
arm board act as a usb mass storage scuyuzh Linux - Embedded & Single-board computer 3 09-09-2008 07:30 AM
how to not add .Trash-user folder to storage device poiuytrewq Linux - Newbie 4 12-29-2004 10:31 PM
How do I make my USB flash drive act like a normal disk? KingofBLASH Linux - Hardware 2 09-13-2004 09:26 PM


All times are GMT -5. The time now is 02:30 AM.

Main Menu
Advertisement
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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration