Create a Linode account to try this guide with a $ credit.
This credit will be applied to any valid services used during your first  days.

Each Volume can to be attached to a single Compute Instance within the same data center, which enables that instance to read and write data to that Volume. Volumes can also be detached, and its data cannot be accessed until it is again attached to any Compute Instance within the same data center.

Attach a Volume

Learn how to attach an existing Block Storage Volume to a Compute Instance using these steps:

  1. Log in to the Cloud Manager and click on the Volumes link in the sidebar.

  2. Locate the desired Volume within the list, click the more options ellipsis dropdown menu, and select Attach.

  3. Complete the Attach Volume form that appears.

    • Linode: Use the dropdown menu to select the Compute Instance you’d like to use. The Volume will be attached to this instance.
    • Config: If the Compute Instance has multiple Configuration Profiles, select which one the Block Storage Volume should be assigned to. This field will not be displayed if the instance has only a single profile.
    Note
    The Compute Instance must be located within the same data center as the Block Storage Volume.
    Note
    If your Compute Instance was deployed prior to August 24th, 2021 and hasn’t been rebooted since your data center was upgraded to NVMe Block Storage, you may need to reboot the instance for it to properly work with a Block Storage Volume.
  4. Click the Save button to attach the Volume.

  5. To start using the Volume on the Compute Instance, additional internal configuration is required. This includes creating the file system (if the Volume hasn’t been used before), mounting the Volume, and configuring your instance to automatically mount the Volume at boot. To learn more about these configuration steps, see Configuring and Mounting a Volume.

    Important
    Do not create a new file system if you wish to retain any existing data on the Volume. Creating a new file system will overwrite any existing data and result in data loss.

Detach a Volume

Follow these steps to safely detach a Block Storage Volume from a Compute Instance. A Volume should be detached before it is reattached to a different instance.

  1. Log in to the Cloud Manager and click on the Linodes link in the sidebar.

  2. Select the Compute Instance that the Volume is currently attached to.

  3. It’s recommended to power off the instance. To do this, click Power Off on the top right of the Compute Instance details page.

  4. If a Volume is currently mounted, detaching it while the instance is powered on could cause data loss or an unexpected reboot. You can unmount the Volume for safe live-detaching by logging in to the Compute Instance over SSH or Lish and running the umount command, such as in the example below.

    umount /dev/disk/by-id/scsi-0Linode_Volume_example-volume-1
    

    Replace the device path with the one for your own Volume (which can be viewed from the Show Config link). To avoid additional issues with your Compute Instance, remove the detached volume’s line from your /etc/fstab/ configuration.

    FILE_SYSTEM_PATH /mnt/example-volume-1 ext4 defaults 0 2
    
  5. Navigate to the Storage tab.

  6. Locate the Volume you wish to detach within the Volumes list, click the more options ellipsis dropdown menu, and select Detach.

  7. A confirmation screen appears and explains that the Volume will be detached from the Compute Instance. Click Detach to confirm.

Detached Volumes still exist on your account and, as such, you are still billed for the Volume as normal. It can be viewed and deleted within the Volumes listing page in the Cloud Manager. See View, Add, and Delete Volumes.

This page was originally published on


Your Feedback Is Important

Let us know if this guide was helpful to you.