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.1.tar.gz (36.0 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.1-py3-none-any.whl (20.0 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: unmount_image-0.1.1.tar.gz
  • Upload date:
  • Size: 36.0 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.1.tar.gz
Algorithm Hash digest
SHA256 6ac98c44ec7ecc67312e150136602633ef564ec39bb44636b9ab50fb5d9ab332
MD5 3ec2acb4619b1c88a11ac6f0320f794d
BLAKE2b-256 b7eb73c9516f2f8e9a6d128f423d63c46e81809b806da00074c3c6f7ad54c12e

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: unmount_image-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 20.0 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.1-py3-none-any.whl
Algorithm Hash digest
SHA256 4f444fc3632a2c7c05bd044ca313725fac7d379f0e887f4866f99a98ce54ed19
MD5 a1075badb87a93b1d1547d1e67a11f6a
BLAKE2b-256 f722563202fb388b691d558ec4e0d9e950ca454f8385dce7e4ac73d7a2b9205f

See more details on using hashes here.

Provenance

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