Guides - Block Storage Volumes

The Linode CLI is a wrapper around the Linode API that allows you to manage your Linode account from the command line. Virtually any task that can be done through the Linode Manager can be done through the CLI, making it an excellent tool for scripting.

Create a Linode account to try this guide with a $100 credit.
This credit will be applied to any valid services used during your first 60 days.
  1. List your current Volumes:

    linode-cli volumes list
    
  2. Create a new Volume, with the size specified in GB:

    linode-cli volumes create --label my-volume --size 100 --region us-east
    

    Specify a linode_id to create the Volume and automatically attach it to a specific Linode:

    linode-cli volumes create --label my-volume --size 100  --linode_id $linode_id
    
  3. Attach or detach the Volume from a Linode:

    linode-cli volumes attach $volume_id --linode_id $linode_id
    linode-cli volumes detach $volume_id
    
  4. Resize a Volume (size can only be increased):

    linode-cli volumes resize $volume_id --size 200
    
  5. Delete a Volume:

    linode-cli volumes delete $volume_id
    

This page was originally published on


Your Feedback Is Important

Let us know if this guide made it easy to get the answer you needed.