---
title: "Attach a drive to a local path"
method: POST
path: "/drives/mount"
tags: ["drive"]
---

# Attach a drive to a local path

`POST /drives/mount`

Mounts an agent drive using the blfs binary to a local path, optionally mounting a subpath within the drive. Supports optional UID/GID mapping to remap file ownership between the local sandbox and the filer (always mapped to filer UID/GID 0). Mapping values can be set per-request via uidMap/gidMap fields, or globally via BLFS_UID_MAP/BLFS_GID_MAP environment variables (request values take precedence).

## Request body

- DriveMountRequest
  - `driveName` string, required
  - `drivePath` string — Optional, defaults to "/"
  - `gidMap` string — Optional, local GID to map (filer GID is always 0)
  - `mountPath` string, required
  - `readOnly` boolean — Optional, defaults to false
  - `uidMap` string — Optional, local UID to map (filer UID is always 0)

## Response `200`

OK

- DriveMountResponse
  - `driveName` string
  - `drivePath` string
  - `gidMap` string — The local GID used for this mount
  - `message` string
  - `mountPath` string
  - `readOnly` boolean
  - `success` boolean
  - `uidMap` string — The local UID used for this mount

## Other responses

- `400` — Bad Request
- `500` — Internal Server Error

---

[API](https://skmtc.net/blaxel/apis/blaxel-control-plane.md) · [All operations](https://skmtc.net/blaxel/apis/blaxel-control-plane/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/blaxel/blaxel-control-plane/versions/dfa264bc72ee/schema)
