Tutorial
Updated
Using a Secondary Drive For Steam On Linux
This guide is for the Linux desktop, and is going to cover how to mount a secondary storage medium on your Steam directory under your user's home directory. The benefit of this is that you don't have to do any reconfiguring under Steam, nor do you have to "move" your games using the Steam client. This guide also assumes that you have a little familiarity with Linux, and aren't afraid of cracking open a terminal. I'll try to make things as simple as possible, though.
Step one is to install and format your drive. I'm using an NVMe, but SATA drives can be used, as well. I do recommend against the use of external drives, though. They don't have enough throughput to offer a pleasant experience, so avoid using them for active data. I also recommend the EXT4 filesystem for its journaling capabilities, but you are free to use something else if you have a preference. If you're not familiar with partitioning a drive on Linux, I recommend installing and using GParted. Just use your distro's package manager to grab it.
Using the drop-down in the top-right corner, select the drive you wish to use if it wasn't already selected.
Note: NVMe drives and SATA drives follow specific naming conventions, as you can see in the screenshot above. If using a SATA drive, it will instead be displayed as "/dev/sd*x*". Just be mindful of this. Also, as a big warning, be ABSOLUTELY SURE that you have the right drive selected. You're going to be creating a new partition table on it, and this will destroy anything present on the drive.
Once you have the proper drive selected, click Device, and then click Create Partition Table. If using a drive larger than 2 TB, you'll want to use GPT. Otherwise, MBR should be fine, but it won't hurt to use GPT if you prefer to.
Once the partition table has been created, you'll be able to right-click the empty drive in the list, and choose to create a new partition on it. As mentioned, go with EXT4, and give it a label if you'd like. From here, you're going to temporarily mount the drive, and copy the contents of your Steam directory to it. To do this, you'll make use of rsync, as it will effectively make a proper 1:1 copy of the files and symlinks. If your distro doesn't come with it installed, just use your package manager to install it.
This first command will list all block devices. You can use this to find your drive and partition ID if you didn't make note of them in GParted. In the example output, you'll notice that mine is already mounted.
Once you have the IDs, you can mount the partition, and begin the copying phase.
This may take a while, depending on your drive type and how many games you have installed, so feel free to take a break here. Once it finishes, you're going to set up the drive's automount settings. To do this, drop to a root shell. Be mindful when working in this type of shell, as you can very easily break your system if you don't know what you're doing.
This next command will give you the UUID of the partition you created. Take a look at my example output to see what you should get.
Note: If using a SATA drive, your drive and partition ID will follow the "sd*x*Y*" scheme, like "/dev/sdb1".
Once you have the UUID, make note if it somewhere in a text editor, and put it to the side for the moment. From here, you're going to edit the fstab. This is the file that tells the OS how and where to mount partitions on boot. As root, you will need to make use of a terminal based text editor, and I recommend nano if you're new to this. It usually comes preinstalled, but if you don't have it, your package manager will.
Once you have this file open in your terminal, make a new line at the end of it, and make an entry similar to this:
Be sure to insert the UUID, and your username, as needed. Everything else should be left alone. Once done, press Ctrl+O and Enter to save the file, and then Ctrl+X to exit nano. After that, you'll need to drop back to your user's shell, and issue a couple more commands to finish everything off. To exit from the root shell, you can either issue "exit" as a command, or press Ctrl+A+D. Once back in your normal shell, unmount the drive from the temporary location, rename your Steam directory to make a backup of it, and make a new one in its place.
Now, for the moment of truth. Reboot, and if everything is set up correctly, you should now have a dedicated drive for Steam! If not, Steam will fail to launch, and you can issue "steam" as a command to find out why. If you need help deciphering anything, just share the output here. Provided all went well, feel free to delete the backup of the old Steam directory. For good measure, I recommend having Steam verify your game files. It may not be necessary, but I did this myself for the sake of such.
Step one is to install and format your drive. I'm using an NVMe, but SATA drives can be used, as well. I do recommend against the use of external drives, though. They don't have enough throughput to offer a pleasant experience, so avoid using them for active data. I also recommend the EXT4 filesystem for its journaling capabilities, but you are free to use something else if you have a preference. If you're not familiar with partitioning a drive on Linux, I recommend installing and using GParted. Just use your distro's package manager to grab it.
Using the drop-down in the top-right corner, select the drive you wish to use if it wasn't already selected.
Note: NVMe drives and SATA drives follow specific naming conventions, as you can see in the screenshot above. If using a SATA drive, it will instead be displayed as "/dev/sd*x*". Just be mindful of this. Also, as a big warning, be ABSOLUTELY SURE that you have the right drive selected. You're going to be creating a new partition table on it, and this will destroy anything present on the drive.
Once you have the proper drive selected, click Device, and then click Create Partition Table. If using a drive larger than 2 TB, you'll want to use GPT. Otherwise, MBR should be fine, but it won't hurt to use GPT if you prefer to.
Once the partition table has been created, you'll be able to right-click the empty drive in the list, and choose to create a new partition on it. As mentioned, go with EXT4, and give it a label if you'd like. From here, you're going to temporarily mount the drive, and copy the contents of your Steam directory to it. To do this, you'll make use of rsync, as it will effectively make a proper 1:1 copy of the files and symlinks. If your distro doesn't come with it installed, just use your package manager to install it.
This first command will list all block devices. You can use this to find your drive and partition ID if you didn't make note of them in GParted. In the example output, you'll notice that mine is already mounted.
Code:
lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINTS
...
nvme0n1 259:0 0 1.8T 0 disk
└─nvme0n1p1 259:1 0 1.8T 0 part /home/joom/.steam
...
Once you have the IDs, you can mount the partition, and begin the copying phase.
Code:
sudo mount -t ext4 /dev/<drive/part> /mnt
sudo rsync -avPH /home/<user>/.steam/* /mnt/
This may take a while, depending on your drive type and how many games you have installed, so feel free to take a break here. Once it finishes, you're going to set up the drive's automount settings. To do this, drop to a root shell. Be mindful when working in this type of shell, as you can very easily break your system if you don't know what you're doing.
Code:
sudo su -
This next command will give you the UUID of the partition you created. Take a look at my example output to see what you should get.
Code:
blkid /dev/<drive/part>
/dev/nvme0n1p1
/dev/nvme0n1p1: LABEL="games" UUID="65713451-241a-428c-9eae-69ea413ead41" BLOCK_SIZE="4096" TYPE="ext4" PARTUUID="be2a4b0a-3456-4fdd-aa61-716679ae81ef"
Note: If using a SATA drive, your drive and partition ID will follow the "sd*x*Y*" scheme, like "/dev/sdb1".
Once you have the UUID, make note if it somewhere in a text editor, and put it to the side for the moment. From here, you're going to edit the fstab. This is the file that tells the OS how and where to mount partitions on boot. As root, you will need to make use of a terminal based text editor, and I recommend nano if you're new to this. It usually comes preinstalled, but if you don't have it, your package manager will.
Code:
nano /etc/fstab
Once you have this file open in your terminal, make a new line at the end of it, and make an entry similar to this:
Code:
/dev/disk/by-uuid/<UUID> /home/<user>/.steam ext4 rw,nosuid,nodev,nofail,user,exec 0 0
Be sure to insert the UUID, and your username, as needed. Everything else should be left alone. Once done, press Ctrl+O and Enter to save the file, and then Ctrl+X to exit nano. After that, you'll need to drop back to your user's shell, and issue a couple more commands to finish everything off. To exit from the root shell, you can either issue "exit" as a command, or press Ctrl+A+D. Once back in your normal shell, unmount the drive from the temporary location, rename your Steam directory to make a backup of it, and make a new one in its place.
Code:
cd (This command just ensures you're in your home directory)
sudo umount /mnt
mv .steam{,.bak}
mkdir .steam
Now, for the moment of truth. Reboot, and if everything is set up correctly, you should now have a dedicated drive for Steam! If not, Steam will fail to launch, and you can issue "steam" as a command to find out why. If you need help deciphering anything, just share the output here. Provided all went well, feel free to delete the backup of the old Steam directory. For good measure, I recommend having Steam verify your game files. It may not be necessary, but I did this myself for the sake of such.
Last edited by Joom,