

# Expand storage and performance with Lightsail block storage disks
<a name="elastic-block-storage-and-ssd-disks-in-amazon-lightsail"></a>

System disks offer the consistent and low-latency performance you need to run your workloads. With Lightsail disks, you can scale your usage up or down within minutes—and pay a low price for only what you provision.

You can select up to an 80 GB system disk on your Linux/Unix-based or Windows Server-based instance. See [Get started with Linux-based instances in Lightsail](getting-started-with-amazon-lightsail.md) or [Get started with Windows Server-based instances](get-started-with-windows-based-instances-in-lightsail.md).

You can also add more storage to your virtual private server by creating additional block storage disks. See [Create and attach block storage disks to your Linux-based instance](create-and-attach-additional-block-storage-disks-linux-unix.md) or [Create and attach block storage disks to your Windows Server instance](create-and-attach-additional-block-storage-disks-windows.md).

## Block storage disks
<a name="block-storage-more-information"></a>

Block storage is a storage architecture that manages data as "blocks". Each storage block (known as a "disk" in Lightsail) acts like an individual hard disk that you can attach to your server. In general, you can use additional block storage for applications or software that must separate out specific data from their core service, and to protect application data in case of a failure or other issue with your instance and boot storage disk.

Lightsail offers solid-state drives (SSD) for block storage. This type of block storage balances a reasonable price and good performance. It's intended to support the vast majority of workloads that run on Lightsail. Lightsail additional block storage disks offer consistent performance and the low latency needed for applications or software that frequently access stored data.

**Note**  
For customers with applications that require sustained IOPS performance or high amounts of throughput per disk, or for customers running large databases like MongoDB, Cassandra, etc., we recommend using Amazon EC2 with GP2 or Provisioned IOPS SSD storage instead of Lightsail.

You can learn more about [Amazon EBS volumes](https://docs.aws.amazon.com/AWSEC2/latest/WindowsGuide/EBSVolumes.html) in the *Amazon EC2 User Guide*.

## Disk Quotas
<a name="block-disk-storage-limits"></a>
+ 20,000 GB per Region.
+ 16 TB per disk maximum, or 8 GB per disk minimum.
+ Each instance can have up to 15 attached disks, and 1 boot volume disk.

# Create and attach Lightsail block storage disks to Linux instances
<a name="create-and-attach-additional-block-storage-disks-linux-unix"></a>

You can create and attach additional block storage disks for your Amazon Lightsail instances. After you create additional disks, you need to connect to your Linux/Unix-based Lightsail instance and format and mount the disk.

This topic shows you how to create a new disk and attach it using Lightsail. It also describes how to connect to your Linux/Unix-based instance using SSH, so that you can format and mount your attached disk.

If you have a Windows Server-based instance, see the following topic instead: [Create and attach block storage disks to your Windows Server instance](create-and-attach-additional-block-storage-disks-windows.md).

## Step 1: Create a new disk and attach it to your instance
<a name="create-attach-new-disk-to-linux-unix-instance"></a>

1. In the left navigation pane, choose **Storage**.

1. Choose **Create disk**.

1. Choose the AWS Region and Availability Zone where your Lightsail instance is located.

1. Choose a size.

1. Enter a name for your disk.

   Resource names:
   + Must be unique within each AWS Region in your Lightsail account.
   + Must contain 2 to 255 characters.
   + Must start and end with an alphanumeric character or number.
   + Can include alphanumeric characters, numbers, periods, dashes, and underscores.

1. Choose one of the following options to add tags to your disk:
   + **Add key-only tags** or **Manage tags** (if tags have already been added). Enter your new tag into the tag key text box, and press **Enter**. Choose **Save** when you’re done entering your tags to add them, or choose **Cancel** to not add them.  
![\[Key-only tags in the Lightsail console.\]](http://docs.aws.amazon.com/lightsail/latest/userguide/images/amazon-lightsail-key-only-tags.png)
   + **Create a key-value tag**, then enter a key into the **Key** text box, and a value into the **Value** text box. Choose **Save** when you’re done entering your tags, or choose **Cancel** to not add them.

     Key-value tags can only be added one at a time before saving. To add more than one key-value tag, repeat the previous steps.  
![\[Key-value tags in the Lightsail console.\]](http://docs.aws.amazon.com/lightsail/latest/userguide/images/amazon-lightsail-key-value-tag.png)
**Note**  
For more information about key-only and key-value tags, see [Tags](amazon-lightsail-tags.md).

1. Choose **Create disk**.

   After a few seconds, your disk is created and you're on the new disk management page.

1. Choose your instance from the list, and then choose **Attach** to attach the new disk to your instance.

## Step 2: Connect to your instance to format and mount the disk
<a name="connect-to-linux-unix-instance-using-ssh-format-mount-disk"></a>

1. After you create and attach your disk, go back to the instance management page in Lightsail.

   The **Connect** tab is displayed by default.  
![\[The Connect tab of the instance management page\]](http://docs.aws.amazon.com/lightsail/latest/userguide/images/lightsail-instance-management-page-connect-tab.png)

1. Choose **Connect using SSH** to connect to your instance.

1. Enter the following command into the terminal window:

   ```
   lsblk
   ```

   The output of `lsblk` omits the `/dev/` prefix from disk paths.
**Note**  
On June 29, 2023 we updated the underlying hardware for Lightsail instances. In the following examples, device names for previous generation instances are displayed as `/dev/xvda`. Device names for instances created after this date are displayed as `/dev/nvme0n1`.

------
#### [ Current generation instances ]

   In the following example output, the root volume (`nvme0n1`) has two partitions (`nvme0n1p1` and `nvme0n1p128`), while the additional volume (`nvme1n1`) has no partitions.

   ```
   [ec2-user ~]$ sudo lsblk
   NAME          MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
   nvme1n1       259:0    0  30G  0 disk /data
   nvme0n1       259:1    0  16G  0 disk
   └─nvme0n1p1   259:2    0   8G  0 part /
   └─nvme0n1p128 259:3    0   1M  0 part
   ```

------
#### [ Previous generation instances ]

   In the following example output, the root volume (`xvda`) has a partition (`xvda1`), while the additional volume (`xvdf`) has no partition.

   ```
   [ec2-user ~]$ sudo lsblk                
   NAME    MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
   xvda    202:0    0  16G  0 disk
   └─xvda1 202:1    0   8G  0 part /
   xvdf    202:80   0  24G  0 disk
   ```

------

1. Determine whether to create a file system on the disk. New disks are raw block devices, and you must create a file system on them before you can mount and use them. Disks that have been restored from snapshots likely have a file system on them already. If you create a new file system on top of an existing file system, the operation overwrites your data.

   Use the following to determine if your disk has a file system or not. If your disk does not have a file system, continue to **Step 2.5**. If your disk does have a file system, skip to **Step 2.6**.

------
#### [ Current generation instances ]

   ```
   sudo file -s /dev/nvme1n1
   ```

   You should see the following output on a brand new disk.

   ```
   /dev/nvme1n1: data
   ```

   If you see output like the following, it means that your disk already has a file system.

   ```
   /dev/nvme1n1: SGI XFS filesystem data (blksz 4096, inosz 512, v2 dirs)
   ```

------
#### [ Previous generation instances ]

   ```
   sudo file -s /dev/xvdf
   ```

   You should see the following output on a brand new disk.

   ```
   /dev/xvdf: data
   ```

   If you see output like the following, it means that your disk already has a file system.

   ```
   /dev/xvda1: Linux rev 1.0 ext4 filesystem data, UUID=1701d228-e1bd-4094-a14c-12345EXAMPLE (needs journal recovery) (extents) (large files) (huge files)
   ```

------

1. Use the following command to create a new file system on the disk. Substitute the device name (such as `/dev/nvme1n1`) for *device\$1name*. Depending on the requirements of your application or the limitations of your operating system, you can choose a different file system type, such as `ext3` or `ext4`.
**Important**  
This step assumes that you're mounting an empty disk. If you're mounting a disk that already has data on it (for example, a disk that was restored from a snapshot), don't use `mkfs` before mounting the disk. Instead, skip to **Step 2.6** and create a mount point. Otherwise, you will format the disk and delete the existing data.

------
#### [ Current generation instances ]

   ```
   sudo mkfs -t xfs device_name
   ```

   You should see output like the following.

   ```
   meta-data=/dev/nvme1n1           isize=512    agcount=16, agsize=1048576 blks
            =                       sectsz=512   attr=2, projid32bit=1
            =                       crc=1        finobt=1, sparse=1, rmapbt=0
            =                       reflink=1    bigtime=1 inobtcount=1
   data     =                       bsize=4096   blocks=16777216, imaxpct=25
            =                       sunit=1      swidth=1 blks
   naming   =version 2              bsize=4096   ascii-ci=0, ftype=1
   log      =internal log           bsize=4096   blocks=16384, version=2
            =                       sectsz=512   sunit=1 blks, lazy-count=1
   realtime =none                   extsz=4096   blocks=0, rtextents=0
   ```

------
#### [ Previous generation instances ]

   ```
   sudo mkfs -t ext4 device_name
   ```

   You should see the following output like the following.

   ```
   mke2fs 1.42.9 (4-Feb-2014)
   Filesystem label=
   OS type: Linux
   Block size=4096 (log=2)
   Fragment size=4096 (log=2)
   Stride=0 blocks, Stripe width=0 blocks
   4194304 inodes, 16777216 blocks
   838860 blocks (5.00%) reserved for the super user
   First data block=0
   Maximum filesystem blocks=4294967296
   512 block groups
   32768 blocks per group, 32768 fragments per group
   8192 inodes per group
   Superblock backups stored on blocks:
   32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208,
   4096000, 7962624, 11239424
   
   Allocating group tables: done
   Writing inode tables: done
   Creating journal (32768 blocks): done
   Writing superblocks and filesystem accounting information: done
   ```

------

1. Use the following command to create a mount point directory for the disk. The mount point is where the disk is located in the file system tree and where you read files from and write files to after you mount the disk. Substitute a location for *mount\$1point*, for an unused space such as `/data`.

   ```
   sudo mkdir mount_point
   ```

1. You can verify that the disk now has a file system on it by entering the following command.

------
#### [ Current generation instances ]

   ```
   sudo file -s /dev/nvme1n1
   ```

   Instead of `/dev/nvme1n1: data`, you will see output similar to the following.

   ```
   /dev/nvme1n1: SGI XFS filesystem data (blksz 4096, inosz 512, v2 dirs)
   ```

------
#### [ Previous generation instances ]

   ```
   sudo file -s /dev/xvdf
   ```

   Instead of `/dev/xvdf: data`, you will see output similar to the following.

   ```
   /dev/xvdf: Linux rev 1.0 ext4 filesystem data, UUID=0ee83fdf-e370-442e-ae38-12345EXAMPLE (extents) (large files) (huge files)
   ```

------

1. Finally, mount the disk by entering the following command.

   ```
   sudo mount device_name mount_point
   ```

   Review the file permissions of your new disk mount to ensure that your users and applications can write to the disk. For more information about file permissions, see [Making an Amazon EBS Volume Available for Use](http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ebs-using-volumes.html) in the *Amazon EC2 User Guide*.

## Step 3: Mount the disk every time you reboot your instance
<a name="mount-disk-every-time-reboot-instance-linux-unix"></a>

You probably want to mount this disk every time you reboot your Lightsail instance. If you don't, this step is optional for you.

1. To mount this disk on every system reboot, add an entry for the device to the `/etc/fstab` file.

   Create a backup of your `/etc/fstab` file that you can use if you accidentally destroy or delete this file while you're editing it.

   ```
   sudo cp /etc/fstab /etc/fstab.orig
   ```

1. Open the `/etc/fstab` file using any text editor, such as vim.

   You must enter `sudo` before opening the file so that you can save changes.

1. Add a new line to the end of the file for your disk using the following format.

   ```
   device_name  mount_point  file_system_type  fs_mntops  fs_freq  fs_passno
   ```

   For example, your new line might look something like this.

------
#### [ Current generation instances ]

   ```
   /dev/nvme1n1 /data xfs defaults,nofail 0 2
   ```

------
#### [ Previous generation instances ]

   ```
   /dev/xvdf /data ext4 defaults,nofail 0 2
   ```

------

1. Save the file and exit your text editor.

# Create and attach Lightsail block storage disks to Windows Server instances
<a name="create-and-attach-additional-block-storage-disks-windows"></a>

If you need additional storage space, you can create and attach block storage disks to your Windows Server instance in Amazon Lightsail. For more information about block storage disks, see [Block storage disks](elastic-block-storage-and-ssd-disks-in-amazon-lightsail.md).

This guide shows you how to create a new block storage disk and attach it to your Windows Server instance using the Lightsail console. It also describes how to connect to your Windows Server instance using RDP so that you can bring the disk online and initialize it.

**Note**  
If you have a Linux or Unix instance, see [Create and attach disks to your Linux or Unix instance](create-and-attach-additional-block-storage-disks-linux-unix.md).

## Step 1: Create a new block storage disk and attach it to your instance
<a name="create-attach-new-disk-to-windows-server-instance"></a>

Create a new block storage disk and attach it to your instance using the Amazon Lightsail console.

**To create a new block storage disk and attach it to your instance**

1. Sign in to the [Lightsail console](https://lightsail.aws.amazon.com/).

1. Choose the **Storage** tab, then choose **Create disk**.

1. Choose the AWS Region and Availability Zone where your Lightsail instance is located.

1. Choose a disk size.

1. Enter a name for your storage disk.

   Resource names:
   + Must be unique within each AWS Region in your Lightsail account.
   + Must contain 2 to 255 characters.
   + Must start and end with an alphanumeric character or number.
   + Can include alphanumeric characters, numbers, periods, dashes, and underscores.

1. Choose one of the following options to add tags to your disk:
   + **Add key-only tags** or **Manage tags** (if tags have already been added). Enter your new tag into the tag key text box, and press **Enter**. Choose **Save** when you’re done entering your tags to add them, or choose **Cancel** to not add them.  
![\[Key-only tags in the Lightsail console.\]](http://docs.aws.amazon.com/lightsail/latest/userguide/images/amazon-lightsail-key-only-tags.png)
   + **Create a key-value tag**, then enter a key into the **Key** text box, and a value into the **Value** text box. Choose **Save** when you’re done entering your tags, or choose **Cancel** to not add them.

     Key-value tags can only be added one at a time before saving. To add more than one key-value tag, repeat the previous steps.  
![\[Key-value tags in the Lightsail console.\]](http://docs.aws.amazon.com/lightsail/latest/userguide/images/amazon-lightsail-key-value-tag.png)
**Note**  
For more information about key-only and key-value tags, see [Tags](amazon-lightsail-tags.md).

1. Choose **Create disk**.

   After a few seconds, the disk is created and you can view information about it on the disk management page.

1. Choose your instance from the list, and then choose **Attach** to attach the new disk to your instance.  
![\[Choosing your instance from the dropdown list and attaching the disk to the instance\]](http://docs.aws.amazon.com/lightsail/latest/userguide/images/animated-gif-attach-disk-to-windows-server-instance.gif)

   Continue to the [Step 2: Connect to your instance and bring the block storage disk online](#connect-to-windows-server-instance-using-rdp-format-mount-disk) section of this guide to bring the block storage disk online.

## Step 2: Connect to your instance and bring the block storage disk online
<a name="connect-to-windows-server-instance-using-rdp-format-mount-disk"></a>

Connect to your Windows Server instance and use the Disk Management utility to bring the recently attached block storage disk online.

**To connect to your instance and bring the block storage disk online**

1. Navigate to the [Lightsail console home page](https://lightsail.aws.amazon.com/).

1. Choose the name of the instance to which you attached the additional storage disk earlier in this guide.

1. Under the **Connect** tab, choose **Connect using RDP**.

1. On the Windows Start menu, search for **Computer Management**, and in the search results, choose **Computer Management**.  
![\[Create and format hard disks search in Windows\]](http://docs.aws.amazon.com/lightsail/latest/userguide/images/amazon-lightsail-computer-management-search.png)

1. In Computer Management, in the left pane, choose **Disk Management**.

1. In the bottom pane of the Disk Management utility, select the disk labeled as **Unknown / Offline**. This is the block storage disk that you attached to your instance earlier in this guide.  
![\[Unallocated disk attached to your Windows Server instance\]](http://docs.aws.amazon.com/lightsail/latest/userguide/images/lightsail-disk-management-windows-server-2016-unallocated.png)

1. With the disk selected, on the **Action** menu, choose **All Tasks**, and then choose **Online**.  
![\[Bring the block storage disk online using the Action menu\]](http://docs.aws.amazon.com/lightsail/latest/userguide/images/lightsail-windows-server-2016-disk-management-action-all-tasks-online.png)

   You should see the status of the block storage disk update to **Not Initialized**. The block storage disk is not yet online. Continue to the [Step 3: Initialize the block storage disk](#initialize-your-disk-windows-server-lightsail) section of this guide to initialize the block storage disk.

## Step 3: Initialize the block storage disk
<a name="initialize-your-disk-windows-server-lightsail"></a>

Initialize the block storage disk so that you can format it.

**Important**  
If you're mounting a disk that already has data on it, such as a disk that you created from a snapshot, be sure that you don't reformat the disk and delete the existing data.

**To initialize the block storage disk**

1. In the bottom pane of the Disk Management utility, select the disk labeled as **Unknown / Not initialized**.  
![\[Unallocated disk attached to your Windows Server instance\]](http://docs.aws.amazon.com/lightsail/latest/userguide/images/lightsail-disk-management-windows-server-2016-not-initialized.png)

1. With the disk selected, on the **Action** menu, choose **All Tasks**, and then choose **Initialize Disk**.  
![\[Initialize the block storage disk using the Action menu\]](http://docs.aws.amazon.com/lightsail/latest/userguide/images/lightsail-windows-server-2016-disk-management-action-all-tasks-initialize.png)

1. Choose the partition style for your new disk, and then choose **OK**.
**Note**  
For more information about partition styles, see the [About partition styles - GPT and MBR](https://docs.microsoft.com/en-us/windows-server/storage/disk-management/initialize-new-disks#about-partition-styles---gpt-and-mbr) article from Microsoft.

   You should see the status of the block storage disk update to **Online**. Continue to the [Step 4: Format the disk with a file system](#run-new-simple-volume-wizard-windows-server-lightsail) section of this guide to format your block storage disk with a file system.

## Step 4: Format the disk with a file system
<a name="run-new-simple-volume-wizard-windows-server-lightsail"></a>

Use the New Simple Volume wizard in Windows Server to assign a drive letter and format the disk with a file system.

**To format the disk with a file system**

1. In the bottom pane of the Disk Management utility, select the partition on the block storage disk labeled as **Unallocated**.  
![\[Unallocated disk attached to your Windows Server instance\]](http://docs.aws.amazon.com/lightsail/latest/userguide/images/lightsail-disk-management-windows-server-2016-unallocated-partition.png)

1. With the partition selected, on the **Action** menu, choose **All Tasks**, and then choose **New Simple Volume**.  
![\[Begin the New Simple Volume wizard using the Action menu\]](http://docs.aws.amazon.com/lightsail/latest/userguide/images/lightsail-windows-server-2016-disk-management-action-all-tasks-new-simple-volume.png)

1. Follow the instructions in the New Simple Volume wizard to choose an NTFS, FAT32, or ReFS file system type and format the disk.
**Note**  
For more information about each of these file systems, see the [NTFS overview](https://docs.microsoft.com/en-us/windows-server/storage/file-server/ntfs-overview), [Resilient File System (ReFS) overview](https://docs.microsoft.com/en-us/windows-server/storage/refs/refs-overview), and [Description of the FAT32 File System](https://support.microsoft.com/en-us/help/154997/description-of-the-fat32-file-system) articles from Microsoft.

   When complete, you see a drive letter and the following message in the Disk Management utility.  
![\[New Simple Volume wizard showing success in Windows Server 2016\]](http://docs.aws.amazon.com/lightsail/latest/userguide/images/windows-server-2016-new-volume-wizard-success.png)

# Detach and delete Lightsail block storage disks
<a name="detach-and-delete-block-storage-disks"></a>

If you no longer need a block storage disk, you can detach it from your stopped Amazon Lightsail instance, and then delete it. This topic describes how to back up your data and safely delete a disk.

## Prerequisites
<a name="delete-block-storage-disk-prerequisites"></a>
+ Stop your instance from running. You have to do this before you can detach and then delete your disk. [Learn how to stop your instance](lightsail-how-to-start-stop-or-restart-your-instance-virtual-private-server.md)
+ (Optional) We recommend that you create a snapshot of your disk. That way, you have a backup in case you change your mind. For more information, see [Create a snapshot of your database](create-block-storage-disk-snapshot.md)

## Detach and delete your disk
<a name="delete-block-storage-disk-detach-and-delete"></a>

Once you stop your Lightsail instance, you can safely detach and delete your disk.

1. On the home page, choose **Storage**.

1. Choose the name of your attached disk to manage it.  
![\[Example of a block storage disk that is still attached to a Lightsail instance\]](http://docs.aws.amazon.com/lightsail/latest/userguide/images/example-disk-still-attached-home-page-storage-tab.png)

   

1. On the disk management page, choose **Detach**.

   After a few seconds, the disk is detached and ready to be deleted or reattached.

1. Choose the **Delete** tab.

1. Choose **Delete disk**, and then confirm by choosing **Yes, delete**.
**Important**  
This is a permanent operation and can't be undone. You will lose all data on the disk when you delete it.