Cloud Shell uses temporary storage for the $HOME directory, which means your files are lost when the instance is released. To save your files and configurations permanently, you can mount a File Storage NAS (NAS) file system to serve as your persistent $HOME directory.
Prerequisites
Cloud Shell creates a pay-as-you-go NAS file system of the Performance class for persistent storage. You are charged for using this file system. For more information, see NAS billing overview.
To ensure security, we recommend logging on to the console and using Cloud Shell as a RAM identity (RAM user or RAM role) instead of the Alibaba Cloud account. The RAM identity must have the necessary permissions to manage the resources you intend to work with. For more information, see RAM-based access control.
Procedure
Follow these steps to mount or unmount a NAS file system for persistent storage in your Cloud Shell environment.
Mount a NAS file system
In the toolbar, choose the storage icon > Mount File Storage.

In the dialog box, click Create Now. Cloud Shell then creates and mounts a new NAS file system. The initial setup might take a few minutes.

After the mount is complete, your Cloud Shell session restarts automatically. This process can take up to 30 seconds.
Once your session restarts, persistent storage is active. To view the ID of the mounted NAS file system, choose the storage icon > Mount File Storage in the toolbar. The menu displays the file system ID.

Click the file system ID to open the NAS console and view the file system's details.

Unmount a NAS file system
In the toolbar, choose the storage icon > Unmount File Storage.

In the confirmation dialog box, click Unmount Now to unmount the file system from Cloud Shell.
NoteUnmounting the file system does not delete it. You will continue to be charged for the NAS file system until you manually delete it in the NAS console. Deleting a file system permanently removes all its data. For more information, see Release a NAS file system.
If you unmount but do not delete the file system, Cloud Shell remounts the same file system the next time you mount storage.
After the unmount is complete, your Cloud Shell session restarts automatically. This process can take up to 30 seconds.
After the session restarts, your
$HOMEdirectory reverts to using temporary storage. Files in the temporary storage are deleted when the session ends.