Last updated on: 2018-12-06
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:
In all cases, you must unmount the volume before you detach it. This article provides instructions for unmounting, detaching, and deleting a volume.
Before you detach a volume from a server, unmount it to prevent errors.
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.
Log in to the Cloud Control Panel.
In the Cloud Control Panel, confirm how the volume is presented to the cloud server.
On your server, use the df -h
command to see how the volume is mounted.
Use the value under Mounted on
in the unmount
command.
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/
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.
Log in to the Cloud Control Panel.
In the Cloud Control Panel, confirm how the volume is presented to the cloud server.
In the Server Manager, select File and Storage Services > Disks.
In the Disks section, right-click the Cloud Block Storage volume and select Take Offline.
If the Take Disk Offline warning window appears, click Yes.
The Cloud Block Storage volume no longer displays as a drive under Computer.
Use the following steps to detach a volume:
Log in to the Cloud Control Panel.
In the top navigation bar, click Select a Product > Rackspace Cloud.
Select Storage > Block Storage Volumes.
On the Block Storage Volumes page, click the gear icon next to the volume name and select Detach Volume.
In the pop-up dialog box, click Detach Volume.
Note: It might take several minutes for the volume to detach.
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.
In the top navigation bar of the Cloud Control Panel, click Storage > Block Storage Volumes.
On the Block Storage Volumes page, click the gear icon next to the volume name and select Delete Volume.
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.
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 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.
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.
©2020 Rackspace US, Inc.
Except where otherwise noted, content on this site is licensed under a Creative Commons Attribution-NonCommercial-NoDerivs 3.0 Unported License