Detach and delete Cloud Block Storage volumes

  • Last updated on: 2017-01-27
  • Authored by: David Hendler

Previous section: Create and use Cloud Block Storage snapshots

Detaching a Cloud Block Storage volume is useful or necessary when you want to perform the following tasks:

  • Prevents writes to the volume when you want to take a snapshot.
  • Take the volume offline for archival purposes.
  • Move the volume to another server.
  • Resize the server to which the volume is mounted
  • Delete the volume.

In all cases, you must unmount the volume before you detach it. This article provides instructions for unmounting, detaching, and deleting a volume.

Unmount a volume

Before you detach a volume from a server, unmount it to prevent errors.

Unmount a volume from a Linux server

Note: You cannot unmount and detach the operating system disk. For more information, see the “Detach an operating system disk that uses the boot-from-volume functionality” section at the end of this article.

  1. Log in to the Cloud Control Panel.

  2. In the Cloud Control Panel, confirm how the volume is presented to the cloud server.

  3. On your server, use the df -h command to see how the volume is mounted.

  4. Use the value under Mounted on in the unmount command.

  5. Comment out the second line (highlighted in the screenshot) in the /etc/fstab file to prevent the volume from trying to mount on the next boot.

     # umount /dev/xvdb1/
    

Unmount a volume from a Windows server

Note: You cannot unmount and detach the operating system disk (C:). For more information, see the “Detach an operating system disk that uses the boot-from-volume functionality” section at the end of this article.

  1. Log in to the Cloud Control Panel.

  2. In the Cloud Control Panel, confirm how the volume is presented to the cloud server.

  3. In the Server Manager, select File and Storage Services > Disks.

  4. In the Disks section, right-click the Cloud Block Storage volume and select Take Offline.

  5. If the Take Disk Offline warning window appears, click Yes.

The Cloud Block Storage volume no longer displays as a drive under Computer.

Detach a volume

  1. Log in to the Cloud Control Panel.

  2. In the top navigation bar, click Storage > Block Storage Volumes.

  3. On the Block Storage Volumes page, click the gear icon next to the volume name and select Detach Volume.

  4. In the pop-up dialog box, click Detach Volume.

Note: It might take several minutes for the volume to detach.

Delete a volume

Before you can delete an attached volume, you must detach it from the server. If a snapshot of the volume exists, you must delete the snapshot before you can delete the volume.

  1. In the top navigation bar of the Cloud Control Panel, click Storage > Block Storage Volumes.

  2. On the Block Storage Volumes page, click the gear icon next to the volume name and select Delete Volume.

Detach an operating system disk that uses the boot-from-volume functionality

A bootable Cloud Block Storage volume enables cloud servers to boot the operating system (Windows or Linux) from a volume instead of local storage. As a result, detaching a volume that runs the operating system works differently than detaching a volume that is used as additional storage.

  1. Ensure that the delete-on-termination flag is set to False to preserve the volume when you delete the cloud server.

    Note: The Cloud Control Panel generally sets this flag to False by default. If you are unsure whether your volume is properly flagged, contact Support. For more detailed information, see the delete-on-termination flag in the examples in this section of the API documentation.

  2. Delete the server.

After the server is deleted, the volume is in a detached state and is ready to be attached to another cloud server as an additional volume or to be used with a new cloud server.

Continue the conversation in the Rackspace Community.