The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Operating Systems > SCO
.
google unix.com




View Single Post in the UNIX and Linux Forums - Click on the Thread or Permalink to View Entire Thread -->
  #8 (permalink)  
Old 06-26-2009
kshji's Avatar
kshji kshji is offline
Registered User
  
 

Join Date: Jun 2009
Location: Finland
Posts: 236
Post

/sbin/sdiconfig -l
- grep usb_msto line
- output example
2:0,7,0: HBA usb_msto,1
- interesting value is first value = 2
id=2
- in this example device to mount is
mount /dev/dsk/c${id}b0t0d0pa /mnt

and example
fdisk /dev/rdsk/c${id}b0t0d0p0

ksh/bash function:

usb="/usb"

mountusb()
{
oifs="$IFS"
IFS=":"
read devid xx <<EOF
$(/sbin/sdiconfig -l | grep usb_msto )
EOF
IFS="$oifs"
[ "$devid" = "" ] && echo "no usb disk" >&2 && return 1
print "devid:$devid"
mkdir $usb 2>/dev/null
mount /dev/dsk/c${devid}b0t0d0pa $usb
stat=$?
[ "$stat" != 0 ] && echo "can't mnt" >&2 && return 1
df -v
return $stat
}