Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 357589
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T12:13:11+00:00 2026-05-12T12:13:11+00:00

Does anyone know how to auto-mount an Elastic Block Storage (EBS) volume when starting

  • 0

Does anyone know how to auto-mount an Elastic Block Storage (EBS) volume when starting a Windows 2003 instance in Amazon’s Elastic Compute Cloud (EC2)?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-12T12:13:11+00:00Added an answer on May 12, 2026 at 12:13 pm

    Setup:

    • Make sure the EBS volume is formatted and labeled (in the example I used the label PDRIVE).
    • Setup a drive mapping using Ec2ConfigServiceSettings.exe
    • Install Java on the instance
    • Install the EC2 API command line tools
    • Install a copy of your cert and private key
    • Install a copy of curl.exe (open source tool)

    You can use the group policy editor to set this script as your startup script. See http://technet.microsoft.com/en-us/library/cc739591(WS.10).aspx for more information.

    REM @echo off
    REM setlocal ENABLEDELAYEDEXPANSION
    
    C:\WINDOWS\system32\eventcreate /l SYSTEM /t information /id 100 /so AttachEbsBoot /d "Starting attach-ebs-boot.cmd"
    
    REM local variables
    REM Make sure you include the directory with curl.exe and the EC2 command line tools in the path
    set path=C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;c:\Utils;C:\ebin\ec2\bin
    set JAVA_HOME=c:\java
    set EC2_HOME=c:\ebin\ec2
    set EC2_CERT=<your_cert>
    set EC2_PRIVATE_KEY=<your_private_key>
    
    REM Please note: you should use the Ec2 Config Serive Settings application to ensure
    REM that your EBS volume is mapped to a particular drive letter.
    REM
    REM edit as needed
    set EBS_DRIVE=P:
    set EBS_DEVICE=xvdp
    
    REM Test to see if the drive is already attached. If it is then we're done.
    if exist %EBS_DRIVE%\nul (goto done)
    
    REM get the EBS volume ID from the user data and the instance ID from the meta-data
    for /f "delims=" %%a in ('curl http://169.254.169.254/latest/user-data') do (set EBS_VOLUME=%%a)
    for /f "delims=" %%b in ('curl http://169.254.169.254/latest/meta-data/instance-id') do (set INSTANCE_ID=%%b)
    
    C:\WINDOWS\system32\eventcreate /l SYSTEM /t information /id 102 /so AttachEbsBoot /d "Volume == %EBS_VOLUME%"
    C:\WINDOWS\system32\eventcreate /l SYSTEM /t information /id 103 /so AttachEbsBoot /d "Instance == %INSTANCE_ID%"
    
    REM attach the volume
    REM 
    REM Use a series of set command to build the command line
    SET COMMAND_LINE=%EBS_VOLUME%
    SET COMMAND_LINE=%COMMAND_LINE% -i
    SET COMMAND_LINE=%COMMAND_LINE% %INSTANCE_ID%
    SET COMMAND_LINE=%COMMAND_LINE% -d
    SET COMMAND_LINE=%COMMAND_LINE% %EBS_DEVICE%
    
    C:\WINDOWS\system32\eventcreate /l SYSTEM /t information /id 104 /so AttachEbsBoot /d "calling ec2attvole %COMMAND_LINE%"
    
    call ec2attvol.cmd %COMMAND_LINE%
    
    :DONE
    C:\WINDOWS\system32\eventcreate /l SYSTEM /t information /id 101 /so AttachEbsBoot /d "Exiting attach-ebs-boot.cmd"
    
    REM Events logged in the System event log
    REM source === AttachEbsBoot
    REM 
    REM Event 100 - Script start
    REM Event 101 - Script end
    REM Event 102 - Volume ID
    REM Event 103 - Instance ID
    REM Event 104 - Command line for ec2attvol
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 189k
  • Answers 189k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer Have a look at this link for using vb/vba code… May 12, 2026 at 5:43 pm
  • Editorial Team
    Editorial Team added an answer You don't. The whole reason for using the SecureString object… May 12, 2026 at 5:43 pm
  • Editorial Team
    Editorial Team added an answer I don't know of a python module to do it,… May 12, 2026 at 5:43 pm

Related Questions

I am trying to add simple syntax highlighting and auto completion for a simple
Does anyone know how to set up auto completion to work nicely with python,
To set tabs in emacs I have this line in my .emacs: (global-set-key (kbd
I've searched a good deal, and can't seem to find a satisfactory solution. I

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.