# How to Create, Mount, or Delete a Shared Drive Machines are Linux and Windows virtual machines with persistent storage, GPU options, and free unlimited bandwidth. They’re designed for high-performance computing (HPC) workloads. Shared drives provide storage that is accessible from multiple machines in a private network. You can manage shared drives with the [Paperspace console](https://console.paperspace.com), [Paperspace API](https://docs.digitalocean.com/reference/paperspace/api-reference/index.html.md), or [Paperspace CLI](https://docs.digitalocean.com/reference/paperspace/pspace/index.html.md). ## Create a Shared Drive Before creating a shared drive, you need to [create a private network](https://docs.digitalocean.com/products/paperspace/machines/how-to/manage-private-networks/index.html.md#create) where you store the shared drive. ### Using a Paperspace Console To create a [shared drive](https://console.paperspace.com/drives), go to the [Paperspace console](https://console.paperspace.com), in the top-left corner, click the drop-down menu, select **CORE**, click the **Drives** tab, in the **Drives** page, click **CREATE** to open the **Create a drive** window. In the **Create a drive** window, under the **Name** section, choose a name for your shared drive. Under the **Size in GB** section, click the drop-down menu, choose a [disk size](https://docs.digitalocean.com/products/paperspace/machines/details/features/index.html.md#block-storage) for your shared drive. By default, the lowest disk size is selected. Under the **Region** section, click the drop-down menu, choose a [region](https://docs.digitalocean.com/products/paperspace/machines/details/availability/index.html.md) for your shared drive. A good default is selected for you, but for the best performance and minimal latency, choose the datacenter region nearest to you and your users. Shared drives are region-specific, so its region must belong to the same region as the machines that are using it. Under the **Network** section, click the drop-down menu, choose a [network](https://docs.digitalocean.com/products/paperspace/machines/details/features/index.html.md#networking) for your shared drive. By default, one of your private networks in the same region is chosen. After you’ve configured for shared drive, click **CREATE**. You can see your new shared drive in the **Drives** tab. ### Using the Paperspace API When creating a shared drive using the Paperspace API, you need to provide the following values: - `name` (string): The name of the shared drive. - `size` (number): The [disk size](https://docs.digitalocean.com/products/paperspace/machines/details/features/index.html.md#block-storage) of the shared drive in GB. - `networkId` (string): The ID of the private network the shared drive belongs to. - `region` (string): The [region](https://docs.digitalocean.com/products/paperspace/machines/details/availability/index.html.md) the shared drive belongs to. ## How to Create a Shared Drive Using the Paperspace API 1. [Create an API key to authenticate your requests to your Paperspace account](https://docs.digitalocean.com/reference/paperspace/api-keys/index.html.md) and save it for use. 2. Send a POST request to `https://api.paperspace.com/v1/shared-drives`. ```bash curl -X POST \ -H "Content-Type: application/json" \ -H "Authorization: Bearer $PAPERSPACE_API_KEY" \ -d '{ "name": "your-shared-drive-name", "size": 50, "region": "NY2", "networkId": "nwhoe4ox" }' \ "https://api.paperspace.com/v1/shared-drives" ``` ### Using the Paperspace CLI When creating a shared drive using the Paperspace CLI, you need to provide the following values: - `name` (string): The name of the shared drive. - `size` (number): The [disk size](https://docs.digitalocean.com/products/paperspace/machines/details/features/index.html.md#block-storage) of the shared drive in GB. - `network-id` (string): The ID of the private network the shared drive belongs to. - `region` (string): The [region](https://docs.digitalocean.com/products/paperspace/machines/details/availability/index.html.md) the shared drive belongs to. ## How to Create a Shared Drive Using the Paperspace CLI 1. [Install `pspace`](https://docs.digitalocean.com/reference/paperspace/pspace/install/index.html.md), the Paperspace command-line tool. 2. [Create an API key to authenticate your requests to your Paperspace account](https://docs.digitalocean.com/reference/paperspace/api-keys/index.html.md) and save it for use with `pspace`. 3. Use the API key to grant `pspace` access to your Paperspace account. ```bash pspace login --api-key your-api-key ``` 4. Finally, run `pspace shared-drive create -F [flags]`. ```bash pspace shared-drive create -F --name your-shared-drive-name --network-id nwhoe4ox --region NY2 --size 50 ``` ## Access a Shared Drive Before you can access the shared drive, you need to mount your shared drive to your machine. For Windows-based machines, follow the [Mount a Drive in a Folder](https://learn.microsoft.com/en-us/windows-server/storage/disk-management/assign-a-mount-point-folder-path-to-a-drive) tutorial. **Note**: You cannot mount a shared drive to your machine using the [Paperspace API](https://docs.digitalocean.com/reference/paperspace/api-reference/index.html.md) or [CLI](https://docs.digitalocean.com/reference/paperspace/pspace/index.html.md). If you want to mount a shared drive to your machine, you need to mount it via the [Paperspace console](https://console.paperspace.com). ## How to Mount a Shared Drive on Linux Using the Paperspace Console 1. In the [Paperspace console](https://console.paperspace.com), in the top-right corner, click the drop-down menu, select **CORE**, then click the **Machines** tab. In the **Machines** section, find and select the machine you want to mount a shared drive to. 2. [Connect to your machine](https://docs.digitalocean.com/products/paperspace/machines/how-to/connect/index.html.md), open a terminal, then use the `mkdir` command to create a directory to mount your shared drive to. ```shell sudo mkdir /mnt/share ``` If the directory is created outside of the root directory, you must change its ownership to the `paperspace` user. This ensures that the directory has the appropriate permissions and is managed by the `paperspace` user. ```shell sudo chown paperspace:paperspace /mnt/share ``` 3. Using a text editor of your choice, open the `/etc/fstab` file. The `/etc/fstab` file defines how disk drives and partitions are mounted. ```shell sudo nano /etc/fstab ``` 4. Append the following line to the bottom of the `/etc/fstab` file. This line is the shared drive you want to add to your machine. ```text //your-shared-drive-ip-address/your-shared-drive-name /mnt/share cifs username=your-username,password=your-password,uid=1000,gid=1000,rw 0 0 ``` 5. Save and exit the `/etc/fstab` file. 6. Mount your shared drive to the directory you created earlier. ```shell mount /mnt/share ``` 7. Verify that you have successfully mounted your shared drive by running a `df` command, which shows the disk space usage on your machine. ```shell df -h ``` You have successfully mounted your shared drive if you see it listed among other mounted filesystems. ```shell Filesystem Size Used Avail Use% Mounted on ... //your-shared-drive-ip-address/your-shared-drive-name 500G 150G 350G 30% /mnt/share ``` If you get the mount error below, it means there is an issue related to either your file system type or server settings. ```shell mount: wrong fs type, bad option, bad superblock on //your-shared-drive-ip-address/your-shared-drive-name, missing codepage or helper program, or other error (for several filesystems (for example, nfs, cifs) you might need a `/sbin/mount.` helper program) ``` To fix this error, you need to: 1. Ensure your machine is up-to-date. ```shell sudo apt-get update ``` 2. Install Common Internet File System (CIFS) utilities, which provides the tools to mount Server Message Block (SMB) and CIFS shares. SMB/CIFS shares are protocols used to dictate how different resources, such as shared drives, are shared within your machine. ```shell sudo apt install cifs-utils ``` 3. Re-attempt to mount your shared drive to the directory you created earlier. ```shell mount /mnt/share ``` ### Using the Paperspace Console To access your shared drives, go to the [Paperspace console](https://console.paperspace.com), in the top-left corner, click the drop-down menu, select **CORE**, click the **Drives** tab, then find the shared drive you want to access. In the shared drive, under the **network address** section, **username** section, and **password** section, click to copy their values for later use. After copying your shared drives attributes, [connect to your machine](https://docs.digitalocean.com/products/paperspace/machines/how-to/connect/index.html.md), then find your shared drive under the directory you mounted your shared drive to. After finding the shared drive on your machine, open the shared drive, then type the network address, username, and password values from earlier for authentication. ### Using the Paperspace API When accessing a shared drive using the Paperspace API, you need to provide the ID of the shared drive you want to access. ## How to Access a Shared Drive Using the Paperspace API 1. [Create an API key to authenticate your requests to your Paperspace account](https://docs.digitalocean.com/reference/paperspace/api-keys/index.html.md) and save it for use. 2. Send a GET request to `https://api.paperspace.com/v1/shared-drives/{shared-drive-id}`. ```bash curl -X GET \ -H "Content-Type: application/json" \ -H "Authorization: Bearer $PAPERSPACE_API_KEY" \ -d '{ "id": "RJFHxSmO7U03" }' \ "https://api.paperspace.com/v1/shared-drives/RJFHxSmO7U03" ``` ### Using the Paperspace CLI When accessing a shared drive using the Paperspace CLI, you need to provide the ID of the shared drive you want to access. ## How to Access a Shared Drive Using the Paperspace CLI 1. [Install `pspace`](https://docs.digitalocean.com/reference/paperspace/pspace/install/index.html.md), the Paperspace command-line tool. 2. [Create an API key to authenticate your requests to your Paperspace account](https://docs.digitalocean.com/reference/paperspace/api-keys/index.html.md) and save it for use with `pspace`. 3. Use the API key to grant `pspace` access to your Paperspace account. ```bash pspace login --api-key your-api-key ``` 4. Finally, run `pspace shared-drive get `. ```bash pspace shared-drive get RJFHxSmO7U03 ``` ## Delete a Shared Drive ### Using the Paperspace Console To delete a [shared drive](https://console.paperspace.com/drives), go to the [Paperspace console](https://console.paperspace.com), in the top-left corner, click the drop-down menu, select **CORE**, then click the **Drives** tab. In the **Drives** page, within the list of shared drives, find the shared drive you want to delete. Then, in the shared drive you want to delete, click **…**, click **Delete**. ### Using the Paperspace API When deleting a shared drive using the Paperspace API, you need to provide the ID of the shared drive to delete. ## How to Delete a Shared Drive Using the Paperspace API 1. [Create an API key to authenticate your requests to your Paperspace account](https://docs.digitalocean.com/reference/paperspace/api-keys/index.html.md) and save it for use. 2. Send a DELETE request to `https://api.paperspace.com/v1/shared-drives/{your-shared-drive-id}`. ```bash curl -X DELETE \ -H "Content-Type: application/json" \ -H "Authorization: Bearer $PAPERSPACE_API_KEY" \ -d '{ "id": "RJFHxSmO7U03" }' \ "https://api.paperspace.com/v1/shared-drives/RJFHxSmO7U03" ``` ### Using the Paperspace CLI When deleting a shared drive using the Paperspace CLI, you need to provide the ID of the shared drive to delete. ## How to Delete a Shared Drive Using the Paperspace CLI 1. [Install `pspace`](https://docs.digitalocean.com/reference/paperspace/pspace/install/index.html.md), the Paperspace command-line tool. 2. [Create an API key to authenticate your requests to your Paperspace account](https://docs.digitalocean.com/reference/paperspace/api-keys/index.html.md) and save it for use with `pspace`. 3. Use the API key to grant `pspace` access to your Paperspace account. ```bash pspace login --api-key your-api-key ``` 4. Finally, run `pspace shared-drive delete `. ```bash pspace shared-drive delete RJFHxSmO7U03 ```