Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I get the Hard Drive serial number of a USB drive on OS X?

Tags:

c++

c

macos

I have looked at DADiskCopyDescription and enumerating IOUSBDevice from IOKit and neither provide me with the serial number of the USB hard drive. The latter provides a USB Serial number which is not equivalent to its hard drive serial number. How do I get that (in c/c++, NOT via the shell)?

like image 630
chacham15 Avatar asked Apr 27 '13 04:04

chacham15


People also ask

How do I find the serial number on a USB drive?

To find the serial number, insert the flash drive into your computer. Once recognized, display the properties of the USB device using the Device Manager within Windows. Under Properties is a Details tab with a drop-down menu. Select to display the serial number of your USB drive.

Do USB drives have serial numbers?

We have often started in the USBSTOR key, and then drilled down to identify the USB device. After identifying the device Vendor and Product, we proceed to the subkey of that key, and we see the values as shown in the diagram below. It has long been held (and reported) that this value is the serial number of the device.

How do I find my hard drive on Mac OS X?

In the Finder on your Mac, choose Finder > Preferences. Click General, then select the items you want to see on the desktop. For example, if you select “Hard disks,” icons for your hard disks appear on your desktop.

How to find hard drive serial number in Windows 10?

Hard Drive Serial Number The hard drive serial number or the SSD serial number is different from the volume serial number. To find the hard drive serial number or the solid-state drive serial number, enter the following command in the Command Prompt. wmic diskdrive get serialnumber

How do I find the model number of my hard drive?

Open Start. Search for Command Prompt and click the top result to open the app. Type the following command to check the name, brand, model, and serial number information and press Enter: wmic diskdrive get model,serialNumber,size,mediaType

How to find a drive's volume label or serial number?

How to Find a Drive's Volume Label or Serial Number From the Command Prompt. Open Command Prompt. In Windows 10 and Windows 8, you can find Command Prompt by right-clicking the Start button. In older versions of Windows, either search the Start menu for cmd or find Command Prompt in the Accessories folder of the Start menu.

How do I find out what hard drive I have?

To determine some basic information about the hard drive installed on your device, use these steps: Open Start. Search for Command Prompt and click the top result to open the app. Type the following command to check the name, brand, model, and serial number information and press Enter: wmic diskdrive get model,serialNumber,size,mediaType.


1 Answers

What you are basically asking is "How do I directly communicate with a hard drive over USB?"

The answer is: It depends on the USB controller. Not all controllers support your request.

The following conditions must exist:

  1. The USB bridge must support ATA pass-through (if ATA)
  2. SCSI must be supported on the host OS
  3. The OS must provide a SCSI pass-through API (Yes on Windows and Linux, No on MacOS X)

Another factor arises: Some controllers support drive manufacturer-independent passthroughs, but some support different commands based on the hard drive they are controlling. This also depends on whether the attached drive is PATA, SATA/SAS, or SCSI.

Examples of controllers that support at least one of the above include Sunplus SPIF215/6, SPIF225/6; JMicron JM20329, JM20335-39; and Cypress CY7C68300B/C (AT2LP), CY7C68310 (ISD-300LP).

Wish I had happier news for you.

like image 57
Charles Burns Avatar answered Oct 07 '22 15:10

Charles Burns