15.5. Accessing USB Mass Storage Devices

15.5.1. Device Nodes and Links (Oracle Solaris)
15.5.2. Device Nodes and Links (Oracle Linux)
15.5.3. Mount Points
15.5.4. Device Ownership and Hotdesking
15.5.5. Mass Storage Devices and Idle Sessions
15.5.6. Commands for Common Disk Operation (Oracle Solaris)
15.5.7. Commands for Common Disk Operation (Oracle Linux)
15.5.8. How to Unmount a Mass Storage Device From a Client
15.5.9. Troubleshooting Mass Storage Devices

This section provides information about how to manage USB mass storage devices connected to a Sun Ray Client.

15.5.1. Device Nodes and Links (Oracle Solaris)

Mass storage devices have two types of device nodes, block and raw, which are created in the client's dev directory. A link to the block device is created in the client's dev/dsk directory and a link to the raw device is created in the dev/rdsk directory.

Device links have a suffix denoting their slice number. Slice s2 is known as the backup slice, signifying the complete disk. Other slices are numbered accordingly on the file system on the disk. For UFS disks, slice numbers are derived from the disk label. For FAT disks, slices (partitions in this case) are numbered starting from s0. Disk operations such as format or eject should be directed at slice s2. Partition operations such as mount or fstyp should be directed at the individual slice concerned. See Section 15.5.5, “Mass Storage Devices and Idle Sessions” for examples.

15.5.2. Device Nodes and Links (Oracle Linux)

Mass storage device nodes are block special nodes. They are created in the dev/dsk directory. Note that for mass storage devices, device nodes are not created in the devices directory and no device links are created.

Device nodes are named with a partition identifier suffix. The device node representing the whole disk does not have such a suffix. For example:

  • disk3p2 represents partition 2 of disk3.

  • disk3 represents the whole disk.

Disk operations such as eject should be directed at the whole disk. Partition operations such as mount should be directed at individual partitions. See Table 15.2, “Commands for Common Disk Operation (Oracle Linux)” for examples.

15.5.3. Mount Points

When a mass storage device is plugged into the client, if it has an OS-recognizable file system, it is automatically mounted on a directory under the user's mount parent directory. The mount parent directory is located in $DTDEVROOT/mnt/. The user can also locate mount points by using the -l option of the utdiskadm command.

% utdiskadm -l

15.5.4. Device Ownership and Hotdesking

When the user's session disconnects from the client, the user loses access rights to the mass storage device, and all pending I/O to the device halts. This situation can cause the data on the device to be corrupted. Users should use utdiskadm -r to unmount all file systems safely before hotdesking or unplugging the disk from the client. They should also close all references to files and directories in the mount point to ensure that the device in question is not busy.

15.5.5. Mass Storage Devices and Idle Sessions

If you are using Remote Hotdesk Authentication (RHA), Non-Smart Card Mobility (NSCM), or smart card-based authentication, long I/O operations might fail when using mass storage devices on Sun Ray Clients.

If these types of sessions become idle due to keyboard and mouse inactivity long enough to activate the screen lock, the session is detached. The user loses access to the storage device, causing any I/O in progress to halt, and data may become corrupted.

To avoid this situation, the following options are available:

  • Maintain keyboard or mouse activity

  • Increase the screen lock idle time sufficiently to allow I/O operations to complete

  • Disable the screen lock program

  • Disable the NSCM or RHA policies

  • Find an alternative way to perform the I/O operation more securely, for example, plug the device directly into the Sun Ray server in a locked server room

Note

Some of these options have security and convenience implications that should be carefully weighed against the timeout issue to determine what is best for your site.

15.5.6. Commands for Common Disk Operation (Oracle Solaris)

Table 15.1, “Commands for Common Disk Operation (Oracle Solaris)” is a summary of common disk operations and the commands used to perform them. Refer to the Oracle Solaris documentation and man pages for more information on the individual commands.

Table 15.1. Commands for Common Disk Operation (Oracle Solaris)

Operation

Command

Device Name Argument Examples (SPARC)

Device Name Argument Examples (x86)

Format

rmformat

Path of whole disk $UTDEVROOT/dev/rdsk/disk3s2

Path of whole disk $UTDEVROOT/dev/rdsk/disk3p0

Create file system

mkfs

Path of partition $UTDEVROOT/dev/rdsk/disk3s0

Path of partition $UTDEVROOT/dev/rdsk/disk3p1

Create UFS file system

newfs

Path of slice $UTDEVROOT/dev/rdsk/disk3s0

Path of slice $UTDEVROOT/dev/rdsk/disk3s0

Mount

utdiskadm -m

Partition name disk3s0

Partition name disk3p1

Unmount

utdiskadm -u

Mount point $DTDEVROOT/mnt/label1

Mount point $DTDEVROOT/mnt/label1

Prepare to unplug

utdiskadm -r

Device alias disk3

Device alias disk3

Eject media

utdiskadm -e

Device alias disk3

Device alias disk3

Check for media

utdiskadm -c

Device alias disk3

Device alias disk3

Create fdisk table

fdisk

Path of whole disk $UTDEVROOT/dev/rdsk/disk3s2

Path of whole disk $UTDEVROOT/dev/rdsk/disk3p0

Repair file system

fsck

Path of raw slice $UTDEVROOT/dev/rdsk/disk3s0

Path of raw partition $UTDEVROOT/dev/rdsk/disk3p1

Display file system capacity

df -k

Mount point $DTDEVROOT/mnt/label1

Mount point $DTDEVROOT/mnt/label1

Display slice capacity

prtvtoc

Path of backup slice $UTDEVROOT/dev/rdsk/disk3s2

Path of backup slice $UTDEVROOT/dev/rdsk/disk3s2

List devices

utdiskadm -l

None

None


15.5.7. Commands for Common Disk Operation (Oracle Linux)

Table 15.2, “Commands for Common Disk Operation (Oracle Linux)” is a summary of common disk operations and the commands used to perform them.

Table 15.2. Commands for Common Disk Operation (Oracle Linux)

Operation

Command

Device Name Argument Examples

Create file system

mkfs

Path of partition $UTDEVROOT/dev/dsk/disk3p1

Mount

utdiskadm -m

Partition name disk3p1

Unmount

utdiskadm -u

Mount point $DTDEVROOT/mnt/label1

Prepare to unplug

utdiskadm -r

Device alias disk3

Eject media

utdiskadm -e

Device alias disk3

Check for media

utdiskadm -c

Device alias disk3

Create fdisk table

fdisk

Path of whole disk $UTDEVROOT/dev/dsk/disk3

Repair file system

fsck

Path of partition $UTDEVROOT/dev/dsk/disk3p1

Display file system capacity

df -k

Mount point $DTDEVROOT/mnt/label1

List devices

utdiskadm -l

None


15.5.8. How to Unmount a Mass Storage Device From a Client

Note

Oracle Linux does not immediately write data to disks. Failure to run utdiskadm -r before unplugging mass storage devices will cause loss of data and stale mount points. Make sure to run utdiskadm -r before unplugging any mass storage device.

% /opt/SUNWut/bin/utdiskadm -r device_name

15.5.9. Troubleshooting Mass Storage Devices

This section provides troubleshooting information for mass storage.

15.5.9.1. Problem: Device nodes are not created.

Check the log file /var/opt/SUNWut/log/utstoraged.log for a message about why device nodes were not created. Some mass storage device types are not supported.

15.5.9.2. Problem: The device is not automatically mounted.

Check the log file /var/opt/SUNWut/log/utmountd.log for an error message.

This condition occurs when the Sun Ray operating system does not recognize the storage devices's file system.

15.5.9.3. Problem: The device is not automatically unmounted.

This condition occurs when a user still has an open reference to the mount point at the time the storage device is unplugged or the user's session is disconnected. The mount point becomes a stale mount point and persists until the system is rebooted or until the administrator removes it.

Use the following procedure to find and remove stale mount points.

  1. Search for stale mount points:

    # utdiskadm -s
  2. For each stale mount point, close all references to the mount point.

  3. For each stale mount point, terminate all processes that refer to the mount point.

  4. Remove the mount point.

    # umount stale_mount_path