Wednesday, April 19, 2006

Mounting an external USB disk in Solaris

1) Plug in the USB drive.

2) Run
dmesg
. Make sure the system found the drive.
Apr 19 11:49:35 accelere12 usba: [ID 855233 kern.info] USB-device: storage@3, scsa2usb0 at bus address 2
Apr 19 11:49:35 accelere12 usba: [ID 593373 kern.info] Cypress Semiconductor USB2.0 Storage Device DEF106F1A17F
Apr 19 11:49:35 accelere12 genunix: [ID 936769 kern.info] scsa2usb0 is /pci@8,700000/usb@5,3/storage@3
Apr 19 11:49:35 accelere12 genunix: [ID 408114 kern.info] /pci@8,700000/usb@5,3/storage@3 (scsa2usb0) online
Apr 19 11:49:37 accelere12 scsi: [ID 193665 kern.info] sd30 at scsa2usb0: target 0 lun 0
Apr 19 11:49:37 accelere12 genunix: [ID 936769 kern.info] sd30 is /pci@8,700000/usb@5,3/storage@3/disk@0,0
Apr 19 11:49:37 accelere12 genunix: [ID 408114 kern.info] /pci@8,700000/usb@5,3/storage@3/disk@0,0 (sd30) online


The above is an example of the end of the dmesg output.

3) Run
iostat -En
for the correct name of the disk on your system. Below is sample output:

c0t6d0          Soft Errors: 1 Hard Errors: 0 Transport Errors: 0
Vendor: TOSHIBA Product: DVD-ROM SD-M1401 Revision: 1009 Serial No:
Size: 0.00GB <0>
Media Error: 0 Device Not Ready: 0 No Device: 0 Recoverable: 0
Illegal Request: 1 Predictive Failure Analysis: 0
c3t0d0 Soft Errors: 1 Hard Errors: 0 Transport Errors: 0
Vendor: SAMSUNG Product: MP0402H Revision: DEF1 Serial No:
Size: 0.00GB <0>
Media Error: 0 Device Not Ready: 0 No Device: 0 Recoverable: 0
Illegal Request: 1 Predictive Failure Analysis: 0
c1t0d0 Soft Errors: 0 Hard Errors: 0 Transport Errors: 0
Vendor: SEAGATE Product: ST336605FSUN36G Revision: 0438 Serial No: 0132P0FKEM
Size: 36.42GB <36418595328>
Media Error: 0 Device Not Ready: 0 No Device: 0 Recoverable: 0
Illegal Request: 0 Predictive Failure Analysis: 0
c1t1d0 Soft Errors: 0 Hard Errors: 0 Transport Errors: 0
Vendor: NETAPP Product: X225_ST336704FC Revision: NA40 Serial No:
Size: 36.70GB <36700028928>
Media Error: 0 Device Not Ready: 0 No Device: 0 Recoverable: 0
Illegal Request: 0 Predictive Failure Analysis: 0

The format for the output for each device is:

deviceName Error info
Vendor and Product Info
Media Error information

ls -l /dev/dsk
to see whether the devicename matches the address in dmesg (
/pci@8,700000/usb@5,3...
)
In the above example, I checked
mount -v
to see which of the devices were already mounted. The only one not mounted already was c3t0d0

4)
mkdir /usbdrive


5)
mount -F pcfs /dev/dsk/c3t0d0s2:c /usbdrive

Check that the partition is mounted with mount -v

cN: the N'th disk controller installed in the system

tN: the SCSI TARGET id. Also used for atapi, firewire and usb mass
storage device, but it's always 0. Use to identify a specific disk
device on the disk controller.

dN: the SCSI LUN id. For atapi devices this is 0 for master device,
1 for the slave device. For usb mass storge devices this field could
contain a value > 0 - for example usb flash card readers often
present the slots for the various flash card formats as multiple LUNs. For simple usb flash memory sticks, this should be
LUN 0.

sN: the slice N from the SunOS disk label. On a media without a
disk label, slice 2 can be used to access all of the medias contents. Solaris SPARC supports slices s0 - s7, Solaris x86
slices s0 - s15.


pN: on Solaris x86 only: p0 is the whole disk (similar to slice s2,
when there's no SunOS disk label), p1 - p4 are the four primary
fdisk partitions.


The ":c" suffix assumes the media contains the fat filesystem in
a separate fdisk partition, searches the fdisk partition table for
the first partition containing a fat filesystem, and mounts the
filesystem from that partition. On Solaris x86, instead of using
"p0:c" you could also use one of the p1 - p4 device; but the pN
fdisk slices don't exist on Solaris SPARC.

No comments:

Labels

Blog Archive

Contributors