Sun Solaris USB Flash Drive mount command (scsa2usb driver)

Sun Solaris USB Flash Drive mount command (scsa2usb driver)

Post by Eunice Santori » Thu, 25 Sep 2003 19:40:30



I plugged in a USB 1.0 flash drive into a SunBlade 1000 (Solaris 8).
I'm now tring to figure out the mount command.
Can you help.
Here is what I've done so far:

I tried to follow the USB Flash Drive help at:
 http://www.netsys.com/cgi-bin/display_article.cgi?1245
 and http://www.netsys.com/cgi-bin/man2html?scsa2usb
----------------------------------------------------------------------------
I ran:
 csh% dmesg | grep scsa2usb
WHICH REPORTED (on machine 'eunice'):
 Sep 23 15:24:06 eunice usba: [ID 855233 kern.info]

 Sep 23 15:24:06 eunice genunix: [ID 936769 kern.info]

 Sep 23 15:24:06 eunice scsi: [ID 193665 kern.info]
                 sd45 at scsa2usb0: target 0 lun 0

 Sep 23 15:24:06 eunice genunix: [ID 408114 kern.info]

----------------------------------------------------------------------------
The next step is supposed to be the mount step, but, this failed:
 csh% su root
 csh# mkdir /flash
 csh# mount -F pcfs /dev/dsk/c1t1d0s2:c /flash
      Which reported: mount: /dev/dsk/c1t1d0s2:c is not a DOS filesystem.
 csh# df -kl
      Does not report the existance of this flash drive.
----------------------------------------------------------------------------

Probably I have the data incorrect in the mount line for the
controller:target:disk:slice:1 information in the mount command.

But, how do I find out that data for the mount command?
If it's in the dmesg output ... I don't understand that well enough to
find the controller, target, disk, & slice information for this new flash
drive.

Any help is appreciated,
Eunice

 
 
 

Sun Solaris USB Flash Drive mount command (scsa2usb driver)

Post by darcwy » Fri, 26 Sep 2003 01:21:23



> I plugged in a USB 1.0 flash drive into a SunBlade 1000 (Solaris 8).
> I'm now tring to figure out the mount command.
> Can you help.

I'm pretty sure all you need to do is restart volume manager so it
will scan for new devices.

pkill -HUP vold

Then the usb mass storage will be automatically mounted any time you
insert the usb stick into a usb slot.  Before you remove the stick go
to removable media manager and "eject" it.

 
 
 

Sun Solaris USB Flash Drive mount command (scsa2usb driver)

Post by Juergen Kei » Fri, 26 Sep 2003 01:55:10





> > I plugged in a USB 1.0 flash drive into a SunBlade 1000 (Solaris 8).
> > I'm now tring to figure out the mount command.
> > Can you help.

> I'm pretty sure all you need to do is restart volume manager so it
> will scan for new devices.

> pkill -HUP vold

That won't work, because the OP is running Solaris 8.  "pkill -HUP vold"
does work on Solaris 9.

For Solaris 8, you have to fake a change on the vold.conf
configuration file, otherwise the HUP signal is ignored:

        touch /etc/vold.conf
+       pkill -HUP vold

 
 
 

Sun Solaris USB Flash Drive mount command (scsa2usb driver)

Post by Eunice Santori » Fri, 26 Sep 2003 16:34:45


Quote:> For Solaris 8, you have to fake a change on the vold.conf
> configuration file, otherwise the HUP signal is ignored:

>         touch /etc/vold.conf
> +       pkill -HUP vold

I think I'm royally screwed up now.

I stopped vold & commented out the one /etc/vold.conf line:
# use rmdisk drive /dev/rdsk/c*s2 dev_rmdisk.so rmdisk%d

But, now when I try to determine the device the USB flash card is
controlled by (controller#,target#,disk#,slice#,:table#) I get:

   csh% devfsadm -v -i sd
   csh% iostat -En | more
        Which reports:
         sd45  Soft Errors: 64 Hard Errors: 0 Transport Errors: 0
               Vendor: UsbFlash Product: Drive Revision: 1.00 Serial No:
               Size: 18446744073.71GB <-1 bytes>
               Media Error: 0 Device Not Ready: 0 No Device: 0 Recoverable: 0
               Illegal Request: 4 Predictive Failure Analysis: 0

         sd46  Soft Errors: 0 Hard Errors: 0 Transport Errors: 0
               Vendor: UsbFlash Product: Drive Revision: 1.00 Serial No:
               Size: 0.00GB <0 bytes>
               Media Error: 0 Device Not Ready: 0 No Device: 0 Recoverable: 0
               Illegal Request: 0 Predictive Failure Analysis: 0

Before I had device names looking more like "c4t0d0s2:c" but now for some
reason I'm getting device names such as "sd46".

Any idea what the heck I am doing so drastically wrong?
I just want to plug in a USB 1.1 stick and to access it on my Sun Solaris 8
workstation as simply as possible.

thsnks,
Eunice

 
 
 

Sun Solaris USB Flash Drive mount command (scsa2usb driver)

Post by Jan Bir » Sat, 27 Sep 2003 14:13:03


Quote:>  csh# mount -F pcfs /dev/dsk/c1t1d0s2:c /flash

I use this device for my keyring ramdisk (USB1):

mount -F pcfs /dev/dsk/c3t0d0s2:1 /usb

I don't know if the ':1' and ':c' does a difference :-)

/Jan

 
 
 

Sun Solaris USB Flash Drive mount command (scsa2usb driver)

Post by Juergen Kei » Sat, 27 Sep 2003 18:58:51


unixasau...@yahoo.com (Eunice Santorini) writes:
> > For Solaris 8, you have to fake a change on the vold.conf
> > configuration file, otherwise the HUP signal is ignored:

> >         touch /etc/vold.conf
> > +       pkill -HUP vold

> I stopped vold & commented out the one /etc/vold.conf line:
> # use rmdisk drive /dev/rdsk/c*s2 dev_rmdisk.so rmdisk%d

OK, you must be running an early release of Solaris 8 (FCS?), which
had the "rmdisk" support disabled in /etc/vold.conf

It's correct, if you want vold to automatically mount an usb mass
storage device on a reboot (or a re-start of vold, or the above
mentioned touch / SIGHUP sequence), you have to make sure to remove
the comment character from the "use rmdisk" line in /etc/vold.conf.

> But, now when I try to determine the device the USB flash card is
> controlled by (controller#,target#,disk#,slice#,:table#) I get:

>    csh% devfsadm -v -i sd
>    csh% iostat -En | more
>         Which reports:
>          sd45  Soft Errors: 64 Hard Errors: 0 Transport Errors: 0
>                Vendor: UsbFlash Product: Drive Revision: 1.00 Serial No:
>                Size: 18446744073.71GB <-1 bytes>
>                Media Error: 0 Device Not Ready: 0 No Device: 0 Recoverable: 0
>                Illegal Request: 4 Predictive Failure Analysis: 0

>          sd46  Soft Errors: 0 Hard Errors: 0 Transport Errors: 0
>                Vendor: UsbFlash Product: Drive Revision: 1.00 Serial No:
>                Size: 0.00GB <0 bytes>
>                Media Error: 0 Device Not Ready: 0 No Device: 0 Recoverable: 0
>                Illegal Request: 0 Predictive Failure Analysis: 0

> Before I had device names looking more like "c4t0d0s2:c" but now for some
> reason I'm getting device names such as "sd46".

Hmm, it seems the scsa2usb or the sd driver fail to attach to the
usb device tree nodes.

You probably have plugged the usb device into different usb ports on
the system, otherwise there wouldn't be multiple entries for the same
device.  Did you experiment with other usb peripherals at the same
time on those usb ports?  Are there any kernel warning messages logged
to /var/adm/messages?  (e.g. "Disconnected device was busy, please
reconnect.")

> Any idea what the heck I am doing so drastically wrong?

Since you've obviously using an early release of Solaris 8: Do you have
any "USB Framework" patches installed?  The latest revison of the
"SunOS 5.8: USB and Audio Framework patch" is 109896-21.  It fixes lots
of USB problems.

> I just want to plug in a USB 1.1 stick and to access it on my Sun Solaris 8
> workstation as simply as possible.

I'm using the following script to automatically mount a hotplugged usb
mass storage device.  The script is executed by "syseventd", whenever
new hardware is added to the system at runtime.  It needs a new
sysevent.conf file, see the comment at the start of the script.

------------------------ /usr/local/etc/hotplug -----------------------
#!/bin/sh

#
# Handle usb hotplug sysevents for usb storage devices, telling vold about
# the new disk device, to get it automatically mounted.
#
# Needs the following line in a new /etc/sysevent/config/XXX,sysevent.conf
# file
# EC_devfs ESC_devfs_devi_add SUNW ddi - - - /usr/local/etc/hotplug $vendor $publisher $class $subclass ${di.path}
#

#exec >> /tmp/hotplug.log 2>&1
#echo
#date
#echo "hotplug sysevent: $*"

if [ "$1" = SUNW -a "$2" = ddi -a "$3" = EC_devfs ]
then
        if [ "$4" = ESC_devfs_devi_add ]
        then
                case "$5" in
                */storage@*/disk@*)
                        if pgrep -xU 0 vold
                        then
                                :
                        else
                                # vold not running
                                exit 0
                        fi

                        #
                        # USB storage device was hotplugged
                        # Is the new device already handled by vold?
                        #
                        /bin/sleep 2    # give devfsadmd_mod.so some time
                                        # to create the device links
                        set -- `/bin/ls -l /dev/rdsk/*p0 | /bin/grep "$5"`
                        if [ $? -eq 0 ]
                        then
                                device="$9"

                                #
                                # If the device can be opened, vold has not
                                # yet opened it in exclusive mode.  Tell
                                # vold to rescan for new rmdisk devices.
                                #

                                #prtvtoc $device
                                dd if="$device" of=/dev/null count=1
                                if [ $? -eq 0 ]
                                then
                                        echo "device $device not handled by vold?"
                                        # Due to a vold bug, the following
                                        # ejects mounted cdrom media
                                        /bin/touch /etc/vold.conf
                                        /bin/pkill -HUP -xU 0 vold

                                        #if /bin/pgrep -xU 0 vold
                                        #then
                                        #       /etc/init.d/volmgt stop
                                        #       /bin/sleep 2
                                        #       /etc/init.d/volmgt start
                                        #fi
                                fi
                        fi
                        ;;
                esac

        fi
fi
------------------------------------------------------------------------

 
 
 

Sun Solaris USB Flash Drive mount command (scsa2usb driver)

Post by Eunice Santori » Sun, 28 Sep 2003 01:25:54


Jan Birk <j...@hulen.biz> wrote in message <news:3F73CADF.5090406@hulen.biz>...
> I use this device for my keyring ramdisk (USB1):
> mount -F pcfs /dev/dsk/c3t0d0s2:1 /usb

The problem isn't the command, per se.
The problem is I can't figure out, for the life of me,
WHAT device to use (controller, target, disk, slice:fat).

To answer an earlier question, YES I did plug in various USB
devices to each of the two USB ports on the SunBlade1000:
 csh% uname -a
      REPORTS:
      SunOS eunice 5.8 Generic_108528-16 sun4u sparc SUNW,Sun-Blade-1000

I'm a pretty lousy admin (and worse, yet, I hate not knowing how to
do something which should be simple).

Posted below is the mess I've gotten myself into (it's worse than
when I started, it seems as now no USB devices are even noted).
****************************************************************************
How to install a USB flash stick on a Sun Solaris SunBlade UNIX workstation

work in progress ... unfinished ... this is a mess ...
****************************************************************************
============================================================================
Reference URLs:
 http://docs.sun.com/doc/816-1387?q=scsa2usb  (Sun USB Administration Guide)
 http://docs.sun.com/db/doc/816-1387/6m7qdms6i?a=view#chapter2-11
 http://www.netsys.com/cgi-bin/display_article.cgi?1245
 http://www.netsys.com/cgi-bin/man2html?scsa2usb
 http://cspry.co.uk/computing/SUN_Blade1000_admin/configuration.html
============================================================================
WORK IN PROGRESS!

This note is confusing because we are not yet successful in mounting
a USB device to the Sun Solaris 8 workstation named 'eunice'.
Various results are reported below. When we finally get it working, then
we can clean it up and remove extraneous steps.
============================================================================
x. DO NOT PLUG in your USB flash device until told to do so below!
============================================================================
x. Check if your Sun Solaris machine is USB capable:
    csh% prtconf -pv | grep 000c03
           Which reported:  class-code:  000c0310

   Note: If this reports a "class-code: 000c0300" line, you have the
         UHCI USB controller (typical for Solaris x86).

         If there's a "class-code: 000c0310" line, you have the OHCI USB
         controller; this controller is typically USB 1.1 at 12 mbit/sec
         (which allows, practically, about 1 mbyte per second).

         If it reports "class-code: 000c0320", you have the
         EHCI (USB v2) controller.
----------------------------------------------------------------------------
x. Display device aliases for all removable mass storage devices:
    csh# eject -n
          REPORTED:
           fd -> floppy0
           fd0 -> floppy0
           fd1 -> floppy1
           diskette -> floppy0
           diskette0 -> floppy0
           diskette1 -> floppy1
           rdiskette -> floppy0
           rdiskette0 -> floppy0
           rdiskette1 -> floppy1
           cd -> cdrom0
           cd0 -> cdrom0
           cd1 -> cdrom1
           sr -> cdrom0
           sr0 -> cdrom0
           /dev/sr0 -> cdrom0
           /dev/rsr0 -> cdrom0
   Note: Why did this not report:
          rmdisk0 -> /vol/dev/rdsk/c4t0d0/clik40    (Generic USB storage)
----------------------------------------------------------------------------
x. Check to see if you already have a USB flash drive attached by vold:
    csh% df -kl | grep rmdisk:c

         Might report an existing 128 Gbyte flash disk such as:
         Filesystem     /vol/dev/dsk/c4t0d0/unnamed_rmdisk:c
         kbytes         126912
         used           0
         avail          126912
         capacity       0%
         Mounted on     /rmdisk/unnamed_rmdisk

   This quicknote assumes there were no devices previously mounted by vold.
----------------------------------------------------------------------------
x. Check (and save) messages from the 'scsa2usb' driver (if any):
    csh% dmesg | grep scsa2usb
          Typically reports nothing if you've never attached a USB
          flash drive to this workstation.
----------------------------------------------------------------------------
x. Disable vold volume-daemon automation for your USB flash disk drive:
    csh% su root
    csh# /etc/init.d/volmgt stop
    csh# cp /etc/vold.conf /etc/vold.conf_`date +%y%m%d`
    csh# vi /etc/vold.conf
          Comment the line which has the entry "rmdisk" defined.
            ...
            # use rmscsi drive /dev/rdsk/c*s2 dev_rmscsi.so rmscsi%d
            ...
    csh# /etc/init.d/volmgt start
         You should see a message of: volume management starting.
    csh# exit

    Note: For Solaris 8, depending on when you perform these tasks, you
          may need to fake a change on the vold.conf configuration file,
          otherwise a subsequent HUP signal is ignored:
           csh# touch /etc/vold.conf
           csh# pkill -HUP vold
   Note: There may be a problem with vold and the use or non-use of fdisk
         partition tables on the media.  For example with the Olympus xx40
         series of digital cameras (these are seen by the OS as a USB storage
         device handled by the S8 scsa2usb driver), the FAT filesystem on the
         smart media card is inside an fdisk parition, but vold refuses to use
         the fdisk partition information.  vold only checks the whole
         '/dev/dsk/...p0' (x86) or '/dev/dsk/...s2' (sparc) device for a
         filesystem, does not detect any filesystem and offers to format the
         media.  You have to manually mount the FAT filesystem from the camera
         using the /dev/dsk/...p0:c (or /dev/dsk/...s2:c) syntax:
           mount -r -F pcfs /dev/dsk/c2d0s0p0:c /camera
----------------------------------------------------------------------------
-x. Begin determining the device your USB flash drive will be once attached:
    csh% prtconf -D > /tmp/device_tree_1
----------------------------------------------------------------------------
x. Plug the USB 1.1 flash stick into one of the USB ports on your machine:

   Note: In this case, we used an IBM 256 Gbyte flash key, plugged into
         a USB extension wire, into a Sun Solaris 8 SunBlade 1000,
---------------------------------------------------------------------------
x. Check which new USB device entries are added (if any) as a result:
   csh% prtconf -D > /tmp/device_tree_2
   csh% prtconf -D | grep usb
   csh% diff /tmp/device_tree_1 /tmp/device_tree_2

        If this is the first USB device to be plugged into this machine,
        you may see differences of the type shown below:
        ...  ...  ...  ...  ...  ...  ...  ...  ...  ...
        usb, instance #0 (driver name: ohci)
            keyboard, instance #2 (driver name: hid)
            mouse, instance #3 (driver name: hid)
            hub, instance #0 (driver name: hubd)
                storage, instance #0 (driver name: scsa2usb)
                    disk, instance #45 (driver name: sd)
                device
        ...  ...  ...  ...  ...  ...  ...  ...  ...  ...

   Notice the OHCI USB controller & the scsa2usb driver.

   Note: I'm not sure of the value of this step; please advise as I get
         vastly different circumstances depending on unknown circumstances.
----------------------------------------------------------------------------
x. Check for messages from the 'scsa2usb' driver:

    csh% dmesg | grep scsa2usb
         WHICH REPORTED:
          Sep 25 01:14:09 eunice scsi: [ID 193665 kern.info]
          sd45 at scsa2usb0: target 0 lun 0

          Sep 25 01:14:09 eunice genunix: [ID 408114 kern.info]
          /pci@8,700000/usb@5,3/hub@3/storage@1 (scsa2usb0) online

          Sep 25 09:09:21 eunice genunix: [ID 408114 kern.info]
          /pci@8,700000/usb@5,3/hub@3/storage@1 (scsa2usb0) offline

   Notice the "scsa2usb" driver; and notice the "usb@5,3" information.

   Note: If you plug and remove the device, you may get additional warnings:
          Sep 24 18:46:43 eunice genunix: [ID 408114 kern.info]
              /pci@8,700000/usb@5,3/hub@4/storage@1 (scsa2usb1) online

          Sep 24 18:46:43 eunice scsi: [ID 193665 kern.info]
              sd46 at scsa2usb1: target 0 lun 0

          Sep 24 18:46:52 eunice genunix: [ID 408114 kern.info]
              /pci@8,700000/usb@5,3/hub@4/storage@1 (scsa2usb1) offline

          Sep 24 18:46:58 eunice usba: [ID 464422 kern.warning]
              WARNING: /pci@8,700000/usb@5,3/hub@3/storage@1
              (scsa2usb0): reinserted device is accessible again

   Note: When I reboot, I don't get any of this above anymore. Sigh.
----------------------------------------------------------------------------
x. Determine the SCSI channel the USB device is using:
    csh% ls -alrt /dev/rdsk | grep "pci@8,700000/usb@5,3/hub@3/storage@1"
         Which reported, in my test, controller c4, target t0, disk d0,
         slices s0 thru s7 with sub-slice ":a" thru ":h"
         (of which slice "s2" sub-slice ":c" appears to be most significant):

          lrwxrwxrwx   1 root     root          65 Sep 23 15:24 c4t0d0s7 ->
          ../../devices/pci@8,700000/usb@5,3/hub@3/storage@1/disk@0,0:h,raw

          lrwxrwxrwx   1 root     root          65 Sep 23 15:24 c4t0d0s6 ->
          ../../devices/pci@8,700000/usb@5,3/hub@3/storage@1/disk@0,0:g,raw

          lrwxrwxrwx   1 root     root          65 Sep 23 15:24 c4t0d0s5 ->
          ../../devices/pci@8,700000/usb@5,3/hub@3/storage@1/disk@0,0:f,raw

          lrwxrwxrwx   1 root     root          65 Sep 23 15:24 c4t0d0s4 ->
          ../../devices/pci@8,700000/usb@5,3/hub@3/storage@1/disk@0,0:e,raw

          lrwxrwxrwx   1 root     root          65 Sep 23 15:24 c4t0d0s3 ->
          ../../devices/pci@8,700000/usb@5,3/hub@3/storage@1/disk@0,0:d,raw

          lrwxrwxrwx   1 root     root          65 Sep 23 15:24 c4t0d0s2 ->
...

read more »

 
 
 

Sun Solaris USB Flash Drive mount command (scsa2usb driver)

Post by Logan Sha » Sun, 28 Sep 2003 03:17:35



> I guess I've screwed it up so badly now but I think the major stumbling
> block is HOW DOES ONE DETERMINE WHICH DEVICE THE USB CARD IS PLUGGED INTO?

Look in /dev/dsk.  Do an "ls -l".

Everything in there will be a symbolic link to something; just what
it's a symbolic link to will depend on how it's attached.
Hopefully with all the other information you've already found, you'll
be able to determine which device(s) are USB-related and which aren't.

You may end up with a list of several devices that are all the same
except for slice numbers.  If so, you might have to just try them
all.

Alternatively, I don't know if this works with USB drives (since I've
never tried a USB drive on Solaris), but you could run "format"
and look at the list of disks it gives you.

Hope that helps.

   - Logan

 
 
 

Sun Solaris USB Flash Drive mount command (scsa2usb driver)

Post by Juergen Kei » Sun, 28 Sep 2003 03:44:12



> x. Determine the SCSI channel the USB device is using:

>          Which reported, in my test, controller c4, target t0, disk d0,
>          slices s0 thru s7 with sub-slice ":a" thru ":h"
>          (of which slice "s2" sub-slice ":c" appears to be most significant):

>           lrwxrwxrwx   1 root     root          65 Sep 23 15:24 c4t0d0s7 ->

>           lrwxrwxrwx   1 root     root          65 Sep 23 15:24 c4t0d0s6 ->

>           lrwxrwxrwx   1 root     root          65 Sep 23 15:24 c4t0d0s5 ->

>           lrwxrwxrwx   1 root     root          65 Sep 23 15:24 c4t0d0s4 ->

>           lrwxrwxrwx   1 root     root          65 Sep 23 15:24 c4t0d0s3 ->

>           lrwxrwxrwx   1 root     root          65 Sep 23 15:24 c4t0d0s2 ->

>           lrwxrwxrwx   1 root     root          65 Sep 23 15:24 c4t0d0s1 ->

>           lrwxrwxrwx   1 root     root          65 Sep 23 15:24 c4t0d0s0 ->

>    Q: Which DEVICE is the one to mount?
>         /dev/dsk/c4t0d0s7:h
>         /dev/dsk/c4t0d0s6:g
>         /dev/dsk/c4t0d0s5:f
>         /dev/dsk/c4t0d0s4:e
>         /dev/dsk/c4t0d0s3:d
>         /dev/dsk/c4t0d0s2:c
>         /dev/dsk/c4t0d0s1:b
>         /dev/dsk/c4t0d0s0:a
>    A: Presumably we mount c4t0d0s2:c or do we use c4t0d0s2:5 ???

It depends on the data stored on the device.

A standard SunOS disk label might exist on the device, with upto eight
different slices, and each slice might contain a different filesystem.
Similar to your HDD.

But these usb removable media devices often come from the
"DOS/Windows" world, so they don't contain SunOS disk labels.  When a
valid SunOS disk label is missing, the SunOS disk driver creates a
"fake" slice table.  It creates a slice table with slices "s0" and
"s2", and both can be used to access all of the data sectors contained
on the device.

Here's an example for an USB 256MB flash memory device.  The command
"prtvtoc" prints the SunOS slice table for the device:

# prtvtoc /dev/rdsk/c4t0d0s2
* /dev/rdsk/c4t0d0s2 partition map
*
* Dimensions:
*     512 bytes/sector
*      32 sectors/track
*      64 tracks/cylinder
*    2048 sectors/cylinder
*       0 cylinders
*     250 accessible cylinders
*
* Flags:
*   1: unmountable
*  10: read-only
*
*                          First     Sector    Last
* Partition  Tag  Flags    Sector     Count    Sector  Mount Directory
       0      0    00          0    512000    511999
       2      0    00          0    512000    511999

With this slice table, you can use the devices /dev/rdsk/c4t0d0s0
and /dev/rdsk/c4t0d0s2 to access the device.  All other slices on
that device (s1, s3, ..., s7) cannot be used.

Quote:> ---------------------------------------------------------------------
> x. Double-check the selected device to mount:

>    Q: What does this command actually tell us?
>    A: ???

>     csh% fdisk -W - /dev/rdsk/c4t0d0s2
>           Which reported: fdisk: Cannot open device /dev/rdsk/c4t0d0s2.
>     csh% fdisk -W - /dev/rdsk/c4t0d0s2:5
>           Which reported: fdisk: Cannot stat device /dev/rdsk/c4t0d0s2:c.
>     csh% fdisk -W - /dev/rdsk/c4t0d0s2:c
>           Which reported: fdisk: Cannot stat device /dev/rdsk/c4t0d0s2:c.

The fdisk command probably cannot open the disk device because you're
not logged in as user "root".

The output from the fdisk command gives a hint if the media contains
a "DOS" FDISK partition table.

Using my  usb 256MB flash memory device as an example:

# fdisk -W - /dev/rdsk/c4t0d0s2

* /dev/rdsk/c4t0d0s2 default fdisk table
* Dimensions:
*    512 bytes/sector
*     32 sectors/track
*     64 tracks/cylinder
*    250 cylinders
*
* systid:
...
*    6: DOSBIG

* Id    Act  Bhead  Bsect  Bcyl    Ehead  Esect  Ecyl    Rsect    Numsect
  6     128  1      1      0       16     32     1000    32       511967  

The important information is printed after the "* Id Act Bhead ...."
line.  This USB device contains one FDISK partition entry, the partition
is type 6 (Id 6 == DOSBIG),  the partition is marked "Active" (128),
it starts at sector 32 (Rsect) and contains 511967 (Numsect) sectors.

To mount the "BIGDOS" FAT filesystem from the FDISK partition starting
at sector 32, the mount command would be

    mount -F pcfs /dev/dsk/c4t0d0s2:c /mnt

If no data is printed following the "Id Act Bhead..." line, then
there's no valid DOS FDISK table on that media.  In that case you
cannot use the ":c" logical drive suffix with the mount pcfs command.
But the media could still contain a DOS FAT filesystem, starting at
sector #0 of the device.  To mount such a device, you would use the
command

    mount -F pcfs /dev/dsk/c4t0d0s2 /mnt

 
 
 

Sun Solaris USB Flash Drive mount command (scsa2usb driver)

Post by Eunice Santori » Sun, 28 Sep 2003 06:30:31



> I use this device for my Sun Solaris keyring ramdisk (USB1):
> mount -F pcfs /dev/dsk/c3t0d0s2:1 /usb
> I don't know if the ':1' and ':c' does a difference :-)

I do NOT have USB flash sticks mounted on Solaris yet, but, it seems
from what I've read if the USB media to be mounted contains a valid
FDISK partition table & the DOS filesystem is inside a separate FDISK
partition, then you need the additional colon-FAT designation after
   /dev/dsk/c#t#d#s#   (i.e., /dev/dsk/c#t#d#s#:{a-h}

I don't know much, but, in Sun Solaris 8, there is apparently a
problem with vold & the use or non-use of fdisk partition tables
on the removable media.

I'm told, for a USB flash card, the FAT filesystem on the device
handled by the Solaris 8 scsa2usb driver seems to be hidden inside
an fdisk partition ... but vold refuses to use that fdisk partition
information.  Reputedly vold only checks the whole
'/dev/dsk/...p0' (x86) or '/dev/dsk/...s2' (Sparc) device

Purportedly, for DOS USB devices, you have to manually mount the
colon-FAT filesystem inside the FDISK partition from the camera using:
 csh# mount '/dev/dsk/...p0:c' (x86) or '/dev/dsk/...s2:c' (Sparc) syntax:

 csh# mount -r -F pcfs /dev/dsk/c2d0s0p0:c /usb
 csh# mount -r -F pcfs /dev/dsk/c4t0d0s2:c /usb

The trick (for me) is determining exactly which of the following to
mount for the Sun Solaris 8 USB removable device in each USB port:
  /dev/dsk/c#t#d#s7:h
  /dev/dsk/c#t#d#s6:g
  /dev/dsk/c#t#d#s5:f
  /dev/dsk/c#t#d#s4:e
  /dev/dsk/c#t#d#s3:d
  /dev/dsk/c#t#d#s2:c
  /dev/dsk/c#t#d#s1:b
  /dev/dsk/c#t#d#s0:a

Q: Assuming I plugged into my Sun Solaris 8 SunBlade 1000 two USB
   flash cards; do you know how to tell EXACTLY which USB device
   (including the colon-letter FAT filesystem inside the fdisk partition)
   each flash card is plugged into?

   'cause if I knew that ... I could then manually mount the USB drive.

 
 
 

Sun Solaris USB Flash Drive mount command (scsa2usb driver)

Post by Logan Sha » Sun, 28 Sep 2003 06:48:02



> The trick (for me) is determining exactly which of the following to
> mount for the Sun Solaris 8 USB removable device in each USB port:
>   /dev/dsk/c#t#d#s7:h
>   /dev/dsk/c#t#d#s6:g
>   /dev/dsk/c#t#d#s5:f
>   /dev/dsk/c#t#d#s4:e
>   /dev/dsk/c#t#d#s3:d
>   /dev/dsk/c#t#d#s2:c
>   /dev/dsk/c#t#d#s1:b
>   /dev/dsk/c#t#d#s0:a

> Q: Assuming I plugged into my Sun Solaris 8 SunBlade 1000 two USB
>    flash cards; do you know how to tell EXACTLY which USB device
>    (including the colon-letter FAT filesystem inside the fdisk partition)
>    each flash card is plugged into?

Well, it's really unlikely to be :d through :h.

If you gave information about what's on the flash drive, it would
be possible to be more specific.  Does it have an FDISK partition
on it?  If so, then :a corresponds to the first FDISK partition,
:b to the second, etc.

Quote:>    'cause if I knew that ... I could then manually mount the USB drive.

You can determine the c#t#d# part of it by looking in /dev/dsk
and using the process of elimination.  Try typing "format" to get
a list of disks you already have.  You could also try "df -k".

Nobody can tell you which c# it is specifically, because these
are assigned dynamically by the system and will depend on the
particulars of what hardware you have, what order you installed
it, etc.  You'll have to figure that out for yourself.

But anyway, once you have gone through the process of elimination
and determined the /dev/dsk/c#t#d# part of the device name, the
remaining possibilities are few enough that you should be able to
try them all.  I'd start with s0:a through s0:c, then try
s2:a through s2:c.

I've set followups to comp.unix.solaris and comp.sys.sun.admin,
because I don't really think figuring out which /dev/dsk entry
corresponds to something is relevant for the other groups.

   - Logan

 
 
 

Sun Solaris USB Flash Drive mount command (scsa2usb driver)

Post by Eunice Santori » Sun, 28 Sep 2003 11:52:55


> >    Q: Which DEVICE is the one to mount?
> >        /dev/rdsk/?  vs /dev/dsk/?
> >        c4t0d0s0 ?   vs c4t0d0s1   vs c4t0d0s2    etc. ???
> >        c4t0d0s2:c   vs c4t0d0s2:1
> >        etc.
> When a valid SunOS disk label is missing, the SunOS disk driver creates
> a "fake" slice table. It creates a slice table with slices "s0" and
> "s2", and both can be used to access all of the data sectors contained
> on the device. ... stuff removed ...
>     mount -F pcfs /dev/dsk/c4t0d0s2 /mnt

With your expert advice, I was able to get one of two USB slots to work
on my Sun Solaris 8 SunBlade1000 assuming the following caveats! Thanks!
Here's a summary (as always) for others to benefit (we're not done yet).

a) I'm sorry I ever touched the vold.conf file in the first place.
   Nothing worked the same once I did. I put it all back the way it
   originally was and rebooted. The pertinent vold.conf line is currently:
    use rmdisk drive /dev/rdsk/c*s2 dev_rmdisk.so rmdisk%d

b) I plugged TWO USB flash cards into the two USB slots in the back of
   the SunBlade1000 (figuring that would give me twice as many chances
   at hitting just the right combination of dsk vs rdsk and controllers,
   targets, disks, slices (0 and 2 only), and FAT sections (either a thru
   h or 1 thru 5 apparently). Whew! That's a lot of variables.

d) Mea culpa on the two UNIX newbie mistakes I made in my prior tests.
    - I now run 'fdisk' as root only (nothing else will do)
    - I won't use 'dmesg' for yesterday's events (I'll use /var/adm/message).
   And, just in case, I removed the USB wire extension (Sun says never use
   them, but, hey, it's just a wire) in case that was causing one of the
   two USB devices to not be seen by UNIX commands suggested in this thread.

Other than that, I basically GUESSED (one by one) at the dsk vs rdsk
combination; combined with a huge variety of controller/target/disk/slice
combinations (thanks for letting me know only slice 0 and 2 were relevant
to DOS-formatted USB flash sticks); combined with FAT sub-slice partitions
of a thru h vs 1 thru 5 (thanks for providing an example which used the
DOS sub-slice of the number 1); etc.

The command which (finally) mounted the 128 Mbyte USB flash card was:
  csh# mkdir /usb_128
  csh# mount -F pcfs /dev/dsk/c5t0d0s2:1 /usb_128

Of course, I GUESSED at this by testing other dsk/rdsk & controller & DOS
sub-slice combinations until this worked; so, it wasn't at all a rational
process - but the proof of the mount was vividly shown in the log file
below (working backward from success to failure):
  csh% cd /usb_128
  csh% df -kl .    (or df -k /usb_128)
       BOTH OF WHICH REPORTED:
        Filesystem           kbytes  used  avail   capacity  Mounted on
        /dev/dsk/c5t0d0s2:1  126912  2544  124368  3%        /usb_128
And:
  csh# prtvtoc /dev/dsk/c5t0d0s2
       REPORTED:
         Partition (i.e., slice) 0 and 2 were the entire device
  csh% cd /usb_128
  csh% ls -alsF
        REPORTED: the DOS data placed there by the WinXP PC.
And:
   csh% su root
   csh# fdisk -W - /dev/rdsk/c5t0d0s2
        REPORTED (condensed to the essentials as you've explained them):
         * /dev/rdsk/c5t0d0s2 default fdisk table
         ...
         *    512 bytes/sector
         *     32 sectors/track
         *     64 tracks/cylinder
         *    124 cylinders
         ...
         * systid:
         ...
         *    6: DOSBIG
         ...
          * Id Act Bhead Bsect Bcyl Ehead Esect Ecyl Rsect Numsect
            6  0   1     16    0    15    32    499  47    253905

   QUESTION: Does it bother anyone that the ACTIVE number is ZERO?

And:
   csh# devfsadm -v -i sd
   csh# iostat -En | more
        REPORTED (incorrect size information):
          c5t0d0 ... blah ... blah ... blah ...
          Vendor: UsbFlash Product: Drive Revision: 1.00
                  Serial No:        Size: 0.00GB <0 bytes>
          ... and ...
          sd45 ... blah ... blah ... blah ...
          Vendor: UsbFlash Product: Drive Revision: 1.00
                  Serial No:  Size: 0.00GB <0 bytes>
   QUESTION: Is 'sd45' the other flash card (i.e., 256 Mbytes) I plugged in?
And:
   csh# od -xc /dev/rdsk/c5t0d0s0 | sed 20q
        REPORTED: 20 lines of data available at that 'rdsk' device.
   QUESTION: When (please) do I use 'rdsk' vs 'dsk' in this USB process?
And:
   csh% prtconf -D > /tmp/device_tree_1
        Plug in both USB devices (128 Mb & 256 Mb) sans extension cable.
   csh% prtconf -D > /tmp/device_tree_2
   csh% diff /tmp/device_tree_1 /tmp/device_tree_2
        REPORTED the proper scsa2usb drivers I believe:
         > hub, instance #1 (driver name: hubd)
         >     storage, instance #1 (driver name: scsa2usb)
         >         disk, instance #46 (driver name: sd)
         >     device
And:
  csh% dmesg | grep scsa2usb
       REPORTED (after I plugged in BOTH USB devices):
       Sep 26 17:10:10 flow usba: [ID 855233 kern.info]
           USB-device: storage@1, scsa2usb0 at bus address 5
       Sep 26 17:10:10 flow genunix: [ID 936769 kern.info]
           scsa2usb0 is /pci@8,700000/usb@5,3/hub@3/storage@1
       Sep 26 17:10:10 flow scsi: [ID 193665 kern.info]
           sd45 at scsa2usb0: target 0 lun 0
       Sep 26 17:10:10 flow genunix: [ID 408114 kern.info]
           /pci@8,700000/usb@5,3/hub@3/storage@1 (scsa2usb0) online
       Sep 26 17:10:24 flow genunix: [ID 408114 kern.info]
           /pci@8,700000/usb@5,3/hub@3/storage@1 (scsa2usb0) offline
       Sep 26 17:10:27 flow usba: [ID 855233 kern.info]
           USB-device: storage@1, scsa2usb1 at bus address 5
       Sep 26 17:10:27 flow genunix: [ID 936769 kern.info]
           scsa2usb1 is /pci@8,700000/usb@5,3/hub@4/storage@1
       Sep 26 17:10:27 flow genunix: [ID 408114 kern.info]
           /pci@8,700000/usb@5,3/hub@4/storage@1 (scsa2usb1) online
       Sep 26 17:10:27 flow scsi: [ID 193665 kern.info]
           sd46 at scsa2usb1: target 0 lun 0

QUESTION: The command below was suggested (based on the ouput from the
          previous command above; but I have no clue what this tells me)?

  csh% ls -alrt /dev/rdsk | grep "pci@8,700000/usb@5,3/hub@3/storage@1"
        WHICH REPORTED:
        ../../devices/pci@8,700000/usb@5,3/hub@3/storage@1/disk@0,0:h,raw
        ../../devices/pci@8,700000/usb@5,3/hub@3/storage@1/disk@0,0:g,raw
        ../../devices/pci@8,700000/usb@5,3/hub@3/storage@1/disk@0,0:f,raw
        ../../devices/pci@8,700000/usb@5,3/hub@3/storage@1/disk@0,0:e,raw
        ../../devices/pci@8,700000/usb@5,3/hub@3/storage@1/disk@0,0:d,raw
        ../../devices/pci@8,700000/usb@5,3/hub@3/storage@1/disk@0,0:c,raw
        ../../devices/pci@8,700000/usb@5,3/hub@3/storage@1/disk@0,0:b,raw
        ../../devices/pci@8,700000/usb@5,3/hub@3/storage@1/disk@0,0:a,raw

Note: I removed the "eject -n" command for the same reason; I don't see
      what it tells me with respect to USB debugging (do you)?

In summary, the high-priority QUESTIONS which remain are:
 Q: Where is the SECOND USB device? Is it at something called sd45?
    If it's sd45, how do I find the mount "/dev/?dsk/c?t?d?s?:?" argument?
    What is "sd45" if it's not the second USB flash card I plugged in?
 Q: Should vold.conf be modified or not (methinks it should be left alone)?

The low-priority questions which remain are:
 Q: What does "ls -alrt /dev/rdsk" tell us about debugging USB devices?
 Q: When (please) do I use 'rdsk' vs 'dsk' in the USB-debugging process?
 Q: Is it a problem that "fdisk -W - /dev/rdsk/c5t0d0s2 " ACTIVE = ZERO?
 Q: Is a USB extension cable really a bad idea?

Thanks for helping me (& everyone else who installs USB on Sun Solaris  8),
Eunice
--
Please note I never read email at this address as it is a spam trap (sorry).

 
 
 

Sun Solaris USB Flash Drive mount command (scsa2usb driver)

Post by remo » Sun, 28 Sep 2003 23:35:38


Quote:> In summary, the high-priority QUESTIONS which remain are:
>  Q: Where is the SECOND USB device? Is it at something called sd45?
>     If it's sd45, how do I find the mount "/dev/?dsk/c?t?d?s?:?" argument?
>     What is "sd45" if it's not the second USB flash card I plugged in?
>  Q: Should vold.conf be modified or not (methinks it should be left alone)?


 >       Sep 26 17:10:10 flow genunix: [ID 936769 kern.info]

                                            ^
                                            c5

 >       Sep 26 17:10:27 flow genunix: [ID 936769 kern.info]

                                            ^
                                            c5

The conroller is the same so whatever link(s) in /dev/rdsk/c5* that
points to


should be the second flash card.

I'm not sure though where the second card would be indicated in c?t?d?.
c? is controller, so either t? or d? should point to the disk. I'm not
sure how hub & storage map to t? and d?.

I usually look at the dates & times in /dev/rdsk & see which ones were
created/changed about the time that I started installing stuff or when I
ran devfsadm.

--Mike

 
 
 

Sun Solaris USB Flash Drive mount command (scsa2usb driver)

Post by Juergen Kei » Tue, 30 Sep 2003 19:44:00



>    csh% su root
>    csh# fdisk -W - /dev/rdsk/c5t0d0s2
>         REPORTED (condensed to the essentials as you've explained them):
>          ...
>           * Id Act Bhead Bsect Bcyl Ehead Esect Ecyl Rsect Numsect
>             6  0   1     16    0    15    32    499  47    253905

>    QUESTION: Does it bother anyone that the ACTIVE number is ZERO?

No. That just means the filesystem contained in this fdisk parition is
not bootable.
 
 
 

Sun Solaris USB Flash Drive mount command (scsa2usb driver)

Post by Juergen Kei » Wed, 01 Oct 2003 01:50:50



> QUESTION: The command below was suggested (based on the ouput from the
>           previous command above; but I have no clue what this tells me)?


>         WHICH REPORTED:









The idea behind this command it to find out the "logical"
/dev/rdsk/c?t?d?s? device that maps to the usb device's "physical
device path".

The important information here is the name of the symbolic link that
is listed immediatelly *before* the "->".

Example: I just plugged in an usb flash memory device, and
/var/adm/messages lists:


...     Generic Mass Storage Device










This tells me the usb flash device is on contoller #3, target #0, disk
#0.

 
 
 

1. How to mount USB flash memory to Sun Solaris 9 on Sun Blade 150?

Hi,

I have a JetFlash 128MB USB Flash Memory Pen. I can access (read /
write) on my Apple iBook (Mac OS X) and SuSE Linux 8.2 box. But I can't
have it mounted on my SB150 with Solaris 9.

% mount -F autofs /dev/dsk/c1t0d0s2 /flash

Nothing appears and sometime hangs when I do "ls /flash". c1t0d0s2 is
not listed when I do "df -kl".

When I do

% iostat -En

I get:

c1t0d0          Soft Errors: 5 Hard Errors: 4 Transport Errors: 19
Vendor: JetFlash Product: 128MB   E2207FD3 Revision: A37E Serial No:
Size: 0.00GB <0 bytes>
Media Error: 0 Device Not Ready: 0 No Device: 0 Recoverable: 0
Illegal Request: 5 Predictive Failure Analysis: 0

Is this the Flash Pen problem?

Could someone help me?

Thank you.
--
Adrian Hoe
m a i l b o x AT a d r i a n h o e . c o m

2. Linux Frequently Asked Questions with Answers (Part 1 of 6)

3. ??Question about sparc solaris commands to mount, read/write to usb memory jumpdrives/ USB memory stick

4. Refurbished Sun Clusters..

5. mount USB flash drive on Unix

6. Linux and AX25: how set parameters?

7. can hotplug mount USB flash drive automatically?

8. NIS - where is it?

9. Allow all users to mount to a usb flash drive

10. What USB flash drive can I use with SPARC Solaris?

11. Connect USB flash disk to sun ray appliance

12. problem mounting usb flash disk

13. Help mounting a USB Compact Flash Reader with 64MB card