When should I use /scratch and when should I use /home?

On many research computing facilities an account has access to a number of directory trees. Typically one of these is called or referred to as /home and another is called or referred to as /scratch. Many new users of research computing resource are unclear why there are different directory trees and how to use them. This question seeks explanation and guidance for the use of these different directories.

CURATOR: Chris Hill

1 Like

ANSWER: On a typical research computing facility the /home or equivalent directory will be the location where a login starts by default. Often times this directory is located on a filesystem that is geared toward editing of files and small analysis of datasets. The filesystem usually has reasonable levels of redundancy and fairly frequent backup practices. This is to ensure that human effort intensive work, for example editing program scripts, writing documents, making plots and so forth against this filesystem is well supported. High levels of redundancy and frequent backups require so investment in capital and in operations. This can make it economically impractical and/or inefficient to provide very large file spaces at the /home type of quality of service.

Many research computing facilities also operate bulk storage systems, typically called or referred to as /scratch. These are often an order of magnitude or more larger in capacity than the /home system. They may be geared toward highly parallel reading and writing of the sort generated by data intensive applications more than people editing files. These file systems often have redundancy but may not be backed up to another storage location due to economic trade offs.

In general end users of research computing facilities end up using /home type file systems for digital material that would be hard or impossible to recreate (assuming that /home is a synonym for a fully backed up, highly redundant system). File systems that are designated (or even called) /scratch are typically used for large numbers of files and/or large individual files that cannot fit on /home or do not perform well there. Exact guidance for which system to use when will vary from one installation to another, but the general rules outlined here tend to apply universally.

Some facilities only provide one flavor of storage service. In some cases a facility chooses to offer highly redundant and multiply backed up storage only. This increases capital and operational costs per unit of storage but reduces the risk that any digital assets will be permanently lost. Other facilities chose to base all there storage on high-performance technologies with limited redundancy and backup but lower cost per unit of storage.

Almost all research computing facilities assume that end users and/or application service providers understand what level of service is most relevant to their activities. End users of a facility should definitely try and pay attention which levels of data safety and performance service a facility provides on which file systems.

ANSWER: Some facilities have more filesystems than just the usual /home and /scratch spaces.

For example, in PSC Bridges, their documentation on File Spaces lists the following:

There are several distinct file spaces available on Bridges, each serving a different function.

  • Home ($HOME), your home directory on Bridges
  • pylon2, ($PROJECT), persistent file storage Note that due to recent improvements in the pylon5 file system, pylon2 will be phased out. Please see New on Bridges for directions on how to move your files to pylon5.
  • pylon5 ($SCRATCH), a Lustre system for persistent file storage. Pylon5 has replaced pylon1.
  • Node-local storage ($LOCAL), scratch storage in the local memory associated with a running job
  • Memory storage ($RAMDISK), scratch storage on the local disk associated with a running job

Note, I bolded the text above about each serving a different function— I am not sure what you are trying to accomplish, so if you could explain more what you want to do then I could provide some more guidance if the examples above are not enough to answer your question.