Skip to main content

Library used to build simple disk images with multiple partitions

Project description

How to use

See examples/ or https://simplediskimage.readthedocs.io/en/latest/

Available on PyPI (pip install simplediskimage) or https://pypi-hypernode.com/project/simplediskimage/

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 filesystem 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 ideas

  • Configurable alignment, defaulting to 1MiB
  • Proper naive copy_file_range function, using dup()
  • GPT for sfdisk partitioner (and set it as the default)
  • sgdisk support?
  • Multiboot images (iso, efi, bios)
  • MTD-type partitions: Only offsets and a possibility to get a mtdparts=-type string
  • Fix travis pylint import fail

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.4.1.linux-x86_64.tar.gz (28.7 kB view details)

Uploaded Source

File details

Details for the file simplediskimage-0.4.1.linux-x86_64.tar.gz.

File metadata

  • Download URL: simplediskimage-0.4.1.linux-x86_64.tar.gz
  • Upload date:
  • Size: 28.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/2.0.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.6.0 requests-toolbelt/0.9.1 tqdm/4.50.0 CPython/3.8.6

File hashes

Hashes for simplediskimage-0.4.1.linux-x86_64.tar.gz
Algorithm Hash digest
SHA256 4d1cbebc8108e6f80053ee7e2ff17d48368b4927225397a77976fb44306dfe1d
MD5 69f4a91f3da85ec4ee472406289e74e1
BLAKE2b-256 75dae8302ed112bdaa54f3c1bd8f5e4b5f9050c73658e2b87b01a4b1b5249e3e

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