Skip to main content

Scan the Unraid USB stick

POST 

/migrate/scan/device

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/migrate/scan/device"

Instead of the Flash Backup zip, reads Unraid's configuration from the USB stick, attached to this machine, and queues a migration_scan job. device must be one of the flashDevices getMigration offers. The stick is mounted read-only (never read-write) at a private mountpoint under the daemon's state directory for the one read made here before anything is queued and for the job's own read, and is unmounted after each; nothing is ever written to it and nothing is copied from it. The stick is the user's rollback. Refused before anything is queued: 400 invalid_flash_device (the device is not on offer: not a FAT filesystem labelled UNRAID, the boot disk, an array disk, or a filesystem UUID that another disk shares), 409 zip_only_source (the session's capture, or the stick's own, says Unraid booted from an internal device, whose ZFS boot pool Hoserva does not read; the zip is the only source), 409 flash_device_unreadable (it could not be mounted read-only or unmounted, or failed while it was read), 400 invalid_flash_backup (no usable config/disk.cfg) and 400 unsupported_layout (as for the zip, unless unverifiedLayout is true). 409 scan_in_progress while a scan runs, and 501 not_configured when this daemon has no migration service or cannot read a flash device. The result is the report the same flash's zip gives.

Request​

Responses​

The queued migration_scan job.