Validated on 7 Aug 2024 • Last edited on 18 Dec 2024
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.
Before creating a shared drive, you need to create a private network where you store the shared drive.
Using a Paperspace Console
To create a shared drive, go to the Paperspace console, in the top-left corner, click the dropdown 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 dropdown menu, choose a disk size for your shared drive. By default, the lowest disk size is selected.
Under the Region section, click the dropdown menu, choose a region 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 dropdown menu, choose a network 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 of the shared drive in GB.
networkId (string): The ID of the private network the shared drive belongs to.
region (string): The region the shared drive belongs to.
How to Create a Shared Drive Using the Paperspace API
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 tutorial.
Note
You cannot mount a shared drive to your machine using the Paperspace API or CLI. If you want to mount a shared drive to your machine, you need to mount it via the Paperspace console.
How to Mount a Shared Drive on Linux Using the Paperspace Console
In the Paperspace console, in the top-right corner, click the dropdown 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.
Connect to your machine, open a terminal, then use the mkdir command to create a directory to mount your shared drive to.
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.
sudo chown paperspace:paperspace /mnt/share
Using a text editor of your choice, open the /etc/fstab file. The /etc/fstab file defines how disk drives and partitions are mounted.
sudo nano /etc/fstab
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.
Mount your shared drive to the directory you created earlier.
mount /mnt/share
Verify that you have successfully mounted your shared drive by running a df command, which shows the disk space usage on your machine.
df -h
You have successfully mounted your shared drive if you see it listed among other mounted filesystems.
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.
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.<type>` helper program)
To fix this error, you need to:
Ensure your machine is up-to-date.
sudo apt-get update
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.
sudo apt install cifs-utils
Re-attempt to mount your shared drive to the directory you created earlier.
mount /mnt/share
Using the Paperspace Console
To access your shared drives, go to the Paperspace console, in the top-left corner, click the dropdown 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, 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