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

Uploaded Python 3

File details

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

File metadata

  • Download URL: unmount_image-0.1.2.tar.gz
  • Upload date:
  • Size: 22.1 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.2.tar.gz
Algorithm Hash digest
SHA256 b38c0fee17fcbeb598a59646a357a8b26e3d7c8bf77a620b5f4003947d8d3ef0
MD5 aec07adae100eb19b1a5fac5637100c0
BLAKE2b-256 ed84760cc91f62a171e3bfd6f85fcb3a2d4cb142d768cdd6448ffa333030e335

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: unmount_image-0.1.2-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.2-py3-none-any.whl
Algorithm Hash digest
SHA256 cea38afb123a1d8e6b2b3293867963588f704da75cda2f42a7578717490a7098
MD5 10f1169acd319de3df7bebc71cf8accf
BLAKE2b-256 6e394ea40d2757327cd719474dd6a1819e40d381ab527d3df5831befccac0d40

See more details on using hashes here.

Provenance

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