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

Downloads total Downloads/month Downloads/week

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.3.tar.gz (22.3 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.3-py3-none-any.whl (18.8 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: unmount_image-0.1.3.tar.gz
  • Upload date:
  • Size: 22.3 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.3.tar.gz
Algorithm Hash digest
SHA256 9679c1f61dd027fdbc2dfb9368c16e07048c87a56c06517d327634a4563006a9
MD5 b5ca795c17a5d6e341176566d7b6e85f
BLAKE2b-256 bf614a838315b61d0e073223c8d64dca3b6a5a1dd7be84a154317a141295ed75

See more details on using hashes here.

Provenance

The following attestation bundles were made for unmount_image-0.1.3.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.3-py3-none-any.whl.

File metadata

  • Download URL: unmount_image-0.1.3-py3-none-any.whl
  • Upload date:
  • Size: 18.8 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.3-py3-none-any.whl
Algorithm Hash digest
SHA256 6498ff4bf7fdd60690023592e4d4d2256c0266a7294d84e48d39526bb1f7d9f6
MD5 362581521942b5e1490d9dbf1ad29260
BLAKE2b-256 7b995d10d2c05bce2253a4b847c37ffc10fc224d12858db3e5b619ed96253be0

See more details on using hashes here.

Provenance

The following attestation bundles were made for unmount_image-0.1.3-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