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

# List drive mounts

> List the drives a running sandbox has mounted, with each mount's path, folder, and read-only setting.

A sandbox's own record doesn't list the [drives](https://docs.baseten.co/drives/overview.md) it has
mounted. List its mounts to see them. [Set up your SDK or the CLI](https://docs.baseten.co/drives/create-drives.md#set-up)
before running these examples. They use a running sandbox named `hello-world`.

> [!NOTE]
>
> Drives are in pre-release in the Baseten CLI (`baseten drive` and `baseten sandbox drive`) and in the Python, TypeScript, and Go SDKs (`baseten`, `@basetenlabs/client`, `@basetenlabs/sandbox`, and `baseten-go`). Commands, methods, and responses can change. The [Management API drive operations](https://docs.baseten.co/reference/management-api/overview.md#drives) are experimental.

## List drive mounts

Each mount shows the drive's name, the folder of the drive that's mounted (`/`
for the whole drive), the mount path in the sandbox, and whether it's
read-only.

**To list the drives mounted in `hello-world`**:

> [tab] TypeScript
>
> Run the following code:
>
> ```typescript theme={"system"}
> import { SandboxClient } from "@basetenlabs/sandbox";
>
> const client = new SandboxClient({ apiKey: process.env.BASETEN_API_KEY! });
> const sandbox = await client.get({ name: "hello-world" });
> for (const mount of await sandbox.drives.listMounts()) {
>   console.log(mount.driveName, mount.drivePath, mount.mountPath, mount.readOnly);
> }
> ```

> [tab] Python
>
> Run the following code:
>
> ```python theme={"system"}
> import os
>
> from baseten.sandbox import SandboxClient
>
> with SandboxClient(api_key=os.environ["BASETEN_API_KEY"]) as client:
>     sandbox = client.get(name="hello-world")
>     for mount in sandbox.drives.list_mounts():
>         print(mount.drive_name, mount.drive_path, mount.mount_path, mount.read_only)
> ```

> [tab] Go
>
> Run the following code:
>
> ```go theme={"system"}
> package main
>
> import (
>     "context"
>     "fmt"
>     "log"
>     "os"
>
>     "github.com/basetenlabs/baseten-go/sandbox"
> )
>
> func main() {
>     ctx := context.Background()
>     client, err := sandbox.NewClient(sandbox.ClientOptions{
>         APIKey: os.Getenv("BASETEN_API_KEY"),
>     })
>     if err != nil {
>         log.Fatal(err)
>     }
>     sb, err := client.Get(ctx, sandbox.GetOptions{Name: "hello-world"})
>     if err != nil {
>         log.Fatal(err)
>     }
>     mounts, err := sb.Drives().ListMounts(ctx)
>     if err != nil {
>         log.Fatal(err)
>     }
>     for _, mount := range mounts {
>         fmt.Println(mount.DriveName, mount.DrivePath, mount.MountPath, mount.ReadOnly)
>     }
> }
> ```

> [tab] API
>
> Set `SANDBOX_URL` to the sandbox's URL, as in
> [Get the sandbox URL](https://docs.baseten.co/sandboxes/run-commands.md#get-the-sandbox-url),
> then run the following command to
> [list the mounts](https://docs.baseten.co/reference/sandbox-api/drive/list-currently-mounted-drives.md):
>
> ```bash theme={"system"}
> curl --url "${SANDBOX_URL%/}/drives/mount" \
>   --header "Authorization: Bearer $SANDBOX_TOKEN"
> ```
>
> The response's `mounts` field lists each mount.

> [tab] CLI
>
> Run the following command:
>
> ```bash theme={"system"}
> baseten sandbox drive list --name hello-world
> ```
>
> The command prints a table with the columns `DRIVE`, `DRIVE PATH`,
> `MOUNT PATH`, and `READ ONLY`.

## Next steps

> [card] [Unmount a drive](https://docs.baseten.co/drives/unmount-drives.md)
>
> Detach a drive from a sandbox and keep its files.

> [card] [Mount a drive](https://docs.baseten.co/drives/mount-drives.md)
>
> Mount another drive or folder.
