Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
USB mass storage device class
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
{{Short description|USB device class for drives}} {{More citations needed|date=November 2022}} [[File:USB flash drive.jpg|thumb|upright|alt=A USB thumb drive and its cap, next to a 100 millimeter ruler for scale|[[USB flash drive]]s typically implement the USB mass storage device class.]] The '''USB mass storage device class''' (also known as '''USB MSC''' or '''UMS''') is a set of computing [[communications protocol]]s, specifically a [[USB#Device_classes|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 sets interfaces with a number of storage devices. == Uses == [[File:Action camera being accessed via MSDC.jpg|thumb|An action camera being accessed via mass storage device class]] Devices connected to computers via this standard include: * External magnetic [[hard drive]]s * External optical drives, including [[CD]] and [[DVD]] reader and writer drives * [[USB flash drive]]s * [[Solid-state drive]]s * Adapters between standard flash [[memory card]]s and USB connections * [[Digital camera]]s * [[Portable media player]]s * [[Card reader]]s * [[Personal digital assistant|PDA]]s * [[Mobile phones]] Devices supporting this standard are known as MSC (Mass Storage Class) devices. While MSC is the original abbreviation, UMS (Universal Mass Storage) has also become common use. == Operating system support == Most mainstream [[operating system]]s 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 (including for [[Windows 98]]), 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 (via a generic driver) 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 [[File Allocation Table|FAT]] on devices with USB Host. However, portable devices typically cannot provide enough power for hard-drive [[disk enclosure]]s (a {{convert|2.5|in|adj=on}} hard drive typically requires the maximum 2.5 [[Watt|W]] in the USB specification) 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 (commercial Softick CardExport and free WM5torage). Only memory cards (not internal-storage memory) can generally be exported, due to file-system issues; see [[#Device access|device access]], below. The [[AutoRun]] feature of Windows worked on all removable media, allowing USB storage devices to become a portal for [[computer virus]]es. Beginning with [[Windows 7]], Microsoft limited AutoRun to CD and DVD drives, updating previous Windows versions.<ref>{{cite web |url=http://blogs.technet.com/msrc/archive/2009/04/28/changes-in-windows-to-meet-changes-in-threat-landscape.aspx |title=Changes in Windows to Meet Changes in Threat Landscape |publisher=TechNet Blogs |date=2009-04-28 |access-date=2012-11-07}}</ref> === 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]] (ASPI) interface. === Classic Mac OS and macOS === [[Apple Inc.|Apple]]'s [[Mac OS 9]] and [[macOS]] support USB mass storage; Mac OS 8.6 supported USB mass storage through an optional driver.<ref>{{Cite web|title=USB Mass Storage 1.3.5 - Macintosh Repository|url=https://www.macintoshrepository.org/161-usb-mass-storage-1-3-5|access-date=2024-11-27|website=www.macintoshrepository.org}}</ref> === Linux === The [[Linux kernel]] has supported USB mass-storage devices since version 2.3.47<ref>{{cite web|title=usb-storage.c - drivers/usb/usb-storage.c - Linux source code 2.3.47pre8 - Bootlin Elixir Cross Referencer|url=https://elixir.bootlin.com/linux/2.3.47pre8/source/drivers/usb/usb-storage.c|access-date=2024-11-27|website=elixir.bootlin.com}}</ref> (2001, [[backport|backported]] to kernel 2.2.18<ref>{{cite web|title=usb-storage.c - drivers/usb/usb-storage.c - Linux source code 2.2.18pre2 - Bootlin Elixir Cross Referencer|url=https://elixir.bootlin.com/linux/2.2.18pre2/source/drivers/usb/usb-storage.c|access-date=2024-11-27|website=elixir.bootlin.com}}</ref>). This support includes quirks and silicon/firmware bug workarounds as well as additional functionality for devices and controllers (vendor-enabled functions such as [[Parallel ATA|ATA]] command pass-through for ATA-USB bridges, used for [[Self-Monitoring, Analysis and Reporting Technology|S.M.A.R.T.]] or temperature monitoring, controlling the spin-up and spin-down of hard disk drives, and other options). Mobile devices running [[Android (operating system)|Android]] 6 or higher<ref>{{cite web|title=Traditional storage {{!}} Android Open Source Project|at=sec. USB media support|url=https://source.android.com/docs/core/storage/traditional#support_usb_media|access-date=2024-11-27|website=source.android.com}}</ref> also supports USB mass storage through [[USB#Dual-role_USB_connections|dual-role USB]] on USB-C ports, and [[USB-OTG]] on older ports. === {{anchor|Other Unix-likes}}Other Unix-related systems === [[Solaris (operating system)|Solaris]] has supported devices since its version 2.8 (1998), [[NetBSD]] since its version 1.5 (2000), [[FreeBSD]] since its version 4.0 (2000) and [[OpenBSD]] since its version 2.7 (2000). Digital UNIX (later known as [[Tru64 UNIX]]) has supported USB and USB mass-storage devices since its version 4.0E (1998). [[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.<ref>{{cite web|url=http://eserver.livejournal.com/27707.html |title=eserver: HOWTO: JFS2 on USB device on AIX 5.3.11.1 |website=Eserver.livejournal.com |date=2010-01-21 |access-date=2012-11-07 |url-status=dead |archive-url=https://web.archive.org/web/20120331082549/http://eserver.livejournal.com/27707.html |archive-date=2012-03-31 }}</ref> === 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 (a) used a mass-storage device for saved games<ref>{{cite web|url=http://majornelson.com/archive/2010/03/26/USB-Memory-Support-for-the-Xbox-360-coming-April-6th.aspx |title=Xbox Live's Major Nelson Β» USB Memory Support for the Xbox 360 coming April 6th |website=Majornelson.com |date=2010-03-26 |access-date=2012-11-07}}</ref> 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.<ref>{{cite web|url=http://wikiti.brandonw.net/index.php?title=83Plus:Software:usb8x/Asm_Interface/MSD |title=83Plus:Software:usb8x/Asm Interface/MSD |publisher= WikiTI |date=2009-02-18 |access-date=2012-11-07}}</ref> In these calculators, the [[usb8x]] driver supports the [[msd8x]] user-interface application. ==Device access== [[File:Usbcardreader.png|thumb|alt=A small, thin, gray box, with data card inserted in a bottom slot|USB [[card reader]]s typically implement the USB mass storage device class.]] {{see also|USB Attached SCSI}} {{missing information|section|Bulk-Only Transport: we keep linking to this article to contrast with UAS but there's no description here!|date=May 2023}} 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 command|SCSI transparent command set]], designating their subset of the SCSI command set with their SCSI Peripheral Device Type (PDT). Subclass codes specify the following command sets: # Reduced Block Commands (RBC) # [[Small Form Factor committee|SFF]]-8020i, [[MultiMedia Commands|MMC]]-2 (used by ATAPI-style CD and DVD drives) # [[Quarter-inch cartridge|QIC]]-157 (tape drives) # [[Uniform Floppy Interface]] (UFI) # SFF-8070i (used by ARMD-style devices) # SCSI transparent command set (use "inquiry" to obtain the PDT) 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 (similar to the low-level interface used to access a [[hard drive]]). Operating systems may treat a USB mass-storage device like a hard drive; users may partition it in any format (such as MBR and GPT), and format it with any file system. Because of its relative simplicity, the most common file system on [[embedded system|embedded devices]] such as [[USB flash drive]]s, cameras, or digital audio players is Microsoft's [[File Allocation Table|FAT]] or [[FAT32]] file system (with optional support for [[long filename]]s). However, USB mass storage devices may be formatted with any other file system, such as [[NTFS]] on Windows NT, [[HFS Plus]] on [[macOS]], [[ext2]] on [[Linux]], or [[Unix File System]] on [[Solaris (operating system)|Solaris]] or BSD. This choice may limit (or prevent) access to a device's contents by equipment using a different operating system. OS-dependent storage options include [[Logical volume management|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 ([[umount|dismount]]) before making it available to a host operating system to prevent file-system corruption or other damage (although it is theoretically possible for both devices to use read-only mode or a [[cluster file system]]). Some devices have a write-protection switch (or option) allowing them to be used in read-only mode. Two main partitioning schemes are used by vendors of pre-formatted devices. One puts the file system (usually FAT32) directly on the device without partitioning, making it start from sector 0 without additional boot sectors, [[Header (computing)|headers]] or partitions. The other uses a DOS partition table (and MBR code), with one partition spanning the entire device. This partition is often aligned to a high power of two of the sectors (such as 1 or 2 MB), common in [[SSD|solid state drives]] for performance and durability. Some devices with embedded storage resembling a USB mass-storage device (such as MP3 players with a USB port) will report a damaged (or missing) file system if they are reformatted with a different file system. However, most default-partition devices may be repartitioned (by reducing the first partition and file system) 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 (wireless, [[GSM]] or Ethernet cards). The embedded USB mass storage is usually made permanently read-only by the vendor, preventing accidental corruption and use for other purposes (although it may be updated with proprietary protocols when performing a firmware upgrade). 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]] (which may increase performance), [[ATA Secure Erase]] (which allows all data on the drive to be securely erased) and S.M.A.R.T. (accessing indicators of drive reliability) exist as extensions to low-level drive command sets such as [[SCSI]], [[ATA command set|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 (though, devices may create their own communication protocols over a standard USB control interface). The [[USB Attached SCSI]] (UAS) 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]] (using the {{mono|-d}} option followed by "chipset").<ref>{{cite web|url=http://sourceforge.net/apps/trac/smartmontools/ticket/25#comment:17 |title=#25 (SCSI pass through for SMART via USB on MacOSX smartmontools? 3rd party code available!) β smartmontools |website=Sourceforge.net |access-date=2014-01-21}}</ref> More recent USB storage chipsets support the [[SCSI / ATA Translation]] (SAT) as a generic protocol for interacting with ATA (and SATA) devices.<ref>{{cite web |url=http://sourceforge.net/apps/trac/smartmontools/wiki/USB |title=USB smartmontools |website=Sourceforge.net |access-date=2014-01-21 |url-status=dead |archive-url=https://web.archive.org/web/20120207000458/http://sourceforge.net/apps/trac/smartmontools/wiki/USB |archive-date=2012-02-07 }}</ref> Using esoteric ATA or SCSI pass-through commands (such as secure-erase or password protection) when a drive is connected via a USB bridge may cause drive failure, especially with the [[hdparm]] utility.<ref>{{cite web|url=https://ata.wiki.kernel.org/index.php/ATA_Secure_Erase |title=ATA Secure Erase - ata Wiki |website=Ata.wiki.kernel.org |date=2013-07-22 |access-date=2014-01-21}}</ref> ==See also== * [[USB#Device classes|List of USB Device Classes]] * [[Disk encryption software]] * [[Media Transfer Protocol]] * [[Picture Transfer Protocol]] * [[SCSI / ATA Translation]] ==References== {{Reflist}} == Further reading == From the USB Implementers Forum website: * [https://usb.org/document-library/mass-storage-class-specification-overview-14 Mass Storage Class Specification Overview 1.4] * [https://usb.org/document-library/mass-storage-bootability-specification-10 Mass Storage Bootability Specification 1.0] * [https://usb.org/document-library/mass-storage-bulk-only-10 "Mass Storage Bulk Only 1.0" ] == External links == * [https://cgit.freebsd.org/src/tree/sys/dev/usb/storage/ USB Mass Storage Device source code in FreeBSD] * [https://www.technovelty.org/linux/what-actually-happens-when-you-plug-in-a-usb-device.html What actually happens when you plug in a USB device?]{{snd}} Linux kernel internals {{USB}} {{Computer-bus}} [[Category:Computer storage buses]] [[Category:Computer storage devices]] [[Category:USB|Mass storage device class]]
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)
Pages transcluded onto the current version of this page
(
help
)
:
Template:Anchor
(
edit
)
Template:Cite web
(
edit
)
Template:Computer-bus
(
edit
)
Template:Convert
(
edit
)
Template:Missing information
(
edit
)
Template:Mono
(
edit
)
Template:More citations needed
(
edit
)
Template:Reflist
(
edit
)
Template:See also
(
edit
)
Template:Short description
(
edit
)
Template:Snd
(
edit
)
Template:USB
(
edit
)