How to Use Block Storage with Your Linode
Updated , by Linode
Traducciones al EspañolEstamos traduciendo nuestros guías y tutoriales al Español. Es posible que usted esté viendo una traducción generada automáticamente. Estamos trabajando con traductores profesionales para verificar las traducciones de nuestro sitio web. Este proyecto es un trabajo en curso.
Linode’s Block Storage service allows you to attach additional storage Volumes to your Linode. A single Volume can range from 10 GiB to 10,000 GiB in size and costs $0.10/GiB per month. They can be partitioned however you like and can accommodate any filesystem type you choose.
You can attach up to eight Volumes per Linode. Both your Linode plan’s standard disks and Block Storage Volumes count towards this total, including swap devices. The volumes can be newly created or already existing, so you do not need to recreate your server to add a Block Storage Volume.
The Block Storage service is currently available in the Dallas, Fremont, Frankfurt, London, Newark, Tokyo, Toronto, Mumbai, Singapore, and Sydney data centers.
Caution
Linode’s backup services do not cover Block Storage Volumes. You must execute your own backups for this data.
Your Linode must be running in Paravirtualization mode. Block storage currently does not support Full-virtualization.
How to Add a Block Storage Volume to a Linode
This guide assumes a Linode with the root disk mounted as /dev/sda
and swap space mounted as /dev/sdb
. In this scenario, the Block Storage Volume will be available to the operating system as /dev/disk/by-id/scsi-0Linode_Volume_EXAMPLE
, where EXAMPLE
is a label you assign the Volume in the Linode Cloud Manager. Storage Volumes can be added when your Linode is already running, and will show immediately in /dev/disk/by-id/
.
NoteA Linode can have multiple Block Storage Volumes attached to it. However, a Block Storage Volume can only be attached to one Linode at a time.
Add a Volume from the Linode Detail Page
Follow these steps to create a new Block Storage Volume, attach it to your Linode, create a filesystem, and mount your Volume:
Click on the Linodes link in the sidebar.
Select the Linode to which you want to attach a Block Storage Volume. The detail page for the Linode will appear.
Click on the Volumes tab, then click Add a Volume:
Assign the Block Storage Volume a label and size. The label can be up to 32 characters long and consist only of ASCII characters
a-z; 0-9.-_
. The maximum Volume size is 10,000 GiB. When finished, click Submit:Note
There is currently a soft limit of 100 TB of Block Storage Volume per account.Once you add a Volume it will appear under Attached Volumes with the new Volume’s label, size, and file system path.
You’ll need to create a filesystem in your new Volume. If your Linode is not already running, boot then SSH into your Linode and execute the following command, where
FILE_SYSTEM_PATH
is your Volume’s file system path:mkfs.ext4 FILE_SYSTEM_PATH
Caution
If a new filesystem is created on a Block Storage Volume that is already using a filesystem, the above command will result in data loss. You can safely check for the filesystem of an unmounted volume with the following command:
blkid FILE_SYSTEM_PATH
If you do not receive output, there is currently no filesystem on this volume.
Once the Volume has a filesystem, you can create a mountpoint for it:
mkdir /mnt/BlockStorage1
You can then mount the new Volume:
mount FILE_SYSTEM_PATH /mnt/BlockStorage1
If you want to mount the new Volume automatically every time your Linode boots, you’ll want to add the following line to your /etc/fstab file:
FILE_SYSTEM_PATH /mnt/BlockStorage1 ext4 defaults 0 2
Note
If you plan on detaching the volume regularly or moving it between other Linodes, you may want to consider adding the flags
noatime
andnofail
to the /etc/fstab entry.noatime
- This will save space and time by preventing writes made to the filesystem for data being read on the volume.nofail
- If the volume is not attached, this will allow your server to boot/reboot normally without hanging at dependency failures if the volume is not attached.
Example:
FILE_SYSTEM_PATH /mnt/BlockStorage1 ext4 defaults,noatime,nofail 0 2
Attach a Volume from Your Account’s Volume List
Follow these steps to attach a Block Storage Volume that was previously created in the Cloud Manager or through the Linode API.
Click on the Volumes link in the sidebar to see your account’s Volume list:
Click the more options ellipsis to open the menu for the Volume you want to attach to a Linode and select Attach:
Select the label of the Linode you want to attach the Volume to from the dropdown menu, then click Save:
Note
The Linodes available in this dropdown menu all share the same region as your Volume.You’ll need to create a filesystem in your new Volume if it does not already have one. If you have created a filesystem previously for this volume on any Linode, you should skip this step. If your Volume does not have a filesystem and it is not already running, boot then SSH into your Linode and execute the following command, where
FILE_SYSTEM_PATH
is your Volume’s file system path:mkfs.ext4 FILE_SYSTEM_PATH
Caution
If a new filesystem is created on a Block Storage Volume that is already using a filesystem, the above command will result in data loss. You can safely check for the filesystem of an unmounted volume with the following command:
blkid FILE_SYSTEM_PATH
If you do not receive output, there is currently no filesystem on this volume.
Provided the Volume has a filesystem, you can create a mountpoint for it:
mkdir /mnt/BlockStorage1
You can then mount the new Volume, where
FILE_SYSTEM_PATH
is your Volume’s file system path:mount FILE_SYSTEM_PATH /mnt/BlockStorage1
If you want to mount the new Volume automatically every time your Linode boots, you’ll want to add the following line to your /etc/fstab file:
FILE_SYSTEM_PATH /mnt/BlockStorage1
How to Detach a Block Storage Volume from a Linode
Follow these steps to safely detach a Block Storage Volume from a Linode. A Volume should be detached before it is reattached to a different Linode:
Go to the detail page page of the Linode which the Volume is attached to. Shut down the Linode.
When the Linode is powered off, click on the Volumes tab, click the more options ellipsis next to the Volume you would like to detach, then click Detach.
A confirmation screen appears and explains that the Volume will be detached from the Linode. Click Detach to confirm:
The Linode’s dashboard does not show the Volume present anymore:
The Volume still exists on your account and you can see it if you view the Volumes page:
CautionIf a volume is currently mounted, detaching it while the Linode is powered on could cause data loss or an unexpected reboot. You can unmount the volume for safe live-detaching using the
umount
command:umount /dev/disk/by-id/scsi-0Linode_Volume_BlockStorage1
To avoid additional issues with your Linode, remove the detached volume’s line from your
/etc/fstab/
configuration:
FILE_SYSTEM_PATH /mnt/BlockStorage1 ext4 defaults 0 2
How to Delete a Block Storage Volume
Follow these steps to delete a Block Storage Volume from the Cloud Manager:
CautionThe removal process is irreversible, and the data will be permanently deleted.
Shut down the attached Linode.
On the Volumes page, click the more options ellipsis next to the Volume you would like to delete.
Click Delete.
How to Resize a Block Storage Volume
Follow these steps to increase the size of a Block Storage Volume after it has been created:
NoteStorage Volumes cannot be sized down, only up. Keep this in mind when sizing your Volumes.
Shut down your Linode.
Click the more options ellipsis next to the Volume you would like to resize to bring up the Volume’s menu.
Click Resize.
Enter the new Volume size. The minimum size is 10 GiB and maximum is 10,000 GiB. Then click Submit.
You’ll be returned to the Volume list and the notification bell in the top right of the page will notify you when the resizing is complete.
Reboot your Linode.
Once your Linode has restarted, make sure the Volume is unmounted for safety:
umount /dev/disk/by-id/scsi-0Linode_Volume_BlockStorage1
Assuming you have an ext2, ext3, or ext4 partition,first run a file system check:
e2fsck -f /dev/disk/by-id/scsi-0Linode_Volume_BlockStorage1
Then resize it to fill the new Volume size:
resize2fs /dev/disk/by-id/scsi-0Linode_Volume_BlockStorage1
Mount your volume back onto the filesystem:
mount /dev/disk/by-id/scsi-0Linode_Volume_BlockStorage1 /mnt/BlockStorage1
How to Transfer a Volume to a New Linode
Follow these steps to safely detach a Volume from a Linode and attach it to a different Linode in the same data center:
NoteVolumes cannot be attached to Linodes that are in a different data center. See the Transfer Block Storage Data between Data Centers how-to for help with migrating data on a Volume to a different data center.
Click the more options ellipsis to open the menu for the Volume you want to attach to a Linode and select Attach:

Since the Volume already has a filesystem on it, create a mountpoint for the new Linode, provided it hasn’t already been created:
mkdir /mnt/BlockStorage1
Mount the new Volume, where FILE_SYSTEM_PATH is your Volume’s file system path:
mount FILE_SYSTEM_PATH /mnt/BlockStorage1
If you want to mount the new Volume automatically every time your Linode boots, you’ll want to add the following line to your /etc/fstab file:
FILE_SYSTEM_PATH /mnt/BlockStorage1 ext4 defaults 0 2
How to Transfer Block Storage Data Between Data Centers
Block Storage Volumes cannot be directly migrated to a different data center. These steps will outline how to transfer a Volume’s data to a different data center via the SCP tool.
NoteConsult our Network Transfer Quota guide for information on charges related to outbound traffic when downloading Linode data outside of Linode’s private network.
Attach and mount your Block Storage Volume to a Linode, if you have not already.
Use the Secure Copy Protocol (SCP) to download your Volume’s data to the receiving computer or Linode.
Note
You will need a device that has enough storage capacity to receive the entirety of your Block Storage Volume’s data.Once your Block Storage Volume’s data has been copied, create a new Block Storage Volume in the desired data center and attach it to a Linode.
Use SCP to upload the data from the receiving computer or Linode to the new Block Storage Volume. The new Block Storage Volume must be attached and mounted to a Linode.
Where to Go From Here?
Need ideas for what to do with space? We have several guides which walk you through installing software that would make a great pairing with large storage Volumes:
This page was originally published on