Automatically mount volume on EC2
You can use diskpart to do this. Open up cmd.exe and run diskpart. This allows you to execute commands. First, run san policy=onlineall
. Then, type list disk
. Because of the nature of EC2, you should consistently be able to mount the same disk. It appears it should be disk 1. Then, type select disk 1
and online disk
.
To script this, make a file called diskpart.txt and add these lines:
san policy=onlineall
select disk 1
online disk
Then you can execute DISKPART /s diskpart.txt
to automatically mount the drive.
You could consider changing the disk policy to "OnlineAll":
DISKPART> san policy=OnlineAll