Services or capabilities described in Amazon Web Services documentation might vary by Region. To see the differences applicable to the China Regions,
see Getting Started with Amazon Web Services in China
(PDF).
Make an Amazon EBS volume available for use on
Windows
After you attach an Amazon EBS volume to your instance that runs on Xen
hypervisor, it is exposed as a block device, and appears as a
removable disk in Windows. You can format the volume with any file system and then
mount it. After you make the EBS volume available for use, you can access it in the same ways
that you access any other volume. Any data written to this file system is written to the EBS
volume and is transparent to applications using the device.
On Nitro instances, the Amazon EBS volume is exposed as a block device when the
NVM Express (NVMe) controller scans the PCI bus. The disk does not appear as removable. Unlike
Xen-based instances, there is only one NVMe controller per EBS volume on Nitro
instances.
You can take snapshots of your EBS volume for backup purposes or to use as a baseline when
you create another volume. For more information, see Amazon EBS snapshots.
If the EBS volume you are preparing for use is greater than 2 TiB, you must
use a GPT partitioning scheme to access the entire volume. For more information, see Constraints on the size and configuration of an EBS
volume.
You can get directions for volumes on a Linux instance from Make a volume available for use on Linux
in the Amazon EC2 User Guide for Linux Instances.
- PowerShell
-
To make all EBS volumes with raw partitions available to use with Windows
PowerShell
-
Log in to your Windows instance using Remote Desktop. For more information, see
Connect to your Windows instance.
-
On the taskbar, open the Start menu, and choose Windows
PowerShell.
-
Use the provided series of Windows PowerShell commands within the opened
PowerShell prompt. The script performs the following actions by default:
-
Stops the ShellHWDetection service.
-
Enumerates disks where the partition style is raw.
-
Creates a new partition that spans the maximum size the disk and partition
type will support.
-
Assigns an available drive letter.
-
Formats the file system as NTFS with the specified file system label.
-
Starts the ShellHWDetection service again.
Stop-Service -Name ShellHWDetection
Get-Disk | Where PartitionStyle -eq 'raw' | Initialize-Disk -PartitionStyle MBR
-PassThru | New-Partition -AssignDriveLetter -UseMaximumSize | Format-Volume -FileSystem NTFS -NewFileSystemLabel "Volume Label
" -Confirm:$false
Start-Service -Name ShellHWDetection
- DiskPart command line tool
-
To make an EBS volume available to use with the DiskPart command line
tool
-
Log in to your Windows instance using Remote Desktop. For more information, see
Connect to your Windows instance.
-
Determine the disk number that you want to make available:
-
Open the Start menu, and select Windows PowerShell.
-
Use the Get-Disk
Cmdlet to retrieve a list of available
disks.
-
In the command output, note the Number corresponding to
the disk that you're making available.
-
Create a script file to execute DiskPart commands:
-
Open the Start menu, and select File Explorer.
-
Navigate to a directory, such as C:\, to store the script file.
-
Choose or right-click an empty space within the folder to open the dialog
box, position the cursor over New to access the context
menu, and then choose Text Document.
-
Name the text file diskpart.txt
.
-
Add the following commands to the script file. You may need to modify the disk
number, partition type, volume label, and drive letter. The script performs the
following actions by default:
-
Selects disk 1 for modification.
-
Configures the volume to use the master boot record (MBR) partition
structure.
-
Formats the volume as an NTFS volume.
-
Sets the volume label.
-
Assigns the volume a drive letter.
If you're mounting a volume that already has data on it, do not reformat the
volume or you will delete the existing data.
select disk 1
attributes disk clear readonly
online disk noerr
convert mbr
create partition primary
format quick fs=ntfs label="volume_label
"
assign letter="drive_letter
"
For more information, see DiskPart Syntax and Parameters.
-
Open a command prompt, navigate to the folder in which the script is located,
and run the following command to make a volume available for use on the specified
disk:
C:\>
diskpart /s diskpart.txt
- Disk Management utility
-
To make an EBS volume available to use with the Disk Management utility
-
Log in to your Windows instance using Remote Desktop. For more information, see
Connect to your Windows instance.
-
Start the Disk Management utility. On the taskbar, open the context
(right-click) menu for the Windows logo, and choose Disk
Management.
In Windows Server 2008, choose Start,
Administrative Tools, Computer
Management, Disk Management.
-
Bring the volume online. In the lower pane, open the context (right-click) menu
for the left panel for the disk for the EBS volume. Choose
Online.
-
(Conditional) If the disk is not initialized, you must initialize it before you
can use it. If the disk is already initialized, skip this step.
If you're mounting a volume that already has data on it (for example, a public
data set, or a volume that you created from a snapshot), do not reformat the
volume or you will delete the existing data.
If the disk is not initialized, initialize it as follows:
-
Open the context (right-click) menu for the left panel for the disk, and
choose Initialize Disk.
-
In the Initialize Disk dialog box, select a partition
style, and choose OK.
-
Open the context (right-click) menu for the right panel for the disk, and choose
New Simple Volume.
-
In the New Simple Volume Wizard, choose
Next.
-
If you want to change the default maximum value, specify the Simple
volume size in MB, and then choose Next.
-
Specify a preferred drive letter, if necessary, within the Assign the
following drive letter dropdown, and then choose
Next.
-
Specify a Volume Label and adjust the default settings as
necessary, and then choose Next.
-
Review your settings, and then choose Finish to apply the
modifications and close the New Simple Volume wizard.