How do I resolve an Amazon EBS volume that's stuck in the Detaching state?

2 minute read
0

I want to resolve an Amazon Elastic Block Store (Amazon EBS) volume that's stuck in a Detaching state.

Short description

Your Amazon EBS volume might not be able to successfully detach, or be stuck in the Detaching state, for the following reasons:

  • The volume is still mounted to Windows.
  • The volume is stuck in the Busy state when it's detaching.

Resolution

The volume is still mounted to Windows

If your Amazon Elastic Compute Cloud (Amazon EC2) instance is in the Running state, then complete the following steps:

  1. Unmount the volume.
  2. Detach the volume from the instance.

Note: Before you unmount the volume, take a snapshot of the volume so that you don't lose any data. If you force the detachment of a stuck volume, then you might experience damage to your file system or data. Also, when you force detach the volume, you might not be able to attach a new volume with the same device, unless you reboot your instance.

The volume is stuck in the Busy state when it's detaching

Your volume might be stuck in the Busy state when you try to detach a volume that's still mounted.

To resolve this issue, complete the following steps:

  1.       To check if your volume is stuck in the Busy state, run the describe-volumes command. 

Note: If you receive errors when running AWS Command Line Interface (AWS CLI) commands, make sure that you're running a recent version of the AWS CLI.

Example output:

"Volumes": \[  
    {  
        "AvailabilityZone": "us-west-2b",  
        "Attachments": \[  
            {  
                "AttachTime": "2016-07-21T23:44:52.000Z",  
                "InstanceId": "example-instance-ID",  
                "VolumeId": "example-volume-ID",  
                "State": "busy",  
                "DeleteOnTermination": false,  
                "Device": "/dev/sdf"  
            }  
        ...  
    }  
\]

2.      If your volume is stuck in the Busy state, then your volume detachment might be delayed. To resolve this issue, complete one or all the following steps:

  • Unmount the volume.
  • Reboot the instance.
  • Use the Force Detach option to force detach the volume.

Note: Use Force Detach as the last option to detach a volume from a failed instance or an instance that you intend to delete. Use this option only after you tried to unmount the volume and reboot the instance, and your volume is still stuck in the Busy state. Make sure to perform a file system check, and repair procedures.

AWS OFFICIAL
AWS OFFICIALUpdated 8 months ago