For AI agents: the complete documentation index is available at https://docs.us.ovhcloud.com/en/llms.txt, the full documentation bundle is available at https://docs.us.ovhcloud.com/en/llms-full.txt, and this page is available as Markdown at https://docs.us.ovhcloud.com/en/bare-metal-cloud/dedicated-servers/finding-serial-number-hard-disk.md.
  • English

Finding the serial number of a hard disk

View as Markdown

To minimize the chance of human error during hard disk replacements, we ask our customers to provide the serial number of the disk they want to replace.

 

Requirements

 

Instructions

Info

For an NVMe disk, place the server in rescue mode and use the nvme-cli tool installed by default.

Retrieve a disk's serial number (Software RAID)

To retrieve your hard drive's serial number with a software RAID configuration, you can simply use:

smartctl -a /dev/sdX | grep Serial

The device is detected by the OS (e.g., /dev/sda, /dev/sdb, etc.).

 

Retrieve a disk's serial number (NVMe disks)

For NVMe disks, it will be necessary to use the command:

root@rescue:~# nvme list

Node          SN                  Model                Namespace  Usage                      Format   FW Rev
/dev/nvme0n1  CVPF636600YC450RGN  INTEL SSDPE2MX450G7  1          450.10 GB / 450.10 GB 512  B + 0 B  MDV10253
/dev/nvme1n1  CVPF6333002Y450RGN  INTEL SSDPE2MX450G7  1          450.10 GB / 450.10 GB 512  B + 0 B  MDV10253

You can then see the serial numbers of your NVMe disks (nvme0 and nvme1).

 

Retrieve a disk's serial number (Windows)

For Dedicated Servers with Windows Server installed, Windows PowerShell can be used to view the serial number on your devices.

To open Windows PowerShell, click the magnifying glass icon on the bottom-left of the Windows home screen. Type "powershell" into the search bar and select Windows PowerShell.

Powershell - Finding serial number hard disk

In PowerShell, enter the following command:

Info

Depending on the drive type (HDD, NVMe, SSD), the serial number is collected in a different property of the command. The DeviceId property will identify the disk position

Usually (with possible exceptions):

  • SATA HDDs use SerialNumber
  • NVMe drives use AdapterSerialNumber
  • SATA SSDs use either of the above.
Get-PhysicalDisk | Select-Object DeviceId, FriendlyName, SerialNumber, AdapterSerialNumber, FruId | ft

Here is a sample output on a Dedicated Server with two HDD storage devices, but this will also work with NVMe storage devices:

PS C:\Users\admin Get-PhysicalDisk | Select-Object DeviceId, FriendlyName, SerialNumber, AdapterSerialNumber, FruId | ft
 
DeviceId FriendlyName                   SerialNumber                             AdapterSerialNumber       FruId
-------- ------------                   ------------                             -------------------       -----
3        HGST HUS726T4TALA6L1           V6GPAA5S                                                           V6GPAA5S
2        HGST HUS726T4TALA6L1           V6GP2PNS                                                           V6GP2PNS
0        HGST HUS726T4TALA6L1           V6GP4VKS                                                           V6GP4VKS
1        HGST HUS726T4TALA6L1           V6GP8D9S                                                           V6GP8D9S
4        WDC CL SN720 SDAQNTW-512G-2000 1851_B280_3534_0001_001B_448B_4454_9201. 1851B2803534        _2017 1851B2803534

 

Retrieve a disk's serial number (Hardware RAID)

For an in-depth look at these commands and how to test your hard disks, refer to this guide (LSI raid controller).

 

MegaRaid Controller

Step 1: Recover RAID sets

You can find the serial number using the smartctl command. However, before executing this command, you will need to find out how many RAID sets (or Virtual Drives) your server contains.

You can retrieve this information by using the following command:

MegaCli -LDInfo -Lall -aALL | egrep 'Adapter|Size' | grep -v Strip

Adapter 0

Virtual Drive Information: Size : 36.321 GB

Adapter 1

Virtual Drive Information: Size : 2.727 TB

In this example, there are two RAID configurations on the server (Adapter 0 and Adapter 1). These should be mapped to /dev/sda and /dev/sdb.

 

Step 2: Recover disk information

Next, you will need to gather the physical disk information using the following command:

MegaCli -PDList -aAll | egrep 'Slot\ Number|Device\ Id|Inquiry\ Data|Raw|Firmware\ state' | sed 's/Slot/\nSlot/g'

Slot Number: 0
Device Id: 4
Raw Size: 279.460 GB [0x22eec130 Sectors]
Firmware state: Online, Spun Up
Inquiry Data: BTWL3450062J300PGN  INTEL SSDSC2BB300G4                     D2010355

Slot Number: 1
Device Id: 5
Raw Size: 279.460 GB [0x22eec130 Sectors] 
Firmware state: Online, Spun Up 
Inquiry Data: BTWL345003X6300PGN  INTEL SSDSC2BB300G4                     D2010355

Slot Number: 2
Device Id: 7
Raw Size: 2.728 TB [0x15d50a3b0 Sectors] 
Firmware state: Online, Spun Up 
Inquiry Data:       PN2234P8K2PKDYHGST HUS724030ALA640                    MF8OAA70

Slot Number: 3 
Device Id: 6 
Raw Size: 2.728 TB [0x15d50a3b0 Sectors] 
Firmware state: Online, Spun Up 
Inquiry Data:       PN2234P8JYP59YHGST HUS724030ALA640                    MF8OAA70

 

Step 3: Recover the serial number

The Device ID and Adapter ID will be used to tell smartctl which disk to look for in which RAID array.

The command should look like this:

smartctl -d megaraid,N -a /dev/sdX | grep Serial

The RAID Device ID will be displayed as follows: /dev/sda = 1st RAID, /dev/sdb = 2nd RAID, etc.

Info

In some situations, you may receive this output:

/dev/sda [megaraid_disk_00] [SAT]: Device open changed type from 'megaraid' to 'sat'

You must then replace megaraid with sat+megaraid:

smartctl -d sat+megaraid,N -a /dev/sdX | grep Serial

 

Retrieve a disk's serial number (LSI RAID Controller)

LSI RAID controller uses a module called sg-map, which maps devices in /dev/sgX (X being the number defining the device).

You can refer to this guide (LSI raid controller) to find which hard drive relates to a designated sg device.

Once you have found the sg device related to the hard disk you want to query, use the following command:

smartctl -a /dev/sgX | grep Serial

The sg device number will be displayed as follows: /dev/sg0, /dev/sg1, etc.

 

Go further

Browse all the Dedicated Servers guides.

Browse the rest of the OVHcloud US documentation for guides on our other products and services.

Learn more about Dedicated Servers on the OVHcloud US website.