Skip to main content

Replace a data disk

POST 

/disks/array/replace

Required role: admin. Only an account or token with the admin role can call this operation.

Example request
curl --request POST \
--header "Authorization: Bearer $HOSERVA_TOKEN" \
--header "Content-Type: application/json" \
--data @body.json \
"https://$HOSERVA_HOST:8008/api/v1/disks/array/replace"

Queues a Topology job that formats or adopts the replacement at the same mountpoint, regenerates mount units, the pool and snapraid.conf from SQLite, confirms the mountpoint is genuinely backed by the replacement before touching parity, then runs snapraid fix to reconstruct its contents from parity and the remaining disks. Identity is re-checked at format time and the boot disk is always refused. Refuses (slot_disk_present) the same way planDiskReplace does when the slot's own disk is still mounted or still present by identity, and (disk_leaving_array, 409) a slot still evacuating or already unlisted. A slot that is evacuated or unpooled is allowed once the slot's own disk is genuinely missing: the job clears the removal state as part of adopting the replacement, so the disk rejoins the array as an ordinary member and its recorded files rebuild from parity. The confirmation must be the exact string the matching planDiskReplace call returned; a wrong or missing one is refused with confirmation_required and formats nothing.

Request​

Responses​

The queued Topology job.