A modern, graphical partition manager for PGSD, FreeBSD and GhostBSD, similar to GParted but designed specifically for BSD systems. Built with Go and the Fyne UI framework.
- PGSD, FreeBSD 14.0 or later, or GhostBSD
- Root privileges (for partition operations)
- X11 or Wayland display server
- Go 1.18 or later
- GCC or Clang (for Fyne CGO dependencies)
- Required system packages:
pkg install go gcc git pkgconf mesa-libs libglvnd
- e2fsprogs: For ext2/ext3/ext4 filesystem formatting
pkg install e2fsprogs
- fusefs-ntfs: For NTFS filesystem formatting
pkg install fusefs-ntfs
- smartmontools: For detailed disk information and SMART status monitoring
pkg install smartmontools
-
Clone the repository:
git clone https://github.com/pgsdf/pgpart.git cd pgpart -
Install dependencies:
go mod tidy
-
Build and install the application:
sudo make install
GUI Mode (default):
For full functionality, run with root privileges:
sudo ./pgpartOr if installed system-wide:
sudo pgpartCLI Mode:
PGPart can also be used from the command line for scripting and automation:
sudo pgpart <command> [options]PGPart supports the following CLI commands:
pgpart listDisplays a formatted table of all disks, their partitions, sizes, filesystems, and mount points.
pgpart create <disk> <size> <fstype>Examples:
pgpart create ada0 10G ufs # Create 10GB UFS partition
pgpart create ada0 512M swap # Create 512MB swap partition
pgpart create nvd0 20G ext4 # Create 20GB ext4 partitionSupported filesystems: ufs, fat32, ext2, ext3, ext4, ntfs
pgpart delete [-f] <disk> <index>Examples:
pgpart delete ada0 3 # Delete partition 3 (with confirmation)
pgpart delete -f ada0 3 # Force delete without confirmationWarning: Deletion is permanent and cannot be undone!
pgpart format [-f] <partition> <fstype>Examples:
pgpart format ada0p3 ext4 # Format partition 3 as ext4
pgpart format -f nvd0p2 ufs # Force format without confirmationWarning: Formatting destroys all data on the partition!
pgpart resize <disk> <index> <size>Examples:
pgpart resize ada0 2 20G # Resize partition 2 to 20GB
pgpart resize ada0 1 512M # Resize partition 1 to 512MBpgpart copy <source> <dest>Example:
pgpart copy ada0p1 ada0p2 # Copy partition 1 to partition 2Shows real-time progress during the copy operation.
pgpart info <disk>Example:
pgpart info ada0 # Show SMART status and disk detailsDisplays:
- Disk model and serial number
- Temperature and power-on hours
- SMART status and attributes
- Disk capabilities (TRIM support, SSD/HDD type)
pgpart align <disk|partition>Examples:
pgpart align ada0 # Check all partitions on ada0
pgpart align ada0p1 # Check specific partitionDisplays alignment status for each partition:
- Start offset in sectors and bytes
- Alignment type (4 KiB, 128 KiB, 1 MiB, 4 MiB, or misaligned)
- Performance recommendations
- Summary of aligned vs. misaligned partitions
Why Alignment Matters:
- Modern disks use 4K physical sectors (Advanced Format)
- SSDs have erase block sizes (128 KiB - 4 MiB)
- Misaligned partitions cause performance degradation
- 1 MiB alignment recommended for optimal performance
GPT partitions support special attributes that control boot behavior and partition properties.
List current attributes:
pgpart attr-list <partition>Set an attribute:
pgpart attr-set <partition> <attribute>Unset an attribute:
pgpart attr-unset <partition> <attribute>Available Attributes:
bootme- Platform required/system partition (marks partition as bootable)bootonce- Boot from this partition once, then clear the flagbootfailed- Indicates partition failed to bootnoblockio- Disable block I/O protocol for this partition
Examples:
pgpart attr-list ada0p1 # List all attributes for ada0p1
pgpart attr-set ada0p1 bootme # Mark ada0p1 as bootable
pgpart attr-unset ada0p1 bootonce # Remove bootonce flagImportant Notes:
- GPT attributes are only supported on GPT-partitioned disks
- MBR and BSD disklabel partitions do not support these attributes
- The
bootmeattribute is commonly used to mark EFI system partitions - Setting
bootonceis useful for testing new boot configurations
- Launch the application
- Select a disk from the left panel
- View partition layout and details in the right panel
- Select a disk
- Click the "New Partition Table" button in the toolbar
- Choose the partition scheme (GPT, MBR, or BSD)
- Confirm the operation
Warning: This will destroy all existing data on the disk!
- Select a disk with an existing partition table
- Click the "New Partition" button
- Enter the size in MB
- Select the partition type:
freebsd-ufs: FreeBSD UFS filesystemfreebsd-swap: Swap partitionfreebsd-zfs: ZFS partitionms-basic-data: FAT32/NTFS compatible
- Click "Create"
- Select a disk
- Click the "Delete Partition" button
- Select the partition to delete
- Confirm the operation
Method 1: Visual Drag Handles
- Select a disk with partitions
- View the partition layout visualization
- Drag the resize handles on the left or right edge of a partition
- Release to see the resize confirmation dialog
- Confirm to apply the resize operation
Method 2: Resize Dialog
- Select a disk
- Click the "Resize Partition" button in the toolbar
- Select the partition to resize
- Use the slider or enter the new size in MB
- Review the preview showing current size, new size, and difference
- Confirm the operation
Important Notes:
- The dialog shows minimum and maximum allowed sizes
- You cannot resize a partition to overlap with adjacent partitions
- Minimum size is 10 MB
- Maximum size extends to the next partition or end of disk
- Warning: Resizing may result in data loss. Always backup first!
- Select a disk
- Click the "Format" button
- Select the partition
- Choose the filesystem type:
- UFS (native FreeBSD filesystem)
- FAT32 (compatible with Windows/Linux)
- ext2/ext3/ext4 (Linux filesystems - requires e2fsprogs package)
- NTFS (Windows filesystem - requires fusefs-ntfs package)
- Confirm the operation
Important Notes:
- Warning: Formatting will destroy all data on the partition!
- ext2/ext3/ext4 formatting requires:
pkg install e2fsprogs - NTFS formatting requires:
pkg install fusefs-ntfs - If required packages are missing, you'll see an error message with installation instructions
- ZFS pools must be created using the
zpool createcommand directly
- Click the "Copy Partition" button in the toolbar
- Select the source partition (partition to copy from)
- Select the destination partition (where to copy to)
- Review the warning - destination data will be overwritten
- Confirm the operation
- Monitor the progress bar during the copy operation
Important Notes:
- Destination partition must be equal or larger than source
- All data on the destination partition will be destroyed
- The operation may take several minutes depending on partition size
- Progress is shown with percentage and elapsed time
- Source partition remains unchanged (read-only operation)
- Click the "Move Partition" button in the toolbar
- Select the source partition (partition to move)
- Select the destination partition (where to move to)
- Review the warning - this will copy data and delete source
- Confirm the operation
- Monitor the progress during the move operation
Important Notes:
- Move = Copy + Delete source partition
- Destination must be equal or larger than source
- Source partition will be deleted after successful copy
- All data on destination will be destroyed
- Cannot be undone - ensure you have backups!
- Operation may take several minutes
- Select a disk from the left panel
- Click the "Disk Info" button in the toolbar
- View comprehensive disk information in the tabbed dialog:
- General: Model, serial number, firmware version, capacity, temperature, power-on hours
- SMART Status: Overall health status with color-coded indicators (green=PASSED, red=FAILED, orange=UNKNOWN)
- SMART Attributes: Detailed list of all SMART attributes with current values, worst values, thresholds, and status
- Capabilities: Disk type (SSD/HDD), TRIM support, and other features
Important Notes:
- Requires smartmontools package:
pkg install smartmontools - Temperature warnings appear if disk temperature exceeds 60°C
- SMART data requires the disk to support SMART monitoring
- Some attributes may not be available on all disk models
Batch operations allow you to queue multiple partition operations and execute them sequentially:
- Click the "Batch Operations" button in the toolbar
- Add operations to the queue using the operation buttons:
- Add Format: Queue a partition format operation
- Add Delete: Queue a partition deletion
- Add Resize: Queue a partition resize operation
- Add Copy: Queue a partition copy operation
- Manage your queue:
- Remove Selected: Remove an operation from the queue
- Clear All: Remove all operations
- Move Up/Down: Reorder operations in the queue
- Configure execution options:
- Stop on error: Check to halt execution if any operation fails
- Uncheck to continue executing remaining operations after failures
- Click Execute All to run all queued operations
Operation Status Indicators:
- ⏸ Pending - Operation queued but not started
- ▶ Running - Operation currently executing
- ✓ Completed - Operation finished successfully
- ✗ Failed - Operation failed with error
Important Notes:
- Operations execute in queue order (top to bottom)
- All operations are destructive and cannot be undone
- Review your queue carefully before executing
- Progress bar shows overall completion across all operations
- Failed operations show error details in the status
- You can reorder operations before execution to optimize efficiency
Best Practices:
- Group similar operations together (e.g., all deletions, then all formats)
- Delete operations should typically come before create operations
- Format operations should come after partition creation
- Always verify source/destination for copy operations
- Use "Stop on error" for critical sequences where order matters
PGPart tracks partition operations and allows you to undo reversible changes:
Reversible Operations:
- Create Partition - Can be undone by deleting the created partition
- Resize Partition - Can be undone by resizing back to original size
Non-Reversible Operations (data destructive):
- Delete Partition - Cannot restore deleted data
- Format Partition - Cannot restore previous filesystem or data
- Copy Partition - Cannot "uncopy" data
- Move Partition - Cannot restore (source was deleted)
How to Use:
- Click the Undo button (◀) in the toolbar to reverse the last reversible operation
- Click the Redo button (▶) to re-apply an undone operation
- Confirm the undo/redo action in the dialog that appears
Important Limitations:
- Undo only reverses structural changes, not data
- Undoing a partition resize requires sufficient free space
- Operation history is lost when you close the application
- Some operations cannot be undone and are marked as such in history
- Always backup important data before performing partition operations
Click the "Refresh" button in the toolbar to rescan all disks.
The application is organized into the following packages:
main: Application entry point and theme configuration with GUI/CLI mode selectioninternal/partition: Core partition detection and managementpartition.go: Disk and partition detection using geom/gpartoperations.go: Partition operations (create, delete, format, resize)copy.go: Partition copying and moving with progress trackingdiskinfo.go: Detailed disk information and SMART status retrievalbatch.go: Batch operation queue management and executionhistory.go: Operation history tracking and undo/redo managementalignment.go: Partition alignment checking and optimizationattributes.go: GPT partition attribute management
internal/ui: User interface componentsmainwindow.go: Main application window and UI logicpartitionview.go: Interactive partition visualization with drag handlesresizedialog.go: Advanced resize dialog with slider and validationcopydialog.go: Copy and move partition dialogs with progress barsdiskinfodialog.go: Detailed disk information display with SMART databatchdialog.go: Batch operations queue manager with execution controlsattributesdialog.go: GPT attribute editing dialog with checkboxes
internal/cli: Command-line interface for scriptingcli.go: CLI command parser and handlers for all operations
PGPart uses the following FreeBSD system utilities:
geom: Disk geometry and informationgpart: Partition table manipulationnewfs: UFS filesystem creationnewfs_msdos: FAT filesystem creationmount: Mount point detectionfile: Filesystem type detectionfstyp: FreeBSD native filesystem detectiondiskinfo: Partition size informationdd: Disk data copying (with progress monitoring)sha256: Partition data verificationsmartctl: SMART status monitoring and disk health assessment
pgpart/
├── main.go # Application entry point (GUI/CLI mode)
├── theme.go # UI theme configuration
├── internal/
│ ├── partition/
│ │ ├── partition.go # Disk detection
│ │ ├── operations.go # Partition operations
│ │ ├── copy.go # Partition copying and moving
│ │ ├── diskinfo.go # SMART status and disk info
│ │ ├── batch.go # Batch operation queue
│ │ ├── history.go # Undo/redo history tracking
│ │ ├── alignment.go # Partition alignment checking
│ │ └── attributes.go # GPT attribute management
│ ├── ui/
│ │ ├── mainwindow.go # Main UI
│ │ ├── partitionview.go # Partition visualization
│ │ ├── resizedialog.go # Resize dialog
│ │ ├── copydialog.go # Copy/move dialogs
│ │ ├── diskinfodialog.go # Disk information dialog
│ │ ├── batchdialog.go # Batch operations manager
│ │ └── attributesdialog.go # GPT attributes editor
│ └── cli/
│ └── cli.go # Command-line interface
├── go.mod # Go module definition
└── README.md # This file
go run .go test ./...Contributions are welcome! Please feel free to submit a Pull Request.
This project is licensed under the BSD 2-Clause License.
Copyright (c) 2025, Pacific Grove Software Distribution Foundation Author: Vester (Vic) Thacker
See the LICENSE file for full license details.
USE AT YOUR OWN RISK! Partition operations can result in data loss if used incorrectly. Always backup important data before performing partition operations.
For issues, questions, or contributions, please visit: https://github.com/pgsdf/pgpart