Skip to content

The Operations Queue: Staging & Safe Execution ⚙️

One of the defining safety features of fparted is its Two-Phase Operations Queue (modeled after desktop GParted).

When you resize a partition, create a filesystem, or change partition flags, nothing is written to your physical flash drive immediately. Instead, actions are staged into a virtual queue, and the interactive partition graph instantly updates to show you a virtual prediction of what your drive will look like.


1. How Staging Works

Think of the operations queue as an editable draft of your storage blueprint:

┌────────────────────────────────────────────────────────────────────────┐
│  Selected Disk: /dev/block/mmcblk1 (128 GiB MicroSD)                   │
│ ┌───────────────────────────┬────────────────────────────────────────┐ │
│ │ 1: EFI / FAT32 (512 MiB)  │ 2: RootFS / ext4 (64 GiB ➜ 96 GiB)     │ │ Virtual Graph Preview
│ └───────────────────────────┴────────────────────────────────────────┘ │
│                                                                        │
│  ⚙️ Pending Operations (2):                                             │
│  1. Expand partition 2 boundary from 64.0 GiB to 96.0 GiB              │
│  2. Grow ext4 filesystem on /dev/block/mmcblk1p2 to fill partition    │
│                                                                        │
│  [ ↩ Undo ]   [ 🗑️ Clear All ]                         [ ▶ Apply (2) ] │
└────────────────────────────────────────────────────────────────────────┘

Benefits of Staging

  • Experiment Without Fear: Try different partition sizes, test layouts, and delete or create partitions visually. If you change your mind, simply click Undo or Clear All—your real disk has not been touched.
  • Dependency Ordering: fparted automatically orders commands in the mathematically safe sequence (e.g. shrinking filesystems before partition boundaries, or expanding partition boundaries before filesystems).
  • Batch Execution: Perform multiple tasks (e.g. create table ➜ add 3 partitions ➜ format each with ext4/FAT32/Swap) in a single unified execution pass.

2. Managing the Queue

Action Shortcut Description
Undo Last Ctrl + Z Removes the most recently queued operation and updates the virtual graph.
Clear All Ctrl + Shift + Z Discards all pending operations and reverts the UI back to the physical drive state.
Inspect Plan Ctrl + P Opens the detailed side drawer showing low-level command parameters for every staged item.

3. Applying Changes: The Confirmation Gate

When you are ready to execute your plan on flash storage:

flowchart TD
    A["1. Tap Apply Button (Ctrl + Enter)"] --> B["2. Pre-Flight Validation Checks"]
    B --> C["3. Review Confirmation Dialog with Concrete Warnings"]
    C --> D["4. User Taps 'Apply Changes'"]
    D --> E["5. Privileged Root Executor Runs Plan Step-by-Step"]
    E --> F{"Any Step Fails?"}
    F -->|"Yes (Error)"| G["HALT IMMEDIATELY ➜ Rescan Hardware State"]
    F -->|"No (Success)"| H["Flush Kernel Buffers (sync) ➜ Final Rescan ➜ Ready"]

The Confirmation Dialog

  1. Tap Apply All (or press Ctrl + Enter).
  2. The Apply Operations Dialog opens, displaying:
  3. Target device node (e.g., /dev/block/mmcblk1).
  4. Warning badges for destructive actions (e.g., formatting, table deletion).
  5. The exact, ordered list of commands that will execute under root.
  6. Tap Apply Changes to confirm.
  7. The live progress bar tracks execution progress in real-time.

4. What Happens If a Command Fails?

In the rare event that a hardware failure or kernel error interrupts a command:

  1. Immediate Stop-on-Failure: fparted instantly halts the execution queue. It will never execute subsequent destructive commands on a broken state.
  2. Automatic Hardware Rescan: fparted queries the kernel to read the exact current sector state on flash, updating the UI to match reality.
  3. Actionable Diagnostics: An error report displays the executed binary name, exit code, and stdout/stderr output so you can diagnose the issue (e.g., dirty filesystem needing fsck, or bad sectors on flash).