List NVMe volumes
You can find the disks on your Windows instance using Disk Management or Powershell.
List NVMe disks using Disk Management
You can find the disks on your Windows instance using Disk Management.
To find the disks on your Windows instance
Log in to your Windows instance using Remote Desktop. For more information, see Connect to your Windows instance.
- Start the Disk Management utility.
- Review the disks. The root volume is an EBS volume mounted as C:\. If there are no other disks shown, then you didn’t specify additional volumes when you created the AMI or launched the instance.
The following is an example that shows the disks that are available if you launch an r5d.4xlarge instance with two additional EBS volumes.
List NVMe disks using PowerShell
The following CLI script lists each disk name and its corresponding volume ID.
- Connect to your Windows instance and run the following command to enable PowerShell script execution.
Set-ExecutionPolicy RemoteSigned
2.Copy the following script in notepad and save it as mapping.ps1 on your Windows instance.
# List the disks for NVMe volumes
function Get-EC2InstanceMetadata {
param([string]$Path)
(Invoke-WebRequest -Uri "http://169.254.169.254/latest/$Path").Content
}
function GetEBSVolumeId {
param($Path)
$SerialNumber = (Get-Disk -Path $Path).SerialNumber
if($SerialNumber -clike 'vol*'){
$EbsVolumeId = $SerialNumber.Substring(0,20).Replace("vol","vol-")
}
else {
$EbsVolumeId = $SerialNumber.Substring(0,20).Replace("AWS","AWS-")
}
return $EbsVolumeId
}
function GetDeviceName{
param($EbsVolumeId)
if($EbsVolumeId -clike 'vol*'){
$Device = ((Get-EC2Volume -VolumeId $EbsVolumeId ).Attachment).Device
$VolumeName = ""
}
else {
$Device = "Ephemeral"
$VolumeName = "Temporary Storage"
}
Return $Device,$VolumeName
}
function GetDriveLetter{
param($Path)
$DiskNumber = (Get-Disk -Path $Path).Number
if($DiskNumber -eq 0){
$VirtualDevice = "root"
$DriveLetter = "C"
$PartitionNumber = (Get-Partition -DriveLetter C).PartitionNumber
}
else
{
$VirtualDevice = "N/A"
$DriveLetter = (Get-Partition -DiskNumber $DiskNumber).DriveLetter
if(!$DriveLetter)
{
$DriveLetter = ((Get-Partition -DiskId $Path).AccessPaths).Split(",")[0]
}
$PartitionNumber = (Get-Partition -DiskId $Path).PartitionNumber
}
return $DriveLetter,$VirtualDevice,$PartitionNumber
}
$Report = @()
foreach($Path in (Get-Disk).Path)
{
$Disk_ID = ( Get-Partition -DiskId $Path).DiskId
$Disk = ( Get-Disk -Path $Path).Number
$EbsVolumeId = GetEBSVolumeId($Path)
$Size =(Get-Disk -Path $Path).Size
$DriveLetter,$VirtualDevice, $Partition = (GetDriveLetter($Path))
$Device,$VolumeName = GetDeviceName($EbsVolumeId)
$Disk = New-Object PSObject -Property @{
Disk = $Disk
Partitions = $Partition
DriveLetter = $DriveLetter
EbsVolumeId = $EbsVolumeId
Device = $Device
VirtualDevice = $VirtualDevice
VolumeName= $VolumeName
}
$Report += $Disk
}
$Report | Sort-Object Disk | Format-Table -AutoSize -Property Disk, Partitions, DriveLetter, EbsVolumeId, Device, VirtualDevice, VolumeName
- Run the script in powershell in the location the file is saved in:
PS D:\> .\mapping.ps1
The following is example output for an instance with a root volume, two EBS volumes, and two instance store volumes.
Disk Partitions DriveLetter EbsVolumeId Device VirtualDevice VolumeName
—- ———- ———– ———– —— ————- ———-
0 1 C vol-03683f1d861744bc7 /dev/sda1 root
1 1 D vol-082b07051043174b9 xvdb N/A
2 1 E vol-0a4064b39e5f534a2 xvdc N/A
3 1 F AWS-6AAD8C2AEEE1193F0 Ephemeral N/A Temporary Storage
4 1 G AWS-13E7299C2BD031A28 Ephemeral N/A Temporary Storage