Cross-platform disk image mounting via loop devices (Linux) or hdiutil (macOS)
Project description
mount-image
Cross-platform disk image mounting via loop devices (Linux) or hdiutil (macOS).
Features
mount_image— attach a disk image as a loop device and mount it: Linux useslosetup+mount, macOS useshdiutil attach+mountumount_image— unmount and detach a disk imageattach_image— attach a disk image as a block device without mounting (for raw block I/O)detach_image— detach a raw block device
Quick start
from mount_image import mount_image, umount_image
# Mount a disk image
device, mount_point = mount_image('/path/to/disk.img')
print(f'Mounted {device} at {mount_point}')
# ... do work with the mounted filesystem ...
# Unmount and detach
umount_image(device, mount_point)
Raw device access (no mount)
from mount_image import attach_image, detach_image
dev = attach_image('/path/to/disk.img')
# Read/write raw blocks via /dev/loop0 or /dev/disk5
detach_image(dev)
Note: All functions require
sudofor losetup/mount (Linux) or hdiutil/mount (macOS).
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file mount_image-0.1.0.tar.gz.
File metadata
- Download URL: mount_image-0.1.0.tar.gz
- Upload date:
- Size: 17.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a05cf6a9b9b0804200278537289e20b5b25303aad73382edead45e6f2be20a9a
|
|
| MD5 |
c5c1bcc938eb41fbb927291500e4469f
|
|
| BLAKE2b-256 |
dbd5ca06cdfd801ae74a224ff94e8730de5cfe83077131fd662bde907490e0fc
|
Provenance
The following attestation bundles were made for mount_image-0.1.0.tar.gz:
Publisher:
publish.yml on MBanucu/mount-image
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
mount_image-0.1.0.tar.gz -
Subject digest:
a05cf6a9b9b0804200278537289e20b5b25303aad73382edead45e6f2be20a9a - Sigstore transparency entry: 1815802444
- Sigstore integration time:
-
Permalink:
MBanucu/mount-image@793733e19ca7bd6d73eb51bebb20668ed7fa8422 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/MBanucu
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@793733e19ca7bd6d73eb51bebb20668ed7fa8422 -
Trigger Event:
push
-
Statement type:
File details
Details for the file mount_image-0.1.0-py3-none-any.whl.
File metadata
- Download URL: mount_image-0.1.0-py3-none-any.whl
- Upload date:
- Size: 16.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
24e457305c3eb6f7d25c836a6c0cb1c974794de4d5fad62e069fa01c05fe183d
|
|
| MD5 |
39e35c0ff471823dcba3feabca048d96
|
|
| BLAKE2b-256 |
6e023826fd56938fedef48dab4f83aad5e992a00c4d901111ce0c70525fde890
|
Provenance
The following attestation bundles were made for mount_image-0.1.0-py3-none-any.whl:
Publisher:
publish.yml on MBanucu/mount-image
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
mount_image-0.1.0-py3-none-any.whl -
Subject digest:
24e457305c3eb6f7d25c836a6c0cb1c974794de4d5fad62e069fa01c05fe183d - Sigstore transparency entry: 1815802508
- Sigstore integration time:
-
Permalink:
MBanucu/mount-image@793733e19ca7bd6d73eb51bebb20668ed7fa8422 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/MBanucu
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@793733e19ca7bd6d73eb51bebb20668ed7fa8422 -
Trigger Event:
push
-
Statement type: