whatisgithub

What is pve-disk-shrink?

garfieldttt/pve-disk-shrink — explained in plain English

Analysis updated 2026-05-18

34ShellAudience · ops devopsComplexity · 4/5Setup · moderate

In one sentence

A dialog based command line tool that safely shrinks a Proxmox VE virtual machine or container disk entirely offline, without GParted.

Mindmap

mindmap
  root((pve-disk-shrink))
    What it does
      Shrinks VM disks
      Shrinks container volumes
      Offline on the host
    Tech stack
      Shell script
      Proxmox VE tools
      sgdisk and resize2fs
    Use cases
      Reclaim unused disk space
      Shrink ext or NTFS filesystems
      Shrink ZFS qcow2 or Ceph storage
    Audience
      Proxmox administrators
      Homelab users
      System administrators

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

What do people build with it?

USE CASE 1

Shrink an oversized VM disk on Proxmox VE without booting a live ISO or using GParted.

USE CASE 2

Reclaim free space after the last partition on a guest disk safely.

USE CASE 3

Shrink a container's ZFS subvol quota without touching its filesystem.

USE CASE 4

Preview a shrink plan with a dry run before making any real changes.

What is it built with?

ShellProxmox VEZFSLVMCeph/RBDNTFSGPT

How does it compare?

garfieldttt/pve-disk-shrinksoroushyasini/proxysmithdhruvdubey17/ai-guru
Stars343435
LanguageShellShellShell
Setup difficultymoderatemoderateeasy
Complexity4/53/51/5
Audienceops devopsops devopsgeneral

Figures from each repo's GitHub metadata at analysis time.

How do you get it running?

Difficulty · moderate Time to first run · 30min

Must be run as root on a Proxmox VE node with standard PVE utilities, creates no backup so a current backup is required first.

No license information is given in the source material.

So what is it?

This is a command line tool for people running Proxmox VE, a virtualization platform, who need to shrink the disk of a virtual machine or a container. It replaces the older manual method of booting a live Linux ISO and dragging partitions around in GParted. Instead, everything runs directly on the Proxmox host while the guest is stopped, using a text based dialog menu to walk you through the choices. The tool figures out the volume, the storage backend, and the partition layout on its own. It will never let you shrink a disk smaller than the actual data on it plus a safety margin you choose, which protects you from creating a disk too small to hold what is already there. Depending on the setup, it can check and shrink filesystems like ext2, ext3, ext4, and NTFS, resize partitions while keeping their identity and boot settings intact, and then shrink the underlying storage, whether that is a ZFS volume, a qcow2 image, a raw LVM volume, or Ceph storage. Certain situations are deliberately refused rather than guessed at. XFS filesystems cannot be shrunk directly, though a volume group containing XFS can still be shrunk if there is free space elsewhere in the group. Encrypted volumes like BitLocker are left untouched, and you are told to shrink or disable encryption inside Windows first. Old style MBR partition tables must be converted to GPT before the tool proceeds, and any snapshots on the guest are deleted since they block a shrink from happening at all. Before making real changes, the tool shows a full summary of what it plans to do and asks for confirmation, and it also offers a dry run mode that shows the plan without touching anything. Every step is logged to a file, and the original partition layout is saved before any change so it can be manually restored if something goes wrong. Cleanup on exit or error always removes any temporary devices or mappings it created. This tool must be run as root on a Proxmox VE node and needs standard PVE and Linux utilities already present on most installs, offering to install a few extras like ntfs-3g when required. It creates no backup on its own, so anyone using it should have a current backup ready before starting, since a shrink operation like this always carries some risk to the data.

Copy-paste prompts

Prompt 1
Help me run pve-disk-shrink in dry run mode to preview a VM disk shrink plan before applying it.
Prompt 2
Explain what pve-disk-shrink does differently from the manual GParted live ISO method.
Prompt 3
Walk me through the safety checks pve-disk-shrink performs before it shrinks an NTFS or ext4 filesystem.
Prompt 4
Show me how to recover a Proxmox guest if a GPT verification error stops a pve-disk-shrink run.

Frequently asked questions

What is pve-disk-shrink?

A dialog based command line tool that safely shrinks a Proxmox VE virtual machine or container disk entirely offline, without GParted.

What language is pve-disk-shrink written in?

Mainly Shell. The stack also includes Shell, Proxmox VE, ZFS.

What license does pve-disk-shrink use?

No license information is given in the source material.

How hard is pve-disk-shrink to set up?

Setup difficulty is rated moderate, with roughly 30min to a first successful run.

Who is pve-disk-shrink for?

Mainly ops devops.

Open on GitHub → Ask about another repo

This repo across BitVibe Labs

Verify against the repo before relying on details.