Skip to main content

Disk image unmount and detach via udisksctl (Linux)

Project description

unmount-image

Disk image unmount and detach via udisksctl (Linux).

PyPI version Python License OS

CI codecov

Quick start

from unmount_image import umount_image

umount_image('/dev/loop0', mount_point='/run/media/user/IMG')

API

  • umount_image(device, mount_point=None, strategy=UNMOUNT_RETRY_THEN_LAZY) — unmount + detach
  • detach_image(device) — detach only (non-blocking)
  • umount_inner(device) — unmount only, used by the mount-image orchestrator
  • detach_inner(device) — detach only, used by the mount-image orchestrator

Unmount strategies

Strategy Pipeline
UNMOUNT_FAIL_FAST normal unmount
UNMOUNT_RETRY normal unmount, retry 3x
UNMOUNT_FORCE normal → --force
UNMOUNT_LAZY normal → umount -l
UNMOUNT_FORCE_THEN_LAZY normal → force → lazy
UNMOUNT_RETRY_THEN_LAZY (default) retry 3x → lazy

Custom strategies

from unmount_image import umount_image, compose, retry, _unmount_normal, _unmount_force

strategy = compose(retry(_unmount_normal, attempts=5), _unmount_force)
umount_image('/dev/loop0', strategy=strategy)

License

GPL-3.0-only

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

unmount_image-0.1.0.tar.gz (23.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

unmount_image-0.1.0-py3-none-any.whl (19.9 kB view details)

Uploaded Python 3

File details

Details for the file unmount_image-0.1.0.tar.gz.

File metadata

  • Download URL: unmount_image-0.1.0.tar.gz
  • Upload date:
  • Size: 23.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for unmount_image-0.1.0.tar.gz
Algorithm Hash digest
SHA256 ddad4079a4dbcca605673a5f0a7b1102e9ff2e3ac51849be12faf8470344c143
MD5 be1da59c6e9001993bb9be4a70934dba
BLAKE2b-256 59228d71ed9c0bf471be89f31adafdfa6a90eeed6987709aae44b0c313a83c58

See more details on using hashes here.

Provenance

The following attestation bundles were made for unmount_image-0.1.0.tar.gz:

Publisher: publish.yml on MBanucu/unmount-image

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file unmount_image-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: unmount_image-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 19.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for unmount_image-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 85df47ff34457136641015eb57379d84493223a61c36f42a9251e987ba755b1b
MD5 2c73a2d6408a31ed18bc1a4caa052352
BLAKE2b-256 849cfda384723c5fe08f0e069447c5805b5db968d4b7309183d7e47a6ee2bfbc

See more details on using hashes here.

Provenance

The following attestation bundles were made for unmount_image-0.1.0-py3-none-any.whl:

Publisher: publish.yml on MBanucu/unmount-image

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page