---
updatedAt: 2026-09-24T07:52:16.000Z
agentTools:
  siteIndex: https://techdocs.akamai.com/llms.txt
  projectIndex: https://techdocs.akamai.com/cloud-computing/llms.txt
---

# Manage Block Storage volumes with the Linode API

The Linode API lets you create, delete, attach, detach, clone, and resize Block Storage volumes, as well as see your volume quotas.

For detailed reference documentation for all volume operations, see [Linode API v4](https://techdocs.akamai.com/linode-api/reference/post-volume).

# Before you begin

You need a Personal Access Token for the Linode API to complete the steps in this guide. See [Manage personal access tokens](https://techdocs.akamai.com/cloud-computing/docs/manage-personal-access-tokens#create-an-api-token) for more information.

Store the token as a temporary shell variable to simplify repeated requests. Replace `<Access Token>` in this example with your token:

```
export TOKEN=<token-string>
```

# Create a Block Storage volume

Create a new Block Storage volume by making a POST request to the `/volumes` endpoint. You can also automatically attach the new volume to an existing Linode by passing the Linode's ID when creating the volume.

1. List the Linodes on your account:

   ```
   curl -H "Authorization: Bearer $token" \
       https://api.linode.com/v4/linode/instances
   ```

   Choose a Linode from the returned list and copy its `id` and `region` values.

2. Create a volume in the same region as the target Linode. Use the ID of the target Linode and adjust the size (in GB), region, set encryption to `enabled` or `disabled`, and label to the desired values:

   ```
   curl -H "Content-Type: application/json" \
       -H "Authorization: Bearer $token" \
       -X POST -d '{
         "label": "my-volume",
         "region": "us-east",
         "size": 100,
         "linode_id": 1234567,
         "encryption": enabled

       }' \
       https://api.linode.com/v4/volumes
   ```

   > 📘
   >
   > * The volume and Linode must be in the same region.
   > * The label can be up to 32 characters long and can contain uppercase and lowercase letters, numbers, hyphens, and underscores.

3. Examine the response JSON object and copy the values in the `id` and `filesystem_path` fields:

   ```json
   {
     "linode_id":1234567,
     "label":"my-volume",
     "size":100,
     "updated":"2018-05-07T14:59:48",
     "created":"2018-05-07T14:59:48",
     "encryption": "enabled",
     "id":6830,
     "status":"creating",
     "region":"us-east",
     "filesystem_path":"/dev/disk/by-id/scsi-0Linode_Volume_my-volume"
   }
   ```

4. Query the volume using the `/volumes/$volume_id` endpoint to make sure it was successfully created:

   ```
   curl -H "Authorization: Bearer $token" \
       https://api.linode.com/v4/volumes/$volume_id
   ```

   If the `status` field in the response is `active`, your volume is ready to use.

## Mount the volume

The API can't directly mount the new volume after it is attached. SSH into the Linode and mount it manually:

1. Create a filesystem on the volume:

   ```
   mkfs.ext4 $volume_path
   ```

2. Create a mountpoint:

   ```
   mkdir /mnt/my-volume
   ```

3. Mount the volume:

   ```
   mount $volume_path /mnt/my-volume
   ```

4. To automatically mount the volume every time your Linode boots, add the following line to your `/etc/fstab` file:

   ```text /etc/fstab
   $volume_path /mnt/my-volume defaults 0 2
   ```

# Attach and detach the volume

If you did not specify a Linode when creating the volume, or would like to attach it to a different Linode, use the `/attach` and `/detach` endpoints:

1. Detach the volume. Replace `$volume_id` with the volume ID from the previous section:

   ```
   curl -H "Authorization: Bearer $token" \
       -X POST \
       https://api.linode.com/v4/volumes/$volume_id/detach
   ```

2. Attach the volume to the new target Linode:

   ```
   curl -H "Authorization: Bearer $token" \
       -H "Content-Type: application/json" \
       -X POST -d \
       '{ "linode_id": $linode-id }' \
       https://api.linode.com/v4/volumes/$volume_id/attach
   ```

   > 📘
   >
   > If a Linode is not running and has more than one configuration profile, include a `config_id` parameter in the POST request to specify which profile to use. If you do not specify a profile, the first profile will be used by default.

# Clone a volume

To copy all of the data in a Block Storage volume to a new volume:

```
curl -H "Authorization: Bearer $token" \
    -X POST -d '{
      "label": "new-volume"
    }' \
    https://api.linode.com/v4/volumes/$volume_id/clone
```

# Delete a volume

Remove a volume from your account with a DELETE request. If the volume is attached to a Linode, you will have to detach it before it can be deleted:

```
curl -H "Authorization: Bearer $token" \
    -X DELETE \
    https://api.linode.com/v4/volumes/$volume_id
```

# Resize a volume

If you need additional space, you can increase the size of a volume through the API. It is not possible to reduce the size of a volume.

Pass the desired size (in gigabytes) using the `size` parameter:

```
curl -H "Content-Type: application/json" \
    -H "Authorization: Bearer $token" \
    -X POST -d '{
        "size": 200
    }' \
    https://api.linode.com/v4/volumes/$volume_id/resize
```

> 📘
>
> After resizing the volume, you also need to resize the file system to accommodate the additional space. For instructions, see the last few steps on the [Resize a volume](https://techdocs.akamai.com/cloud-computing/docs/resize-a-volume) guide.

# List volume quotas

To see the active [Block Storage volume quotas ](https://techdocs.akamai.com/cloud-computing/docs/block-storage-quotas)applied to your account, run the [List volume quotas](https://techdocs.akamai.com/linode-api/reference/get-volume-quotas) operation:

```curl
curl --request GET \
     --url https://api.linode.com/v4/volumes/quotas \
     --header 'accept: application/json' \
     --header "authorization: Bearer $TOKEN" 
```

Then, run the [Get volume quota usage data](https://techdocs.akamai.com/linode-api/reference/get-volume-quota-usage) operation targeting the `{quotaId}` obtained from the previous operation to check your current usage for a given quota:

```curl
curl --request GET \
     --url https://api.linode.com/v4/volumes/quotas/{quotaId}/usage \
     --header 'accept: application/json' \
     --header "authorization: Bearer $TOKEN" 
```

# Sibling pages

* [Get started with Block Storage](https://techdocs.akamai.com/cloud-computing/docs/getting-started-with-block-storage.md)
* [Block Storage quotas](https://techdocs.akamai.com/cloud-computing/docs/block-storage-quotas.md)
* [View, create, and delete Block Storage volumes](https://techdocs.akamai.com/cloud-computing/docs/manage-block-storage-volumes.md)
* [Volume Encryption](https://techdocs.akamai.com/cloud-computing/docs/volumes-disk-encryption.md)
* [Attach and detach a volume](https://techdocs.akamai.com/cloud-computing/docs/attach-and-detach-a-volume.md)
* [Resize a volume](https://techdocs.akamai.com/cloud-computing/docs/resize-a-volume.md)
* [Configure and mount a volume](https://techdocs.akamai.com/cloud-computing/docs/configure-and-mount-a-volume.md)
* [Boot from a Block Storage volume](https://techdocs.akamai.com/cloud-computing/docs/boot-from-a-block-storage-volume.md)
* [Transfer Block Storage data between data centers](https://techdocs.akamai.com/cloud-computing/docs/transfer-block-storage-data-between-data-centers.md)
* [Transfer a volume to a different Linode](https://techdocs.akamai.com/cloud-computing/docs/transfer-a-volume-to-a-different-compute-instance.md)
* [Common Block Storage use cases](https://techdocs.akamai.com/cloud-computing/docs/common-use-cases-for-block-storage.md)