# Writing to EOS

The Purdue EOS storage is mounted **read-only** at `/eos/purdue/`. To write files to EOS (for example, to your Grid directory `/store/user/<cern-username>/`), use the `gfal` or `xrdcp`/`xrdfs` commands. Where to stage outputs before copying them is in [Storage volumes](<https://analysis-facility.physics.purdue.edu/storage/index.md>).

Both tools need a valid [VOMS proxy](<https://analysis-facility.physics.purdue.edu/getting-started/index.md#6-set-up-a-voms-proxy>), are available in every terminal, and are documented at the [Purdue Tier-2 CMS site](<https://www.physics.purdue.edu/Tier2/user-info/tutorials/dfs_commands.php>).

## Using xrdcp and xrdfs

For example:

```shell
# copy a local file to your Grid directory on Purdue EOS
xrdcp /tmp/$USER/output.root root://eos.cms.rcac.purdue.edu//store/user/<cern-username>/output.root

# list the contents of a directory
xrdfs root://eos.cms.rcac.purdue.edu ls /store/user/<cern-username>/
```

## Using gfal

For example:

```shell
gfal-copy /tmp/$USER/output.root root://eos.cms.rcac.purdue.edu//store/user/<cern-username>/output.root
```

> [!NOTE]
>
> **See also**
>
> - [Data access](<https://analysis-facility.physics.purdue.edu/data-access/index.md>) — copying files from other CMS sites
> - [Storage volumes](<https://analysis-facility.physics.purdue.edu/storage/index.md>) — where CRAB outputs end up
> - [Rucio](<https://analysis-facility.physics.purdue.edu/guide-rucio/index.md>) — where replicated datasets end up
