# Data System

## Network Filesystem `/home`

Each user has an area for their own private files, called their _home directory_. Your home directory is where you and your files live. Any data that you need to keep must be stored here. The name of your home directory is:

```
/home/<your_user_name>
```

It also has a special nickname: `~/`. The string `~/` will always point to your home folder.

Each time you log in, you will be placed into your home directory. This directory is NFS-mounted across the cluster, which means that you may access the same files no matter which system you are on. If you create `~/notes.txt` on the head node, you'll be able to access `~/notes.txt` from any node. For example, here are some files you might see when you first log in:

```
[user@head ~]$ ls
Desktop  example-custom-job.sh  gromacs  hoomd-blue namd
```

If you then log into one of the compute nodes, you will see the exact same files:

```
[user@node4 ~]$ ls
Desktop  example-custom-job.sh  gromacs  hoomd-blue namd
```

Your home directory is the safe location to store files, but will offer lower performance. When performance is critical, use a Scratch Filesystem for temporary data that's only needed during the run.

## High-Performance, Scratch Filesystem `/scratch`

Each system also has a high-speed data storage area for temporary data. This filesystem, often called _scratch_, offers temporary high-speed storage. This filesystem is wiped in between jobs, but is the best location for temporary data.

On the Compute Nodes, the `/scratch` directory is the scratch filesystem.

Keep in mind that data on the scratch filesystem is subject to deletion. Be sure to move data back to your `/home` directory.

## Checking available disk space

Usually, you need to check the directories you'll be writing to (i.e., `/home` and `/scratch`):

```
df -h ~/
```

```
df -h /scratch
```

Remember that if storage quotas are in-place, you won't actually be able to use all the available disk space.

## Calculating your disk usage

Summarize the size of your home directory:

```
du -chxs ~/*
```

Summarize the size of a directory (including subdirectories):

```
du -chxs myproject/*
```

List the files of a directory (sorted by size):

```
ls -Sho myproject/
```
