View AWS CloudShell persistent storage consumption

3 minute read
Content level: Foundational
0

Quickly examine the amount of persistent storage thats available for an AWS CloudShell session

With AWS CloudShell, you have persistent storage of 1 GB for each AWS Region at no cost. Persistent storage is located in your home directory ($HOME) and is private to you. Unlike ephemeral environment resources that are recycled after each shell session ends, data in your home directory persists between sessions.

There are times when you need to examine how much of this persistent storage is being consumed as you work with CloudShell or you might run into no space errors. This brief articles provides you the steps that you can take to review the storage usage.

To find out how much storage is left in your AWS CloudShell environment, you can use standard Linux commands to check the disk usage of your home directory. AWS CloudShell provides 1 GB of persistent storage in the $HOME directory per region, and this storage is where all your files are saved.

Here’s how you can check the storage usage and remaining space:

Steps to Check Storage in AWS CloudShell

  1. Launch AWS CloudShell: Open the AWS Management Console. Click on the CloudShell icon in the toolbar or search for "CloudShell" in the search bar.

  2. Use Disk Usage Commands: Run the following command to see how much space is used in your home directory: bash du -sh $HOME

This will display the total size of files stored in your $HOME directory.

  1. Check Total and Available Space: To see the total and available storage, use this command: bash df -h $HOME

This will show details like total size (1 GB), used space, and available space for your home directory.

Example Output If you run df -h $HOME, you might see something like this:

Filesystem Size Used Avail Use% Mounted on /dev/loop0 974M 907M 0 100% /home/cloudshell-user

This indicates that: The total storage is 974 MB. 907 MB is used. 0 MB is available.

**Things to consider: **

Storage is limited to 1 GB per region, and it cannot be expanded. If you need more storage, consider using an Amazon S3 bucket for additional file storage. Persistent storage in CloudShell is tied to your $HOME directory and persists across sessions within the same region.

By using these commands, you can monitor your CloudShell storage usage effectively and ensure you stay within the provided limits.

profile picture
EXPERT
published 16 days ago49 views