> ## Documentation Index
> Fetch the complete documentation index at: https://docs.archil.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Mount on Linux (FUSE)

The `archil` CLI mounts an Archil disk as a real local filesystem on a Linux server, so any program — your shell, Python, a database, a training loop — can read and write files through standard POSIX APIs. The mount goes through the kernel's FUSE layer and presents as a regular directory.

## Guide

### Install the client

To install or upgrade the Archil client, run the following on your server:

```bash theme={null}
curl -s https://archil.com/install | sh
```

### Authorize your server

Configure which servers can connect to the disk.

<Tabs>
  <Tab title="Disk Token">
    On the disk's **Details** page, click **Connections**, click **Add User**, then select **Disk Token**. Copy the [disk token](/concepts/disk-users#disk-token-authorization) and store it somewhere safe. Disk tokens cannot be retrieved again. A disk token is a credential scoped to the specific disk that it's created on, and allows users to mount the disk.
  </Tab>

  <Tab title="AWS: IAM Role">
    Add your EC2 instance's IAM role ARN as an **Authorized User** on the disk's **Details** page. You can retrieve it with:

    ```bash theme={null}
    archil utils get-iam-role
    ```
  </Tab>
</Tabs>

### Mount disk

Then mount the disk. The Archil console shows the exact command for your disk:

```bash theme={null}
export ARCHIL_MOUNT_TOKEN="<disk-token>"
sudo --preserve-env=ARCHIL_MOUNT_TOKEN archil mount <disk-name> /mnt/data --region <disk-region>
```

If you are using IAM role authentication, no disk token is needed:

```bash theme={null}
sudo archil mount <disk-name> /mnt/data --region <disk-region>
```

<Note>
  Files on a newly mounted disk are owned by root. Either change ownership (`chown -R <user> /mnt/data`) or use `sudo` when working with the data.
</Note>

<Warning>
  Always use `archil unmount` to unmount your disks, **not** the built-in `umount` command. `archil unmount` waits for all pending writes to flush to the backing store before exiting. This is especially important during system shutdown, where the kernel's default `umount` will not wait for Archil writes to sync.
</Warning>

## Using delegations

If you mount a disk in shared mode (with `--shared`, or on any disk that's currently mounted from another client), some write operations are unavailable by default until you explicitly check out the file or directory you intend to write. For the full model, see [Shared Disks](/concepts/shared-disks).

Check out a path before writing, and check it back in when you're done:

```bash theme={null}
archil checkout /mnt/data/my-file.txt
# ... edit the file ...
archil checkin /mnt/data/my-file.txt
```

Checkouts on a directory cover its entire subtree, so you can check out `/mnt/data/my-project` once and write anywhere inside it. To see what you currently hold, run `archil delegations /mnt/data`. See the [`archil` CLI reference](/reference/archil-cli#checkout) for every flag, including `--force` for revoking another client's delegation.

## Mount automatically on startup

If you're running a service on Archil on servers in an ASG, you'll want to mount Archil at startup. You can do this by adding Archil to the server's `/etc/fstab`:

```bash theme={null}
<disk-name> <mountpoint> archil _netdev,region=<region>,defaults 0 0
```

**Parameters:**

* `<disk-name>`: An owner-qualified disk name (`organization/disk-name` or `employee@email.com/disk-name`) or disk ID (`dsk-0123456789abcdef`).
* `<mountpoint>`: Local directory where the disk should be mounted (e.g., `/mnt/archil`).
* `archil`: Filesystem type for Archil disks.
* `_netdev`: Tells systemd this is a network filesystem that needs network connectivity before mount.
* `region=<region>`: The region your disk is in (e.g., `aws-us-east-1`).

Example:

```bash theme={null}
# /etc/fstab
myorg/mydisk /mnt/data archil _netdev,region=aws-us-east-1,defaults 0 0
```

<Warning>
  The `_netdev` option is essential. Without it, systemd may try to mount the disk before network connectivity is established, causing boot failures or timeouts.
</Warning>

Test the entry without rebooting:

```bash theme={null}
sudo mount -a            # mount everything in fstab
sudo mount /mnt/data     # mount a specific entry
```

## Mount in a container

To mount from inside a Docker/OCI container (or share a host mount with one), see [Mount in a container](/mounting/containers).

## Command reference

For every flag and subcommand `archil` accepts — `mount`, `unmount`, `checkout`, `checkin`, `delegations`, `status`, `set-cache-expiry` — see the [`archil` CLI reference](/reference/archil-cli).
