Custom Device Targets¶
In addition to automatic hardware discovery, fparted allows power users and developers to attach custom block device targets (such as loopback image mounts, external SCSI controllers, or network block devices).
🎯 Adding a Custom Device¶
Users can invoke the Add Custom Device action via the Navigation Rail or the keyboard shortcut Ctrl+N / Cmd+N.
Validation Preconditions¶
Before adding a device target to the active list, fparted performs preflight checks:
1. Device Existence: Verifies that the path exists in the filesystem and represents a valid block device or raw disk image.
2. Canonical Resolution: Resolves symlinks (e.g., /dev/block/bootdevice/by-name/... to /dev/block/mmcblk0p...).
3. Partition-to-Base Mapping: If the user inputs a partition node (/dev/block/sda1), fparted resolves the parent disk node (/dev/block/sda) and loads the entire disk structure.
4. Duplicate Prevention: Rejects paths that are already loaded in the active session.
5. Geometry Probing: Probes sector size and capacity before creating the UI entry.
sequenceDiagram
participant User
participant Dialog as Add Device Dialog
participant Probe as Storage Probe
participant State as Application State
User->>Dialog: Enters "/dev/block/loop0"
Dialog->>Probe: Verify block device & probe geometry
Probe->>Probe: Query parted & blkid
alt Valid Block Target
Probe-->>Dialog: Return Disk model
Dialog->>State: Add to loaded disks list & select
Dialog->>User: Close dialog & navigate to new disk
else Invalid Target or Probe Failure
Probe-->>Dialog: Error (e.g. permission denied or invalid geometry)
Dialog->>User: Display actionable error message
end