Problem
How to use or enable a removable USB Pen Drive with SCO Unix?
Solution
USB pen hard drives are small devices most of which have a generic SCSI hard disk emulation.
In order to set-up a USB pen drive on your system, you should do the following:
1. Plug the USB Pen Device into the USB port.
2. Check in /var/adm/syslog, this should contain lines similar to the following:
Jun 16 10:09:09 unix: 3:0,7,0: HBA : (usb_msto,1) USB USB HBA
Jun 16 10:09:09 unix: 0,0,0: DISK: Generic Flash Disk 7.77If your device is not recognised then see the Troubleshooting section below.
Check by running:# sdiconfig -lFor example:3:0,7,0: HBA : (usb_msto,1) USB USB HBA
0,0,0: DISK : USB-DISKFREEDIK-LWFORMAT1.063. Then check in /dev/rdsk for new devices added at time shown in
the log. e.g.:-------- 1 root sys 7679,952 Oct 29 10:09 c3b0t0d0p0
crw------- 1 root sys 7679,953 Oct 29 10:09 c3b0t0d0p1
crw------- 1 root sys 7679,954 Oct 29 10:09 c3b0t0d0p2
crw------- 1 root sys 7679,955 Oct 29 10:09 c3b0t0d0p3
crw------- 1 root sys 7679,956 Oct 29 10:09 c3b0t0d0p4
crw------- 1 root sys 7679,768 Oct 29 10:09 c3b0t0d0s0
crw------- 1 root sys 7679,769 Oct 29 10:09 c3b0t0d0s1
crw------- 1 root sys 7679,770 Oct 29 10:09 c3b0t0d0s2
crw------- 1 root sys 7679,771 Oct 29 10:09 c3b0t0d0s3
crw------- 1 root sys 7679,772 Oct 29 10:09 c3b0t0d0s4
crw------- 1 root sys 7679,773 Oct 29 10:09 c3b0t0d0s5
crw------- 1 root sys 7679,774 Oct 29 10:09 c3b0t0d0s6
crw------- 1 root sys 7679,775 Oct 29 10:09 c3b0t0d0s7
crw------- 1 root sys 7679,776 Oct 29 10:09 c3b0t0d0s8
crw------- 1 root sys 7679,777 Oct 29 10:09 c3b0t0d0s9
crw------- 1 root sys 7679,778 Oct 29 10:09 c3b0t0d0sa
crw------- 1 root sys 7679,779 Oct 29 10:09 c3b0t0d0
crw------- 1 root sys 7679,780 Oct 29 10:09 c3b0t0d0sc
crw------- 1 root sys 7679,781 Oct 29 10:09 c3b0t0d0sd
crw------- 1 root sys 7679,782 Oct 29 10:09 c3b0t0d0se
crw------- 1 root sys 7679,783 Oct 29 10:09 c3b0t0d0sf- IF YOU WANT A NEW UNIX 'VXFS' FILESYSTEM INSTALLED ON YOUR STICK PEN FOLLOW THE STEPS 4 BELOW FOR YOUR OS, OTHERWISE IF THERE IS ALREADY A FILESYSTEM ON YOUR USB STICK PEN THEN:
If it's a previously created 'vxfs' filesystem then:
# mount /dev/dsk/c3b0d0d0s1 /mntIf it's a previously created 'dosfs' FAT16 filesystem then:
# mount -F dosfs /dev/dsk/c3b0t0d0p1 /mntNot sure?Run:# fstyp /dev/dsk/c3b0t0d0s1If a "vxfs" filesystem is there on "s1" then it will report back
"vxfs".# fstyp /dev/dsk/c3b0d0d0p1If a "dosfs" filesystem is there on "p1" then it will report back "dosfs".
Please note that FAT32 and NTFS filesystems are not supported.
You can create a DOS Partition using "fdisk" within SCO Unix or from a Windows PC run:
# FORMAT <DRIVE LETTER>: /FS:FATTo format the drive in FAT16 format.
TO CREATE A NEW FILESYSTEM:FOR SCO UNIXWARE 7.1.3 and 7.1.4 ONLY: ------------------------------------- 4. Now to actually enable the USB Device for SCO Unix, run the:
# diskaddcommand. The parameter passed is the name of the new device added to /dev/rdsk (not including the last 2 characters).
e.g. 'diskadd c3b0t0d0'See the troubleshooting section below if any problems are encountered.
The following are the steps should be taken during diskadd.
You can alter this to suit your environment.
- c3b0t0d04.a. This will bring you to fdisk. Total disk size indicated should be the expected disk size of the pen drive.
4.b. Create a Unix Partition on the pen drive, then select 'Exit'.
4.c. Now you will be at surface analysis of disk. Skip this.
4.d. When prompted to enter number of slices to create. pick 1
4.e. Enter the absolute Pathname (mount point). For instance:
/usbpen4.f. Select filesystem type (vxfs, ufs, s5, sfs) : such as vxfs.
4.g. Choose block size (1024, 2048, 4096, 8192) : In the example, 1024
4.h. Should /usbpen be auto mounted during reboot?Select "no". Note if the drive is NOT connected during
reboot this is not a problem if you have selected "yes".4.i. Choose the size in cylinders of each slice (range offered 1 - 124) : e.g., 124
4.j. When asked to Confirm your selections (chance to go back and correct mistakes) : select y
4.k. When prompted for inode allocation, you are shown how many have been automatically allocated and offered chance to change. You can keep the value presented.
UX:diskadd: INFO: Diskadd for Disk Drive 2 DONE at Mon Jun 16 12:12:24 2008
4.l. Now diskadd is Finished.PROCEED TO STEP 5.FOR OPENSERVER6 ONLY:
--------------------
4. Run "mkdev hd" as the example shows below:bash-3.2# mkdev hd Mass storage devices are recognized automatically when the system is booted with a new device present.
Current hard disk configuration:Alias - Address - Inquiry String
-------- -------- --------------
hba1 - c0b0t7 - (mpt,1) LSI Logic 1030 10329
disk1 - c0b0t0l0 - LSILOGIC1030 IM1000 - -
disk2 - c3b0t0l0 - USB-DISKFREEDIK-LWFORMAT1.06Please enter the alias of the disk you wish to initialize ( type quit to exit ):
Enter "disk2" and follow the prompts to Create a 100% Active Unix partition.
Then 4 to exit from "fdisk".You will then be prompted to select the number of filesystems needed on that particular filesystem.
You can then make manual adjustments within "divvy", as prompted, to name the partitions created, eg:
+-------------------+------------+--------+---+-------------+------------+
| Name | Type | New FS | # | First Block | Last Block |
+-------------------+------------+--------+---+-------------+------------+
| d00110 | vxfs | yes | 0 | 0| 55470|
| | NOT USED | no | 1 | -| -|
| | NOT USED | no | 2 | -| -|
| | NOT USED | no | 3 | -| -|
| | NOT USED | no | 4 | -| -|
| | NOT USED | no | 5 | -| -|
| | NOT USED | no | 6 | -| -|
| d00117all | WHOLE DISK | no | 7 | 0| 63471|
+-------------------+------------+--------+---+-------------+------------+
55471 1K blocks for divisions, 8001 1K blocks reserved for the systemEnter your choice or q to quit: n which division? (0 through 15)?0 what do you want to call it? usbpen
Enter your choice or q to quit: qi[nstall] Install the division set-up shown
r[eturn] Return to the previous menu
e[xit] Exit without installing a division tablePlease enter your choice: iNext, run "mkdev fs" and answer the prompts as:
Filesystem Initialization ProgramThis program performs maintenance tasks required to add or delete an existing filesystem. Would you like to:
1. Add a new filesystem to system. 2. Remove a filesystem.
Select an option or enter q to quit: 1
Enter a device name and press <Return> or q to quit: /dev/usbpen
Enter a directory name and press <Return> or q to quit: /usbpen Reserving slots in lost+found directory ...
When entering multiuser mode:
1. Always mount /dev/usbpen.
2. Never mount /dev/usbpen.
3. Prompt before mounting /dev/usbpen.Select an option: 2Do you want to allow users to mount this file system? (y/n) nUpdating system files ...Filesystem has been successfully added.Then run:# fstyp /dev/usbpen
vxfs# mount /dev/usbpen /usbpenSee the troubleshooting section below if any problems are encountered.
Proceed to Steps 5.5. Execute the 'df command. Note the new mounted drive at /usbpen:
# df
/ (/dev/root ): 6284388 blocks 405194 files
/stand (/dev/stand ): 90457 blocks 184 files
/proc (/ ): 0 blocks 9926 files
/dev/fd (/dev/fd ): 0 blocks 0 files
/dev/_tcp (/dev/_tcp ): 0 blocks 0 files
/usbpen (/dev/dsk/c3b0t0d0s1): 235984 blocks 31460 files6. The USB drive is now available to be accessed and written to.
# cd /usbpen
# l
total 0
drwxr-xr-x 2 root sys 96 Jun 16 10:28 lost+found7. Before disconnecting the USB Pen Drive you MUST unmount it, with the command:
# umount /usbpen8. To re-connect the Pen Drive, either plug it in and boot the machine, it will be mounted automatically.
or:Plug it in, and type the command, for example:
# mount /dev/dsk/c3b0t0d0s1 /usbpenThe device name used (/dev/dsk/c3b0t0d0s1) will vary depending upon the number of storage controllers connected to your system (SCSI Controllers etc...) and the options you select during 'diskadd'.
If you forget the device name, you can check in '/etc/vfstab'. Look for an entry similar to :
/dev/dsk/c3b0t0d0s1 /dev/rdsk/c3b0t0d0s1 /usbpen
vxfs 1 yes - SYS_RANGE_MAXIf you have trouble remounting the pen drive then see the troubleshooting section below.
NOTE: When disconnecting the USB drive, you MUST un-mount it first. If you
do not, the system may panic when you next try to access the USB Pen
Drive.# umount /usbpenAlso you may have corrupted the data on the drive, and you may have to go through the diskadd procedure again to get back into a working state.
This panic inducing behaviour has been reported to SCO Engineering, and will be fixed in a future update.
TROUBLESHOOTING:
---------------
- If your device generates the following errors on the console or in
/var/adm/syslog, similar to:Jun 16 11:24:12 uktest02 unix: 3:0,7,0: HBA : (usb_msto,1) USB USB HBA
Jun 16 11:24:12 uktest02 unix: 0,0,0: DISK : USB-DISKFREEDIK-LWFORMAT1.06
Jun 16 11:24:14 uktest02 unix: T.799735-usbd0 001D7 <Drvr16>: Device reset timeout during enumeration!
Jun 16 11:24:14 uktest02 unix:
Jun 16 11:24:14 uktest02 unix: WARNING:
Jun 16 11:24:14 uktest02 unix: ====== ERROR #1 <Status=OK> .799735-usbd0 001D7
<Drvr16>
Jun 16 11:24:14 uktest02 unix: Device reset timeout during enumeration!
Jun 16 11:25:28 uktest02 unix: 4:0,7,0: HBA : (usb_msto,2) USB USB HBA
Jun 16 11:25:28 uktest02 unix: 0,0,0: DISK : Generic STORAGE DEVICE 9404
Jun 16 11:27:43 uktest02 unix: usb_msto: Inquiry Read failed, Unbinding!
Jun 16 11:27:43 uktest02 unix: usb_msto: Please disconnect and re-attach the device to try again.
Jun 16 11:27:43 uktest02 unix: T.820613-usb_msto3 0200 1 <Drvr16>:
Initialization failure. Please reattach the device to retry.Check to see if the device has been detected with:
# sdiconfig -l- If you see the following, when trying to mount the device in DOS format:
bash-2.04# mount -F dosfs -r /dev/dsk/c3b0t0d0s1 /mnt UX:dosfs mount: ERROR: /dev/dsk/c3b0t0d0s1 no such device or device is write-protected UX:dosfs mount: ERROR: No such device UX:dosfs mount: ERROR: cannot mount /dev/dsk/c3b0t0d0s1
Then the device is not accessible by SCO Unix as a DOS device.
- When I run:# fdisk /dev/rdsk/c3b0t0d0s0I see, for example:Total disk size is 63 cylinders (63.0 MB) Cylinders Approx
Partition Status Type Start End Length % MB
========= ====== =========== ===== === ====== === ======
1 Active Other 0 62 63 100 63.8Then the device is not accessible by SCO Unix as a DOS device.
- "diskadd" is not seeing the partition of "c3b0td0" but "fdisk" is and I'm seeing ghost images on the server, for example:
bash-2.04# sdighost -lDevice Stamp Real Address Ghost Address
disk1 KFJfmlEmlFFF c0b0t0d0sXX
disk2 CDjMbYJkdFmN c0b0t1d0sXX
disk3 c6b0t0d0sXXRun "sdighost -r" to remove any ghost images and then reboot.
- When I try to mount the drive I get:
UX:vxfs mount: ERROR: Cannot access /dev/dsk/c3b0t0d0s1: No such file or directory
Running "sdiconfig -l" shows:3:0,7,0: HBA : (usb_msto,1) USB USB HBA
0,0,0: DISK : USB-DISKFREEDIK-LWFORMAT1.06and "sdighost -l" shows:Device Stamp Real Address Ghost Address
disk1 KFJfmlEmlFFF c0b0t0d0sXX
disk2 GKqDEkDhlIuh c4b0t0d0sXXUX:sdighost: INFO: Currently, no names are in use as Ghost Names
Yet, if I look at the files in /dev/dsk, I now see:
c4b0t0d0p0 c4b0t0d0p4 c4b0t0d0s3 c4b0t0d0s7 c4b0t0d0sb
c4b0t0d0sf c4b0t0d0p1 c4b0t0d0s0 c4b0t0d0s4 c4b0t0d0s8
c4b0t0d0sc c4b0t0d0p2 c4b0t0d0s1 c4b0t0d0s5 c4b0t0d0s9
c4b0t0d0sd c4b0t0d0p3 c4b0t0d0s2 c4b0t0d0s6 c4b0t0d0sa
c4b0t0d0seinstead of "c3".Try mounting "c4b0t0d0p1" as:bash-2.04# fstyp /dev/dsk/c4b0t0d0s1
vxfsbash-2.04# mount /dev/dsk/c4b0t0d0s1 /usbpenThese issues have been reported to SCO Engineering.
- I am able to mount my USB disk on my Windows PC and see the files written there but I can also mount the same USB stick pen using SCO Unix as a "vxfs" filesystem.
The PC the USB stick was originally connected to has retained a
copy of the stick pen's File Allocation Table. It would not be
advisable to write or read from the USB stick pen in this state.- For OpenServer6, if I pick the disk in "mkdev hd", I'm told the wrong disk is selected:
disk2 - c3b0t0l0 - USB-DISKFREEDIK-LWFORMAT1.06UX:fdisk: ERROR: cannot open /dev/rdsk/c3b0t0d0p0 UX:fdisk: TO FIX: Usage: fdisk [raw-device]
UX:fdisk: ERROR: Make sure that the disk is properly installed UX:sdimkosr5: ERROR: stat failed on /dev/rdsk/c3b0t0d0pa Cannot stat device "/dev/rdsk/c3b0t0d0pa"
Yet it's showing as c2 in /dev/dsk and "sdiconfig -l":
2:0,7,0: HBA : (usb_msto,1) USB USB HBA
0,0,0: DISK : USB-DISKFREEDIK-LWFORMAT1.06But "sdighost -l" shows:bash-3.2# sdighost -lDevice Stamp Real Address Ghost Address
disk1 KTwPuhCMKxEF c0b0t0d0sXX
disk2 c3b0t0d0sXXTry rebooting the server as the stick pen's enumeration has become invalidated due to it's insertion/removal/insertion.
- After a reboot, I am still seeing a confusion with "mkdev hd" as:
# mkdev hd
Mass storage devices are recognized automatically
when the system is booted with a new device present.Current hard disk configuration:Alias - Address - Inquiry String
-------- -------- --------------
hba1 - c0b0t7 - (mpt,1) LSI Logic 1030 10329
disk1 - c0b0t0l0 - LSILOGIC1030 IM1000 - -
disk2 - c3b0t0l0 - USB-DISKFREEDIK-LWFORMAT1.06hba4 - c2b0t7 - (usb_msto,1) USB USB HBA
disk3 - c2b0t0l0 - USB-DISKFREEDIK-LWFORMAT1.06Please enter the alias of the disk you wish to initialize ( type quit to exit ):
Only ONE USB Stick pen has been inserted. Which is the correct one?
# sdiconfig -l2:0,7,0: HBA : (usb_msto,1) USB USB HBA
0,0,0: DISK : USB-DISKFREEDIK-LWFORMAT1.06# sdighost -l# sdighost -lDevice Stamp Real Address Ghost Address
disk1 KTwPuhCMKxEF c0b0t0d0sXX
disk2 c3b0t0d0sXX
disk3 c2b0t0d0sXXUX:sdighost: INFO: Currently, no names are in use as Ghost Names
Try running:# sdighost -rThen rebooting otherwise you the correct disk where the device nodes are assigned, in this case "disk3" on "c2b0t0d0sXX".
- I still am unable to see or mount the device
It is possible that the USB device you have is incompatible with the USB port you are using.
A workaround would be to create a SAMBA share on the data you wish to share or transfer to/from your USB Media and access this via a different operating system, for example, Windows.
You can transfer the data with something as simple as a Batch file, e.g. 'backup.bat' on the USB Flash Drive itself which you can just double click.
xcopy /e /y \\SAMBA SERVER\SHARE\*.* .\dir_on_usb_driveMore complex solutions exist, such as 'rsync' or other GUI based solutions for Windows.
See also
TA125256, "How do I install a SCSI USB pen hard disk on OpenServer 5.0.7? "
disksetup(1M)