Mount USB Thumb Drive

Hi!
Anyone know how to mount standard USBMSC thumb drive to QNX6.3?

Kitcad,

I have the following in my /etc/rc.d/rc.local file:

Start USB support

io-usb -d uhci
waitfor /dev/io-usb/io-usb
sleep 1

devb-umass &

Sample mount command for USB drive

mount -t qnx4 /dev/hd1t77 /fs/hd1

You can place all that there if you want support auto-started when QNX boots.

You can also issue all these commands as root from a shell.

The only thing you’ll need to do different is the mount command. For that you will need to know the info on how the USB driver mounted the thumb drive. Use the ‘df’ command to get the disk information on all disks on your system (including the thumb drive) and then give the appropriate infomation to mount (the /dev/hd1t77 part is the part that will likely be different for your thumb drive).

Then you access the drive by doing ‘ls /fs/hd1’

Tim

you mean put part of code into /etc/rc.d/rc.local

#start from here →

Start USB support

io-usb -d uhci
waitfor /dev/io-usb/io-usb
sleep 1

devb-umass &

#end here ←

But, i didnt see /dev/io-usb into /dev folder. it is at /sbin folder.

when i type df, i have these
/dev/hd0t79
/dev/hd0t12
/dev/cd0
/dev/fd0
/dev/hd0

Which 1 shd i use?

how to unmount the thumb drive just like windows “safely unplug usb drive”?

Correct. That is the part you want to place in rc.local

/sbin/io-usb is where the io-usb driver resides.

/dev/io-usb won’t show up until you start io-usb. It gets created by the io-usb driver and lets you know the driver has successfully installed so that you can now start the devb-umass driver. That’s why the waitfor is there to wait for the driver to finish initializing.

/dev/hd0t79 39053952 5413415 33640537 14% /
/dev/hd0t12 39050976 7262496 31788480 19% /fs/hd0-dos/
/dev/fd0 2880 2880 0 100%
/dev/cd0 0 0 0 100% (/fs/cd0/)
/dev/hd0 78125000 78125000 0 100%

This is what my df command returns. This is without any USB thumb drives plugged in.

What you should do is run ‘df’ without any thumb drives installed. Then plug in the thumb drive (this assumes you have run all the commands to start the drivers) and run ‘df’ again. The new entry printed by df is the thumb drive.

If the ‘df’ command doesn’t report anything different after plugging in the usb thumb drive then can you also run ‘usb -vv’ WITH the thumb drive plugged in and report what it prints here.

To safely remove the drive, use the umount command to unmount the drive.

Tim

i can mount my thumb drive now. u mean “unmount /thumb_drive_directory”? or?
Possible to make it plug and play just like windows where we can plug-in without key-in command at terminal?

Kitcad,

Glad you got it working.

Yes, you’ll need to type in something like ‘umount /fs/hd1’ from the terminal.

As to the plug-n-play issue, the short answer is no. The long answer is you could write your own photon graphic application to accompish plug-n-play. Without photon, there is no way to emulate windows plug-n-play when you double click the icon and tell it to unmount (the automatic mounting is the easy part).

Tim

oh…ic…i’m newbie for QNX. Thus, mind u tell how to start. i mean what application need to use in order to write photon graphic application.

Sure? At least there is an PnP option for devb-umass, and I think I once heard of automount options for usb devices. By that time it was known not to work properly, but perhaps they fixed it already.

There is a tool called Photon Application Builder (PhAB) to do this.

oh…ic… u did try b4 for the auto-mount?

Kitcad,

No, I’ve never written anything to automount the thumbdrive.

But the concept isn’t hard for a reasonably experienced QNX person.

There are examples (not sure if any are posted on this forum but there definitely is in the help files) of how to wait for a driver to signal that a device (the thumb drive is plugged in) at which point your deamon progam can issue the mount command.

Tim

sorry. apologize if some of the q may look stupid q. i’m new in qnx. what is deamon program?

Kitcad,

A Deamon program is common to Unix(y) type operating systems like Unix, QNX, Linux etc.

Basically it’s a program that runs in the background without need for any user interaction. It’s designed to wait for a certain event to occur and then act on that. In your case, the event would be the thumb drive inserted. Another example of a Deamon program under QNX is inetd which waits for telnet and ftp connections to the QNX machine and when they occur inetd starts the telnet and ftp programs.

Tim

ok…i know linux has such driver to support automount. anyway, thanks for your advise.

that was me talking about automount ;)

However I never tried it myself, a colleague used it but as I said it was not reliable, perhaps some beta programme. I don’t know.

SmeeAgain,

Yes, I remember there was an option to devb-umass to restart the driver automatically each time a device was inserted. I think I tried it in 6.21 and found it to be quasi-reliable.

I just checked and that option seems to no longer be there in 6.3 SP2 so my guess is it was never working that well and was removed which is why I suggested writing your own automount which shouldn’t be that hard.

Tim

HI! Tim,
how’ re u? sorry need to wake this topic up again. I stop using qnx quite sometime. Recently, need to use back but cant able to mount usb thumb drive. the thumb drive work on win xp.
i try io-usb -d uhci on terminal but, i got /bin/sh: io-usb : not found
any idea?

You’ve got a pathing problem.

Do a ‘which -l io-usb’.

It should show up as /sbin/io-usb.

What you see indicates that /sbin isn’t in your path (do an ‘echo $PATH’ to see your path). You can manually enter the path by doing an ‘/sbin/io-usb -d uhci’.

Tim

which -l io-usb

which: no io-usb in /sbin:/usr/sbin:/bin:/usr/bin:/usr/photon/bin:/usr/photon/ap
pbuilder:/opt/X11R6/bin:/usr/X11R6/bin:/usr/local/bin:/usr/local/sbin:/opt/bin:/
opt/sbin:/usr/qde/eclipse/jre/bin

seem like my qnx 6.2.1 dont hv io-usb,right? where to get this driver?

OMG 6.2.1 is pretty old and should only be used in emergency. The USB support of 6.3 SP3 is much better.