AWS-CLI: Detach A Volume

Check Volume’s Status
PS C:\Windows> aws ec2 describe-volumes --region us-west-1 --volume-ids vol-0a0f16ef5a9d69a29
{
"Volumes": [
{
"Attachments": [
{
"AttachTime": "2019-06-10T04:49:02.000Z",
"Device": "/dev/sda1",
"InstanceId": "i-0c8a54804bdef133a",
"State": "attached",
"VolumeId": "vol-0a0f16ef5a9d69a29",
"DeleteOnTermination": false
}
],
"AvailabilityZone": "us-west-1c",
"CreateTime": "2019-06-10T04:34:51.619Z",
"Encrypted": true,
"Size": 30,
"SnapshotId": "snap-041a3825ebe9c3c33",
"State": "in-use",
"VolumeId": "vol-0a0f16ef5a9d69a29",
"Iops": 100,
"Tags": [
{
"Key": "Name",
"Value": "kimconnect"
}
],
"VolumeType": "gp2"
}
]
}

Since the volume is currently mounted as /dev/sda1 on InstanceID i-0c8a54804bdef133a, it must be unmounted prior to a detachment

Yo detach this...

Now, the force detach command

...

Leave a Reply

Your email address will not be published. Required fields are marked *