Skip to main content

Library used to build simple disk images with multiple partitions

Project description

How to use

See examples/

Dependencies

Debian/Ubuntu

# Common
$ sudo apt install python3-parted python3-distutils
# FAT support
$ sudo apt install dosfstools mtools
# ext* support
$ sudo apt install e2fsprogs
# All
$ sudo apt install python3-parted python3-distutils dosfstools mtools e2fsprogs

Fedora/CentOS

# Common
$ sudo dnf install python3-pyparted
# FAT support
$ sudo dnf install dosfstools mtools
# ext* support
$ sudo dnf install e2fsprogs
# All
$ sudo dnf install python3-pyparted dosfstools mtools e2fsprogs

Known issues

mtools and debugfs is not good at error reporting, so if a copy fails it might not show until you try to mount the image.

Parted misbehaves on some platforms (Debian 10), and shrinks partitions. Use Sfdisk instead. Additionally, some FAT implementations expect the file system to have exactly the same size as the partition, and thus padding them will not work, unless done exactly.

copy_file_range seems to misbehave in containers sometimes, observed on Fedora 30 + podman with Debian 10 container where it skips to copy some data.

Future

  • Configurable alignment, defaulting to 1MiB
  • Optional cleaning ("always", "not on error", "never")
  • Proper naive copy_file_range function, using dup()
  • Integrated and automated tests
  • GPT for sfdisk partitioner
  • Multiboot images (iso, efi, bios)

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

simplediskimage-0.2.tar.gz (12.4 kB view details)

Uploaded Source

Built Distribution

simplediskimage-0.2-py3-none-any.whl (15.7 kB view details)

Uploaded Python 3

File details

Details for the file simplediskimage-0.2.tar.gz.

File metadata

  • Download URL: simplediskimage-0.2.tar.gz
  • Upload date:
  • Size: 12.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.45.0 CPython/3.7.6

File hashes

Hashes for simplediskimage-0.2.tar.gz
Algorithm Hash digest
SHA256 c802607376ebeabb3b25b45a745d83eae1a621d57815c932f2ce3d9e0b9144bf
MD5 f52a9d8689a53f63073258ff7219ec26
BLAKE2b-256 5a4ad24431af2e333359ab3c8c2777357defdd2badb39b3168e29f766f19acb2

See more details on using hashes here.

File details

Details for the file simplediskimage-0.2-py3-none-any.whl.

File metadata

  • Download URL: simplediskimage-0.2-py3-none-any.whl
  • Upload date:
  • Size: 15.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.45.0 CPython/3.7.6

File hashes

Hashes for simplediskimage-0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 22230bc369c851ecf86aab5f7bb0b835160c68dc87f83d24a75aed5c23dad3d9
MD5 8a84cff4d605a4d79f9250816381e0a5
BLAKE2b-256 aaac93c31aeb7532f17be463968b7daece863b344e948d76f1a5eb6faa7a25e4

See more details on using hashes here.

Supported by

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