Talk:Utthumb
From Sun Ray User Group Wiki
I tried to use this script on version Solaris 10 8/07 with Sunray SRSS 4.0 and had some trouble to access my usb device. I used the front usb of my SunRay 2FS client. After plugging my 2gb usb device in, the command "utdiskadm -l" returns the follwing output :
| Device | Partition | Mount Path |
|---|---|---|
| disk2 | disk2p0 | |
| disk2 | disk2p1 | /tmp/SUNWut/mnt/mischins/usbdisk_0 |
Utthumb displays following :
| Operation | Partition | Mount Point |
|---|---|---|
| Scan | For-New | Thumb-Drives |
| View-disk2 | disk2p0 | Stale:PLease-Scan-Again-To-View |
| Remove-disk2 | disk2p0 | Not-Mounted-Ready-To-Remove/Unplug |
| View-disk2 | disk2p1 | /tmp/SUNWut/mnt/mischins/usbdisk_0 |
| disk2 | disk2p1 | /tmp/SUNWut/mnt/mischins/usbdisk_0 |
After selecting the View-disk2 disk2p1 /tmp/SUNWut/mnt/mischins/usbdisk_0 field I get the error dialog "Your thumb drive (disk2) is stale. It appears to be physically in, but not mounted.Please scan again". But this does not help.
It seems to me, that utthumb.ksh has also to check, if the mountpoint is not empty. For this I edited the nawk command in the scan function(near line 50). The changes are marked bold :
scan() {
set -A thumb Scan For-New Thumb-Drives `$utdiskcmd -l | \
/usr/bin/nawk '$1 !~ /^Device/ && $1 !~ /^------/ && $3 ~ "tmp" \
{printf("View-%s %s %s Remove-%s %s %s ", $1, $2, ($3 == "" ? "Stale:Please-Scan-Again-To-View":$3), \
$1, $2, ($3 == "" ? "Not-Mounted-Ready-To-Remove/Unplug":$3))}'`
if [ "$debug" = "1" ]; then
echo "DBUG-scan(): thumb(Op-Device/Part/MountPt):${thumb[*]}"
fi
}
Since the default mount point for the usb device lies in /tmp/... , this change affects that only devices with an valid mount point are listed.

