# drewsif/pishrink

**Attribution required: if you use, quote, or summarise this content, you must credit and link back to [awesome-repositories.com](https://awesome-repositories.com/repository/drewsif-pishrink).**

3,931 stars · 695 forks · Shell · mit

## Links

- GitHub: https://github.com/Drewsif/PiShrink
- awesome-repositories: https://awesome-repositories.com/repository/drewsif-pishrink.md

## Topics

`pi-image` `raspberry-pi` `raspberrypi` `sd-card` `shell-script`

## Description

PiShrink is a disk image shrinking tool and Linux filesystem optimizer. It reduces the size of disk images to their minimum requirements and configures the filesystem to automatically expand to the full capacity of the storage medium upon the first boot.

The utility provides parallel image compression, utilizing multiple CPU cores to apply gzip or xz compression to large disk image files. It also includes filesystem error repair capabilities to resolve corruption that may otherwise block the shrinking process.

The project covers disk image optimization and management, focusing on reducing storage footprints for portable disk images and virtual drives.

## Tags

### System Administration & Monitoring

- [Filesystem Shrinking Tools](https://awesome-repositories.com/f/system-administration-monitoring/filesystem-metadata-inspection/filesystem-shrinking-tools.md) — Modifies internal partition tables and filesystem metadata to reduce image size without corrupting data.
- [Disk Image Shrinking](https://awesome-repositories.com/f/system-administration-monitoring/disk-image-shrinking.md) — Reduces a disk image to its minimum size and configures it to expand to the full capacity on boot. ([source](https://github.com/Drewsif/PiShrink#readme))

### Part of an Awesome List

- [Disk Image Optimization](https://awesome-repositories.com/f/awesome-lists/devtools/compression/disk-image-optimization.md) — Reduces the size of disk images to save storage and allow them to expand automatically on first boot.
- [Parallel Disk Image Compression](https://awesome-repositories.com/f/awesome-lists/devtools/compression/disk-image/parallel-disk-image-compression.md) — Applies high-level compression to disk images using parallel processing across multiple CPU cores. ([source](https://github.com/Drewsif/PiShrink#readme))
- [Parallel Disk Image Compressors](https://awesome-repositories.com/f/awesome-lists/devtools/compression/disk-image/parallel-disk-image-compressors.md) — Uses multiple CPU cores to apply gzip or xz compression to large disk image files.
- [Disk Image Archiving](https://awesome-repositories.com/f/awesome-lists/devtools/compression/xz/disk-image-archiving.md) — Provides gzip or xz compression for processed image files using parallel processing to accelerate output. ([source](https://github.com/Drewsif/PiShrink/blob/master/README.md))
- [Parallel Compression Tools](https://awesome-repositories.com/f/awesome-lists/devtools/file-compression/parallel-compression-tools.md) — Distributes heavy compression tasks across multiple CPU cores to reduce the processing time of large image files.
- [Development Tools](https://awesome-repositories.com/f/awesome-lists/devtools/development-tools.md) — Automated script to shrink images and expand them on first boot.
- [System Utilities](https://awesome-repositories.com/f/awesome-lists/devtools/system-utilities.md) — Bash script to automatically shrink and resize disk images.

### Operating Systems & Systems Programming

- [Block-Level Image Analysis](https://awesome-repositories.com/f/operating-systems-systems-programming/block-level-image-analysis.md) — Iterates through disk image blocks to identify and remove empty sectors while preserving filesystem structure.
- [Filesystem Resize Scripts](https://awesome-repositories.com/f/operating-systems-systems-programming/boot-configuration-injection/filesystem-resize-scripts.md) — Injects configuration that triggers the filesystem to resize to full disk capacity during the first boot.
- [Filesystem Compression Optimizers](https://awesome-repositories.com/f/operating-systems-systems-programming/filesystem-compression-optimizers.md) — Repairs filesystem errors and optimizes storage footprints for portable disk images and virtual drives.
- [Filesystem Repair Utilities](https://awesome-repositories.com/f/operating-systems-systems-programming/filesystem-repair-utilities.md) — Performs filesystem checks and applies advanced repair options to fix corrupted data encountered during shrinking. ([source](https://github.com/Drewsif/PiShrink/blob/master/README.md))
- [Raspberry Pi Image Optimization](https://awesome-repositories.com/f/operating-systems-systems-programming/raspberry-pi-systems-programming/raspberry-pi-image-optimization.md) — Reduces the size of a Raspberry Pi disk image to its minimum requirements to save storage. ([source](https://github.com/Drewsif/PiShrink/blob/master/Dockerfile))
- [Disk Image Shrinkers](https://awesome-repositories.com/f/operating-systems-systems-programming/system-administration-maintenance/disk-image-shrinkers.md) — Reduces the size of disk images to their minimum requirements and configures filesystems to expand on boot.
- [Disk Image Compression Pipelines](https://awesome-repositories.com/f/operating-systems-systems-programming/disk-image-compression-pipelines.md) — Sequentially applies block-level shrinking followed by gzip or xz compression to maximize total space savings.

### Scientific & Mathematical Computing

- [Filesystem Error Correction](https://awesome-repositories.com/f/scientific-mathematical-computing/high-performance-execution-environments/quantum-computing/quantum-error-decoding/state-error-correction/filesystem-error-correction.md) — Runs repeated filesystem checks and repair operations to resolve corruption that blocks the shrinking process.
