Skip Navigation Links | |
Exit Print View | |
Oracle Solaris 11.1 Administration: Devices and File Systems Oracle Solaris 11.1 Information Library |
1. Managing Removable Media (Tasks)
2. Writing CDs and DVDs (Tasks)
4. Dynamically Configuring Devices (Tasks)
5. Managing USB Devices (Tasks)
About USB Support in Oracle Solaris
USB Device Features and Compatibility Issues
USB Keyboards and Mouse Devices
Guidelines for Connecting USB Cables
Oracle Solaris USB Architecture
USB Devices and Driver Classes
Managing USB Mass Storage Devices
Hot-Plugging USB Mass Storage Devices
How to Add a USB Mass Storage Device
How to Remove a USB Mass Storage Device
Preparing to Use a USB Mass Storage Device
How to Display USB Device Information
How to Create a File System on a USB Mass Storage Device
How to Modify Partitions and Create a PCFS File System on a USB Mass Storage Device
How to Create a Solaris Partition and Modify the Slices on a USB Mass Storage Device
How to Mount or Unmount a USB Mass Storage Device
Troubleshooting Tips for USB Mass Storage Devices
Disabling Specific USB Drivers
Hot-Plugging Multiple USB Audio Devices
How to Identify Your System's Primary Audio Device
How to Change the Primary USB Audio Device
Troubleshooting USB Audio Device Problems
Key Points of Audio Device Ownership
Hot-Plugging USB Devices With the cfgadm Command
How to Display USB Bus Information (cfgadm)
How to Unconfigure a USB Device
How to Logically Disconnect a USB Device
How to Logically Connect a USB Device
How to Logically Disconnect a USB Device Subtree
How to Change the Default Configuration of a Multi-Configuration USB Device
6. Using InfiniBand Devices (Overview/Tasks)
9. Administering Disks (Tasks)
11. Configuring Storage Devices With COMSTAR (Tasks)
12. Configuring and Managing the Oracle Solaris Internet Storage Name Service (iSNS)
13. The format Utility (Reference)
14. Managing File Systems (Overview)
15. Creating and Mounting File Systems (Tasks)
16. Configuring Additional Swap Space (Tasks)
17. Copying Files and File Systems (Tasks)
The following tasks are described in this section:
How to Modify Partitions and Create a PCFS File System on a USB Mass Storage Device
How to Create a Solaris Partition and Modify the Slices on a USB Mass Storage Device
The following USB removable mass storage devices are supported:
CD-RWs
Hard disks
DVDs
Digital cameras
Diskette devices
SmartMedia and CompactFlash devices
In previous Oracle Solaris releases, all USB storage devices were identified as removable media devices, which provides many of the following advantages, including automatic mounting. In the Oracle Solaris 11 release, USB mass storage devices are identified as hot-pluggable devices but also enjoy the advantages of USB removable devices that are described in the following sections. For more information about the hot-pluggable behavior, see Hot-Plugging USB Mass Storage Devices.
Guidelines for managing USB mass storage device are as follows:
A hot-pluggable device is automatically mounted.
USB storage devices with standard MS-DOS or Windows (FAT) file systems are supported.
You can use the user-friendly rmformat command to create slices. You can also use the fdisk command to partition a USB device, but never use the format utility or the rmformat -F command to physically format a USB drive.
Use the rmformat command to display all USB devices with media inserted. For example, see How to Display USB Device Information.
Non-root users can now access USB storage devices, since the mount command is no longer needed. The device is automatically mounted and is available under the /media directory.
These devices can be managed with or without removable media services.
Disks with FAT file systems can be mounted and accessed. For example:
mount -F pcfs /dev/dsk/c2t0d0s0:c /mnt
All USB storage devices are now power managed, except for those that support LOG SENSE pages. Devices with LOG SENSE pages are usually SCSI drives connected through a USB-to-SCSI bridge device.
Applications might work differently with USB mass storage devices. Keep the following issues in mind when using applications with USB storage devices:
Applications might make incorrect assumptions about the size of the media since only smaller devices like diskettes were removable previously.
Requests by applications to eject media on devices where this would be inapplicable, such as a hard drive, will succeed and do nothing.
If you prefer the behavior in previous Oracle Solaris releases where all USB mass storage were treated as removable media devices, then you can force the old behavior by updating the /etc/driver/drv/scsa2usb.conf file.
For more information on using USB mass storage devices, see scsa2usb(7D).
USB diskette devices appear as removable media devices. USB diskette devices are not managed by the fd (floppy) driver. Applications that issue ioctl(2) calls intended for the fd (native floppy) driver will fail. Applications that issue only read(2) and write(2) calls will succeed. Other applications, such as SunPCI and rmformat, also succeed.
The USB diskette device is identified as a SCSI removable media device. The device is available for access under the /media directory.
For more information on how to use USB diskette devices, see Overview of USB Devices.
Hot-plugging a device means the device is added or removed without shutting down the operating system or powering off the system. All USB devices are hot-pluggable.
The hot-pluggable device attribute identifies those devices that can be connected or disconnected without rebooting the system and configured or unconfigured automatically without user intervention. All USB devices are identified as hot-pluggable devices to gain those benefits. In addition, non-removable media USB devices are no longer identified as removable-media devices and no longer have a removable-media attribute.
Non-removable USB storage devices are identified as hot-pluggable devices at the driver level. This behavior means that these devices can be connected or disconnected without rebooting the system and configured or unconfigured automatically without intervention. These changes are made at the kernel level and do not impact the use of these devices. For example, the responsibility of mounting and unmounting these devices is controlled by the removable media management services.
For more information about using these devices, see scsa2usb(7D).
The removable media manager is now aware of hot-plugged devices. You can just plug in the device, which is mounted in a few seconds. If nothing happens, check to see if it is mounted.
Make sure that removable media services are running.
# svcs hal dbus rmvolmgr STATE STIME FMRI online May_03 svc:/system/dbus:default online May_03 svc:/system/hal:default online May_03 svc:/system/filesystem/rmvolmgr:default
The file system can be mounted from the device if it is valid and it is recognized.
If the file system on the device is not automatically mounted, try a manual mount.
Before hot-removing the device, find the name of the device in the eject -l command's alias name. Then eject the device's media. If you don't do this, the device is released and the port is usable again, but the file system on the device might have been damaged.
When you hot-plug a USB device, the device is immediately seen in the system's device hierarchy, as displayed in the prtconf command output. When you remove a USB device, the device is removed from the system's device hierarchy, unless you are using the device.
If you are using a device when it is unplugged, the device node remains, but the driver controlling this device stops all activity on the device. Any new I/O activity issued to this device returns an error.
In this situation, the system prompts you to plug in the original device. If the device is no longer available, stop the applications. After a few seconds, the port becomes available again.
Note - Data integrity might be impaired if you remove an active or open device. Always close the device before removing, except the attached keyboard and mouse, which can be moved while active.
For example:
$ rmformat Looking for devices... 1. Logical Node: /dev/rdsk/c3t0d0p0 Physical Node: /pci@0,0/pci108e,534a@2,1/storage@3/disk@0,0 Connected Device: SanDisk Cruzer Micro 0.3 Device Type: Removable Bus: USB Size: 245.0 MB Label: <None> Access permissions: Medium is not write protected.
For example:
$ ls /media/NONAME aa bb
You can also use the rmmount -l command to list the paths and nicknames of mountable devices. If the device has been mounted under the /media directory, you will see output similar to the following:
$ rmmount -l /dev/dsk/c3t0d0p0:1 rmdisk0,NONAME,/media/NONAME
If the camera's media uses a PCFS file system, it will be automatically mounted. If the device does not bind to the scsa2usb driver, use libusb applications for transferring the pictures. For more information, refer to the /usr/share/doc/libusb/libusb.txt file.
The system creates a logical device for the camera. After the camera is plugged in, output is written to the /var/adm/messages file to acknowledge the device's connection. The system treats the camera as a storage device.
# more /var/adm/messages
Examining this output enables you to determine which logical device was created so that you can then use that device to access your images. The output looks similar to the following:
Jul 15 09:53:35 buffy usba: [ID 349649 kern.info] OLYMPUS, C-3040ZOOM, 000153719068 Jul 15 09:53:35 buffy genunix: [ID 936769 kern.info] scsa2usb1 is /pci@0,0/pci925,1234@7,2/storage@2 Jul 15 09:53:36 buffy scsi: [ID 193665 kern.info] sd3 at scsa2usb1: target 0 lun 0
Match the device with a mountable /dev/dsk link entry, by doing the following:
# ls -l /dev/dsk/c*0 | grep /pci@0,0/pci925,1234@7,2/storage@2 lrwxrwxrwx 1 root root 58 Jun 14 2010 c3t0d0p0 -> ../../devices/pci@0,0/pci925,1234@7,2/storage@2/disk@0,0:a
The camera's file system is most likely a PCFS file system. If file system is PCFS, then it should be automatically mounted.
# mount -F pcfs /dev/dsk/c3t0d0p0:c /mnt
# mount -F pcfs /dev/dsk/c3t0d0s0:c /mnt
For information on mounting file systems, see Mounting and Unmounting Oracle Solaris File Systems.
For information on mounting different PCFS file systems, see mount_pcfs(1M).
For example:
# ls /mnt/DCIM/100OLYMP/ P7220001.JPG* P7220003.JPG* P7220005.JPG* P7220002.JPG* P7220004.JPG* P7220006.JPG*
For example:
# /usr/dt/bin/sdtimage P7220001.JPG &
For example:
# umount /mnt
$ rmumount NONAME
Or, use the umount command as an administrator. For example:
# umount /media/NONAME
For more information about unmounting a USB device, see How to Mount or Unmount a USB Mass Storage Device.
You can access information on removable media with or without using removable media services. For information on accessing information on removable media with GNOME's File Manager, see the GNOME desktop documentation.
After the USB device is formatted, it is usually mounted under the /media/label directory.
The device nodes are created under the /dev/rdsk directory for character devices and under the /dev/dsk directory for block devices. Device links are created when the devices are hot-plugged. For more information, see scsa2usb(7D).
If the device cannot be identified by removable media services, then try to manually mount the device. First, use the rmformat command to identify the device path and then use the mount command to manually mount the device as an administrator.
If a device is mounted by removable media services then you can unmount it by using the rmumount command. If the device is manually mounted, then you would unmount it using the umount command as an administrator.
For more information about mounting and unmounting USB devices, see How to Mount or Unmount a USB Mass Storage Device.
The prtconf output in this example has been truncated to only display USB device information.
$ prtconf usb, instance #0 hub, instance #2 device, instance #8 interface (driver not attached) printer (driver not attached) mouse, instance #14 device, instance #9 keyboard, instance #15 mouse, instance #16 storage, instance #7 disk (driver not attached) communications, instance #10 modem (driver not attached) data (driver not attached) storage, instance #0 disk (driver not attached) storage, instance #1 disk (driver not attached)
Use the rmformat command to display USB storage device information:
$ rmformat Looking for devices... 1. Logical Node: /dev/rdsk/c3t0d0p0 Physical Node: /pci@0,0/pci108e,534a@2,1/storage@3/disk@0,0 Connected Device: SanDisk Cruzer Micro 0.3 Device Type: Removable Bus: USB Size: 245.0 MB Label: <None> Access permissions: Medium is not write protected.
A USB diskette must be formatted before you can add a file system to it. All other USB mass storage devices just need a file system before they can be used.
Keep the following key points in mind when formatting a USB device:
Do not use the rmformat -F except on a USB diskette.
If the default slices are not acceptable, use the rmformat -s command to create slices. Use the fdisk utility to partition a USB device, if needed. For step-by-step instructions, see:
How to Modify Partitions and Create a PCFS File System on a USB Mass Storage Device
How to Create a Solaris Partition and Modify the Slices on a USB Mass Storage Device
If the USB device is automatically mounted, you will have to unmount it before you can create a file system on the USB device. Use the rmmount -l command to identify the device nickname and then the rmumount command to unmount the USB device.
Note - Perform Steps 4-5 only if you need to format a USB diskette.
# rmformat Looking for devices... 1. Logical Node: /dev/rdsk/c2t0d0p0 Physical Node: /pci@0,0/pci108e,534a@2,1/hub@7/floppy@1/disk@0,0 Connected Device: MITSUMI USB FDD 1039 Device Type: Floppy drive Bus: USB Size: 1.4 MB Label: <None> Access permissions: Medium is not write protected.
In this example, the diskette device is c2t0d0p0.
# rmformat -F long raw-device
For more information about unmounting a USB device, see How to Mount or Unmount a USB Mass Storage Device.
Create a ZFS pool and file system on a USB stick if you need to transfer data to another system.
# zpool create c5t0d0 temp-pool # zfs create temp-pool/data
Create a PCFS file system.
# mkfs -F pcfs -o nofdisk,size=size raw-device
Specify the -size option in 512-byte blocks.
The following example shows how to create a PCFS file system on a 1.4-MB diskette on a SPARC system:
# mkfs -F pcfs /dev/rdsk/c2t0d0p0 Construct a new FAT file system on /dev/rdsk/c2t0d0p0: (y/n)? y
The following example shows how to create a PCFS file system on a 1.4-MB diskette on an x86 system:
# mkfs -F pcfs /dev/rdsk/c2t0d0s2 Construct a new FAT file system on /dev/rdsk/c2t0d0s2: (y/n)? y
The following example shows how to create a PCFS file system on a 100-MB USB memory stick on a SPARC system:
# mkfs -F pcfs /dev/rdsk/c5t0d0s2:c
The following example shows how to create a PCFS file system on a 100-MB USB memory stick on an x86 system:
# mkfs -F pcfs /dev/rdsk/c5t0d0p0:c
This command can take several minutes to complete.
Create a legacy UFS file system.
# newfs raw-device
Consider using the newfs -f 4096 option or newfs -T option for large USB hard disks.
Note - UFS file system overhead consumes a significant portion of space on a diskette, due to a diskette's limited storage capacity.
See How to Modify Partitions and Create a PCFS File System on a USB Mass Storage Device and How to Create a Solaris Partition and Modify the Slices on a USB Mass Storage Device for detailed examples of creating a PCFS file system and modifying slices on a USB mass storage device.
The following steps describe how to delete an existing partition, create a new partition, and then create a PCFS file system on the USB device. Make sure you backup any data before you perform this task. Note that this procedure includes specific examples to serve as a guideline only. Information that you provide should apply to your particular system.
# fdisk /dev/rdsk/c3t0d0p0
Total disk size is 29 cylinders Cylinder size is 2048 (512 byte) blocks Cylinders Partition Status Type Start End Length % ========= ====== ============ ===== === ====== === 1 Active Solaris2 1 28 28 97 SELECT ONE OF THE FOLLOWING: 1. Create a partition 2. Specify the active partition 3. Delete a partition 4. Change between Solaris and Solaris2 Partition IDs 5. Exit (update disk configuration and exit) 6. Cancel (exit without updating disk configuration) Enter Selection: 3
Total disk size is 29 cylinders Cylinder size is 2048 (512 byte) blocks Cylinders Partition Status Type Start End Length % ========= ====== ============ ===== === ====== === 1 Active Solaris2 1 28 28 97 SELECT ONE OF THE FOLLOWING: 1. Create a partition 2. Specify the active partition 3. Delete a partition 4. Change between Solaris and Solaris2 Partition IDs 5. Exit (update disk configuration and exit) 6. Cancel (exit without updating disk configuration) Specify the partition number to delete (or enter 0 to exit): 1 Partition deleted.
Total disk size is 29 cylinders Cylinder size is 2048 (512 byte) blocks Cylinders Partition Status Type Start End Length % ========= ====== ============ ===== === ====== === WARNING: no partitions are defined! SELECT ONE OF THE FOLLOWING: 1. Create a partition 2. Specify the active partition 3. Delete a partition 4. Change between Solaris and Solaris2 Partition IDs 5. Exit (update disk configuration and exit) 6. Cancel (exit without updating disk configuration) Enter Selection: 1
Total disk size is 29 cylinders Cylinder size is 2048 (512 byte) blocks Cylinders Partition Status Type Start End Length % ========= ====== ============ ===== === ====== === WARNING: no partitions are defined! SELECT ONE OF THE FOLLOWING: 1. Create a partition 2. Specify the active partition 3. Delete a partition 4. Change between Solaris and Solaris2 Partition IDs 5. Exit (update disk configuration and exit) 6. Cancel (exit without updating disk configuration) Select the partition type to create: 1=SOLARIS2 2=UNIX 3=PCIXOS 4=Other 5=DOS12 6=DOS16 7=DOSEXT 8=DOSBIG 9=DOS16LBA A=x86 Boot B=Diagnostic C=FAT32 D=FAT32LBA E=DOSEXTLBA F=EFI 0=Exit? c
Total disk size is 29 cylinders Cylinder size is 2048 (512 byte) blocks Cylinders Partition Status Type Start End Length % ========= ====== ============ ===== === ====== === WARNING: no partitions are defined! SELECT ONE OF THE FOLLOWING: 1. Create a partition 2. Specify the active partition 3. Delete a partition 4. Change between Solaris and Solaris2 Partition IDs 5. Exit (update disk configuration and exit) 6. Cancel (exit without updating disk configuration) Select the partition type to create: Specify the percentage of disk to use for this partition (or type "c" to specify the size in cylinders). 100
Total disk size is 29 cylinders Cylinder size is 2048 (512 byte) blocks Cylinders Partition Status Type Start End Length % ========= ====== ============ ===== === ====== === WARNING: no partitions are defined! SELECT ONE OF THE FOLLOWING: 1. Create a partition 2. Specify the active partition 3. Delete a partition 4. Change between Solaris and Solaris2 Partition IDs 5. Exit (update disk configuration and exit) 6. Cancel (exit without updating disk configuration) Select the partition type to create: Should this become the active partition? If yes, it will be activated each time the computer is reset or turned on. Please type "y" or "n". n
Total disk size is 29 cylinders Cylinder size is 2048 (512 byte) blocks Cylinders Partition Status Type Start End Length % ========= ====== ============ ===== === ====== === 1 Win95 FAT32 1 28 28 97 SELECT ONE OF THE FOLLOWING: 1. Create a partition 2. Specify the active partition 3. Delete a partition 4. Change between Solaris and Solaris2 Partition IDs 5. Exit (update disk configuration and exit) 6. Cancel (exit without updating disk configuration) Enter Selection: 5
Make sure the device is unmounted before creating the new file system. For more information about unmounting a USB device, see How to Mount or Unmount a USB Mass Storage Device.
# mkfs -F pcfs -o fat=32 /dev/rdsk/c3t0d0p0:c Construct a new FAT file system on /dev/rdsk/c3t0d0p0:c: (y/n)? y
The following steps illustrate how to create a Solaris partition and modify the slices. Note that this procedure includes specific examples to serve as a guideline only. Information that you provide should apply to your particular system.
Make sure you back up any data before you perform this task.
# fdisk /dev/rdsk/c5t0d0s2 No fdisk table exists. The default partition for the disk is: a 100% "SOLARIS System" partition Type "y" to accept the default partition, otherwise type "n" to edit the partition table. y
For example:
# prtvtoc /dev/rdsk/c5t0d0s2 * /dev/rdsk/c5t0d0s2 partition map * * Dimensions: * 512 bytes/sector * 63 sectors/track * 255 tracks/cylinder * 16065 sectors/cylinder * 5836 cylinders * 5836 accessible cylinders * * Flags: * 1: unmountable * 10: read-only * * First Sector Last * Partition Tag Flags Sector Count Sector Mount Directory 0 0 00 0 93755340 93755339 2 0 00 0 93755340 93755339
For example:
slices: 0 = 0, 5GB, "wm", "home" : 1 = 8225280000, 6GB : 2 = 0, 44GB, "wm", "backup" : 6 = 16450560000, 15GB
Make sure each slice starts on a cylinder boundary. For example, slice 1 starts at 822280000 bytes, which is the cylinder size in bytes multiplied by 1000.
For more information, see the -s option description in rmformat(1).
For example:
# rmformat -s slice_file /dev/rdsk/c5t0d0s2
For example:
# prtvtoc /dev/rdsk/c5t0d0s2 * /dev/rdsk/c5t0d0s2 partition map * * Dimensions: * 512 bytes/sector * 63 sectors/track * 255 tracks/cylinder * 16065 sectors/cylinder * 5836 cylinders * 5836 accessible cylinders * * Flags: * 1: unmountable * 10: read-only * * Unallocated space: * First Sector Last * Sector Count Sector * 10485760 5579240 16064999 * 28647912 3482088 32129999 * 63587280 30168060 93755339 * * First Sector Last * Partition Tag Flags Sector Count Sector Mount Directory 0 8 00 0 10485760 10485759 1 3 01 16065000 12582912 28647911 2 5 00 0 92274688 92274687 6 4 00 32130000 31457280 63587279
The following steps illustrate how to mount and unmount a USB mass storage device.
For example:
$ rmformat Looking for devices... 1. Logical Node: /dev/rdsk/c3t0d0p0 Physical Node: /pci@0,0/pci108e,534a@2,1/storage@3/disk@0,0 Connected Device: SanDisk Cruzer Micro 0.3 Device Type: Removable Bus: USB Size: 245.0 MB Label: <None> Access permissions: Medium is not write protected.
In this example, the physical diskette device is c2t0d0p0.
Mount a USB mass storage device as a console user.
You can use the rmmount command with device nicknames, mount points, or device paths, similar to the following:
$ rmmount rmdisk0 $ rmmount NONAME $ rmmount /dev/dsk/c3t0d0p0:1
For example:
$ rmmount NONAME NONAME /dev/dsk/c2t0d0p0 mounted $ ls /media/NONAME AA.TXT
Unmount a USB mass storage device as a console user.
For example:
$ rmumount NONAME NONAME /dev/dsk/c2t0d0p0 unmounted
Mount a USB mass storage device as superuser.
This example shows how to mount a device with a UFS file system:
$ mount /dev/dsk/c1t0d0s2 /mnt
This example shows how to mount a device with a PCFS file system on a SPARC system:
$ mount -F pcfs /dev/dsk/c3t0d0s2:c /mnt
This example shows how to mount a device with a PCFS file system on an x86 system:
$ mount -F pcfs /dev/dsk/c3t0d0p0:c /mnt
This example shows how to mount a CD with a read-only HSFS file system:
$ mount -F hsfs -o ro /dev/dsk/c1t0d0s2 /mnt
Unmount a USB mass storage device as superuser.
First, be sure no one is using the file system on the device.
For example:
$ fuser -c -u /mnt $ umount /mnt
For example:
$ eject /dev/rdsk/c1t0d0s2
Keep the following tips in mind if you have problems adding or removing a USB mass storage device.
Check the /var/adm/messages file for failures to enumerate the device. For enumeration failures, possibly, insert the USB hub or remove a hub and connect it directly to a root USB hub.
If you have problems accessing a device that was connected while the system is running, try the following command:
# devfsadm
Do not move devices around if the system has been powered down by a suspend operation. For more information, see SPARC: USB Power Management.
If a device has been hot removed while in use by applications and is no longer available, then stop the applications. Use the prtconf command to see whether the device node has been removed.
You can disable specific types of USB devices by disabling their client driver. For example, USB printers can be disabled by disabling the usbprn driver that directs them. Disabling usbprn does not affect other kinds of devices, such as USB storage devices.
The following table identifies some USB device types and their corresponding drivers.
|
If you disable a driver for a USB device that is still connected to the system, you see a console message similar to the following:
usba10: WARNING: usba: no driver found for device name
For example, include the following exclude statement to exclude the usbprn driver:
exclude: usbprn
# init 6
Use this procedure if a USB device is removed while the system is powered off. Removing the USB device while the system is powered off can leave device links for devices that do not exist.