USB mass storage device class


The USB mass storage device class is a set of computing communications protocols, specifically a USB Device Class, defined by the USB Implementers Forum that makes a USB device accessible to a host computing device and enables file transfers between the host and the USB device. To a host, the USB device acts as an external hard drive; the protocol set interfaces with a number of storage devices.

Uses

Devices connected to computers via this standard include:
Devices supporting this standard are known as MSC devices. While MSC is the original abbreviation, UMS has also come into common use.

Operating system support

Most mainstream operating systems include support for USB mass storage devices; support on older systems is usually available through patches.

Microsoft Windows

Microsoft Windows has supported MSC since Windows 2000. There is no support for USB supplied by Microsoft in Windows before Windows 95 and Windows NT 4.0. Windows 95 OSR2.1, an update to the operating system, featured limited support for USB. During that time no generic USB mass-storage driver was produced by Microsoft, and a device-specific driver was needed for each type of USB storage device. Third-party, freeware drivers became available for Windows 98 and Windows 98SE, and third-party drivers are also available for Windows NT 4.0. Windows 2000 has support for standard USB mass-storage devices; Windows Me and all later Windows versions also include support.
Windows Mobile supports accessing most USB mass-storage devices formatted with FAT on devices with USB Host. However, portable devices typically cannot provide enough power for hard-drive disk enclosures without a self-powered USB hub. A Windows Mobile device cannot display its file system as a mass-storage device unless the device implementer adds that functionality. However, third-party applications add MSC emulation to most WM devices. Only memory cards can generally be exported, due to file-systems issues; see [|device access], below.
The AutoRun feature of Windows worked on all removable media, allowing USB storage devices to become a portal for computer viruses. Beginning with Windows 7, Microsoft limited AutoRun to CD and DVD drives, updating previous Windows versions.

MS-DOS

Neither MS-DOS nor most compatible operating systems included support for USB. Third-party generic drivers, such as Duse, USBASPI and DOSUSB, are available to support USB mass-storage devices. FreeDOS supports USB mass storage as an Advanced SCSI Programming Interface interface.

Mac OS

's Mac OS 9 and X support USB mass storage; Mac OS 8.5.1 supported USB mass storage through an optional driver.

Linux

The Linux kernel has supported USB mass-storage devices since its 2.4 series, and a backport to kernel 2.2.18 has been made. In Linux, more features exist in addition to the generic drivers for USB mass-storage device class devices, including quirks, bug fixes and additional functionality for devices and controllers. This includes a certain portion of Android-based devices, through support USB-OTG, since Android uses the Linux kernel.

Other Unix-related systems

has supported devices since its version 2.8, NetBSD since its version 1.5, FreeBSD since its version 4.0 and OpenBSD since its version 2.7. Digital UNIX, has supported USB and USB mass-storage devices since its version 4.0E. AIX has supported USB mass-storage devices since its 5.3 T9 and 6.1 T3 versions; however, it is not well-supported and lacks features such as partitioning and general blocking.

Game consoles and embedded devices

The Xbox 360 and PlayStation 3 support most mass-storage devices for the data transfer of media such as pictures and music. As of April 2010, the Xbox 360 used a mass-storage device for saved games and the PS3 allowed transfers between devices on a mass-storage device. Independent developers have released drivers for the TI-84 Plus and TI-84 Plus Silver Edition to access USB mass-storage devices. In these calculators, the usb8x driver supports the msd8x user-interface application.

Device access

The USB mass-storage specification provides an interface to a number of industry-standard command sets, allowing a device to disclose its subclass. In practice, there is little support for specifying a command set via its subclass; most drivers only support the SCSI transparent command set, designating their subset of the SCSI command set with their SCSI Peripheral Device Type. Subclass codes specify the following command sets:
  1. Reduced Block Commands
  2. SFF-8020i, MMC-2
  3. QIC-157
  4. Uniform Floppy Interface
  5. SFF-8070i
  6. SCSI transparent command set
The specification does not require a particular file system on conforming devices. Based on the specified command set and any subset, it provides a means to read and write sectors of data. Operating systems may treat a USB mass-storage device like a hard drive; users may partition it in any format, and format it with any file system.
Because of its relative simplicity, the most-common file system on embedded devices such as USB flash drives, cameras, or digital audio players is Microsoft's FAT or FAT32 file system. Large, USB-based hard disks may be formatted with NTFS, which is less supported. However, a keydrive or other device may be formatted with another file system. This choice may limit access to a device's contents by equipment using a different operating system. OS-dependent storage options include LVM, partition tables and software encryption.
In cameras, MP3 players and similar devices which must access a file system independent of an external host, the FAT32 file system is preferred by manufacturers. All such devices halt their file-system before making it available to a host operating system to prevent file-system corruption or other damage. Some devices have a write-protection switch allowing them to be used in read-only mode; this makes files available for shared use without the risk of virus infection.
Two main partitioning schemes are used by vendors of pre-formatted devices. One puts the file system directly on the device without partitioning, making it start from sector 0 without additional boot sectors, headers or partitions. The other uses a DOS partition table, with one partition spanning the entire device. This partition is often aligned to a high power of two of the sectors, common in solid state drives for performance and durability. Some devices with embedded storage resembling a USB mass-storage device will report a damaged file system if they are reformatted with a different file system. However, most default-partition devices may be repartitioned with additional partitions. Such devices will use the first partition for their own operations; after connecting to the host system, all partitions are available.
Devices connected by a single USB port may function as multiple USB devices, one of which is a USB mass-storage device. This simplifies distribution and access to drivers and documentation, primarily for the Microsoft Windows and Mac OS X operating systems. Such drivers are required to make full use of the device, usually because it does not fit a standard USB class or has additional functionality. An embedded USB mass-storage device makes it possible to install additional drivers without CD-ROM disks, floppies or Internet access to a vendor website; this is important, since many modern systems are supplied without optical or floppy drives. Internet access may be unavailable because the device provides network access. The embedded USB mass storage is usually made permanently read-only by the vendor, preventing accidental corruption and use for other purposes. Advantages of this method of distribution are lower cost, simplified installation and ensuring driver portability.

Design

Some advanced hard disk drive commands, such as Tagged Command Queuing and Native Command Queuing, ATA Secure Erase and S.M.A.R.T. exist as extensions to low-level drive command sets such as SCSI, ATA and ATAPI. These features may not work when the drives are placed in a disk enclosure that supports a USB mass-storage interface. Some USB mass-storage interfaces are generic, providing basic read-write commands; although that works well for basic data transfers with devices containing hard drives, there is no simple way to send advanced, device-specific commands to such USB mass-storage devices. The USB Attached SCSI protocol, introduced in USB 3.0, fixes several of these issues, including command queuing, command pipes for hardware requiring them, and power management.
Specific USB 2.0 chipsets had proprietary methods of achieving SCSI pass-through, which could be used to read S.M.A.R.T. data from drives using tools such as smartctl. More recent USB storage chipsets support the SCSI / ATA Translation as a generic protocol for interacting with ATA devices. Using esoteric ATA or SCSI pass-through commands when a drive is connected via a USB bridge may cause drive failure, especially with the hdparm utility.