Amazon Elastic Compute Cloud
User Guide for Linux Instances

Detaching an Amazon EBS Volume from an Instance

You can detach an Amazon EBS volume from an instance explicitly or by terminating the instance. However, if the instance is running, you must first unmount the volume from the instance; otherwise, the volume could become stuck in the busy state while it is trying to detach. Forced detachment of a stuck volume can cause the following problems:

  • Damage to the file system or the data it contains

  • Inability to attach a new volume using the same device name, unless you reboot the instance

If an EBS volume is the root device of an instance, you must stop the instance before you can detach the volume.

When a volume with an AWS Marketplace product code is detached from an instance, the product code is no longer associated with the instance.


After you detach a volume, you are still charged for volume storage as long as the storage amount exceeds the limit of the Free Usage Tier. You must delete a volume to avoid incurring further charges. For more information, see Deleting an Amazon EBS Volume.

This example unmounts the volume and then explicitly detaches it from the instance. This is useful when you want to terminate an instance or attach a volume to a different instance. To verify that the volume is no longer attached to the instance, see Viewing Volume Information.

Note that you can reattach a volume that you detached (without unmounting it), but it might not get the same mount point and the data on the volume might be out of sync if there were writes to the volume in progress when it was detached.

To detach an EBS volume using the console

  1. First, use the following command to unmount the /dev/sdh device.

    [ec2-user ~]$ umount -d /dev/sdh
  2. Open the Amazon EC2 console.

  3. Click Volumes in the navigation pane.

  4. Select a volume and then click Detach Volume.

  5. In the confirmation dialog box, click Yes, Detach.

To detach an EBS volume from an instance using the command line

You can use one of the following commands. For more information about these command line interfaces, see Accessing Amazon EC2.


If your volume stays in the detaching state, you can force the detachment by clicking Force Detach. Forcing the detachment can lead to data loss or a corrupted file system. Use this option only as a last resort to detach a volume from a failed instance, or if you are detaching a volume with the intention of deleting it. The instance doesn't get an opportunity to flush file system caches or file system metadata. If you use this option, you must perform file system check and repair procedures.

If you've tried to force the volume to detach multiple times over several minutes and it stays in the detaching state, you can post a request for help to the Amazon EC2 forum. To help expedite a resolution, include the volume ID and describe the steps that you've already taken.