Create a disk

Add a new disk to an existing Linode. You can create an empty disk to manually configure it later. You can also target a stored image to build the disk using a pre-configured file system--either through an image you've created or via a StackScript. Consider these points when creating a new disk:

General

  • A Linode can have up to 50 disks.

  • You need to provide at least one authentication mechanism for disk access: a root_pass, authorized_keys, or authorized_users, with the latter two offering SSH protection.

Empty disks

  • To do this, don't include the image, filesystem, stackscript_id, or stackscript_data fields.

  • An empty disk still requires a label.

  • The default file system for an empty disk is ext4.

Disks created from an image

  • A created disk inherits both the label and the filesystem from the target image, unless you specify otherwise.

  • We offer an example workflow to create a disk using a stored image.

Disks created from a StackScript

  • You can run List StackScripts to review available StackScripts.

  • You need to include a StackScript-compatible image when creating the disk. Run Get a StackScript to review available images.

Permissions and scopes

To call this operation, you need the following:

  • Identity and access permissions. Your user needs a role with these permissions assigned. Learn more.

    • Permissions: create_linode_disk
  • OAuth scopes. Your user needs these scopes assigned. Learn more.

    • Scopes: linodes:read_write

CLI

linode-cli linodes disk-create 123 \
  --size 1300 \
  --authorized_keys "ssh-rsa AAAA_valid_public_ssh_key_123456785== user@their-computer" \
  --authorized_users "myUser" \
  --authorized_users "secondaryUser" \
  --root_pass aComplex@Password \
  --image "linode/debian13" \
  --stackscript_id 10079 \
  --stackscript_data '{"gh_username": "linode"}'

Learn more

Path Params
string
enum
required

Enum Call either the v4 URL, or v4beta for operations still in Beta.

Allowed:
integer
required

ID of the Linode to look up.

Body Params

Disk object request.

authorized_keys
array of strings

Write-only A list of public SSH keys that will be automatically appended to the root user's ~/.ssh/authorized_keys file when deploying from an image.

📘

You need to set at least one form of authentication to access a Linode disk. This can be authorized_keys, authorized_users, or a root_pass. You can optionally combine authorized_keys with a root_pass for added security.

authorized_keys
authorized_users
array of strings

Write-only A list of usernames for authorized users. Before you can add a user, it needs an SSH key assigned to its profile. See Add an SSH key for more information. If the usernames already have associated SSH keys, the keys will be appended to the root users ~/.ssh/authorized_keys file automatically when deploying from an image.

📘

You need to set at least one form of authentication to access a Linode disk. This can be authorized_users, authorized_keys or a root_pass. You can optionally combine authorized_users with a root_pass for added security.

authorized_users
string
enum

The disk's format or file system. A value of raw indicates no file system, just a raw binary stream. A value of swap indicates a Linux swap area. The values ext3 or ext4 represent these Linux journaling file systems. The value ext2 is the deprecated ext2 Linux file system. Finally, initrd indicates the disk is formatted as an uncompressed initial RAM disk.

📘

The ext2 file system doesn't properly support timestamps and will be removed from Linux support in the near future. Also, initrd is a legacy format that no longer applies to most use cases. As a best practice, use the other supported formats or file systems instead.

Allowed:
string | null

The identifier assigned to the disk image to be deployed to the new Linode. You can run the List images operation with authentication to view all available images, and store the id from the applicable one. Official Linode images start with linode/, while any custom images available on your account start with private/. To create a disk from a private/ image, you need read_only or read_write permissions for it. Run the Update a user's grants operation to adjust permissions for a private/ image, or talk to your local account administrator.

string
length between 1 and 48

Filterable The name of the disk. This is for display purposes only.

password
length between 7 and 128

Write-only This sets the root user's password on a newly created Linode disk when deploying from an image. A root_pass needs to meet a password strength score requirement that is calculated internally by the API. If the strength requirement isn't met, you'll receive a Password does not meet strength requirement error.

📘

You need to set at least one form of authentication to access a Linode disk. This can be a root_pass, authorized_keys, or authorized_users. You can optionally combine a root_pass and either authorized_keys or authorized_users for added security.

integer
required

Filterable The size of the disk in MB. Images require a minimum size. Run the Get an image operation to view its size.

stackscript_data
object

This field is required only if the StackScript being deployed requires input data from the user for successful completion. See Declare user-defined fields (UDFs) for more details.

  • This field needs to be formatted in valid JSON.

  • The total length can't exceed 65,535 characters.

integer

An identifier for a StackScript that to be run during deployment of this Linode. A compatible image is required to use a StackScript. To get a list of available StackScripts and their permitted images, run the List StackScripts operation. This field can't be used when deploying from a backup or a private image.

Responses

Language
Credentials
LoadingLoading…
Response
Choose an example:
application/json