Steam – Is it possible to use the same steam library folder on multiple OSs

steam

Mostly when booting multiple operating systems on the same computer, it seems really inefficient to have every game twice (or even three times), considering it's mostly the same. Is it possible to save this disk space and download volume?

Related but not the same: Transforming a library folder from one platform to another: Can I copy Steam game files from a Mac onto a PC?

Best Answer

It's possible to save most of the additional disk space and download volume, but you'll need to put some work in, it's not automatic.

To save the disk space, the steam libraries need to be on the same disk and partition and the file system needs to support hardlinks. If the OS combo is Windows and Linux, NTFS is supported by both (you can even just use the Windows C: partition if you want). I advise against ext4 because I didn't get it to work well on Windows, maybe ext2 would work. FAT does not work (no hardlinks). Other OS combinations might be more tricky, I would still use NTFS because 2/3 have good support for it and for Mac OS there are drivers you can buy.

Once you have a suitable partition, you move your steam library folders onto it, say as

your-partition/steam/win/
your-partition/steam/linux/

Then you can use one of a selection of hardlinking tools to find duplicates in those folders and hardlink them. For example there is this script which is very careful (i.e. it might not save as much disk space as possible, but it's really unlikely it links too many files). In this example, you would run

./steam-dedup.sh your-partition/steam/win/ your-partition/steam/linux/

When you install a new game, you install it for just one platform, then copy its directory in steamapps/common into the steamapps/common folder of the other platforms, then install it on the other platforms. Steam will notice that most files are already there and only download what is missing. Then run the hardlinking utility again to get rid of the duplicates.

Game updates are more tricky. A game update on one platform might also update the game on the other platform, but more likely it will leave the other platforms in an inconsistent state. Usually it should be best to just do the update on each platform separately (then run the hardlinking tool again). But if download volume is really expensive and the update is large (adding many new files), then copying the game folder from steamapps/common on the up to date platform over the respective folders of the other installations might save some download volume (then verify/update on the other platforms, then hardlink).