Skip to content

Hardware Storage Discovery

fparted discovers storage devices by scanning the Linux kernel sysfs subsystem, querying /sys/block/*, and correlating raw block devices with parted machine-readable output and blkid tags.


🔍 Discovery Pipeline

/sys/block/* Scan
Filter Virtual / Android Loopbacks (e.g. dm-*, zram*)
Resolve Base Disk vs Partition Device Nodes
Query parted -s <dev> unit B print (Geometry, Sector Sizes, Partitions)
Query blkid -c /dev/null -o export <dev> (UUID, Filesystem Type, Label)
Query /proc/mounts (Mountpoints, Read-Only Flags)
Assemble Immutable Disk Model Object

💽 Device Categorization & Visual Indicators

fparted automatically classifies storage hardware into distinct types with tailored visual iconography and safety rules:

Category Device Node Patterns Icon / Treatment
Internal Storage mmcblk0, sda..sdh, nvme0n1, ufs Dedicated Internal Drive icon. Protected by high-risk prompts.
Removable Media sdcard*, mmcblk1, sd[a-z] with USB bus Removable Drive badge with USB indicator.
Loop / Virtual Disks /dev/loop[0-9]* Optical/Disc icon. Safe for development & test fixtures.
Optical / CD-ROM sr[0-9]*, cdrom, dvd Disc icon. Read-only flags enforced automatically.

📐 Parsed Device Properties

Each discovered device exposes comprehensive geometry and hardware metadata: - Canonical Device Node: /dev/block/sda, /dev/block/mmcblk0, etc. - Model & Vendor: Hardware identification string (e.g., Samsung Flash Drive FIT, Micron UFS 3.1). - Disk Size: Exact byte capacity represented via high-precision DataSize and integer bytes. - Sector Sizes: Logical and physical sector boundaries (e.g., 512B / 4096B Advanced Format). - Partition Table: Current disk label format (gpt, msdos, loop, unknown). - Maximum Partitions: Supported table limit.