Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create external disk-probe crate for probing information on disks #172

Open
mmstick opened this issue Mar 5, 2019 · 0 comments
Open

Create external disk-probe crate for probing information on disks #172

mmstick opened this issue Mar 5, 2019 · 0 comments

Comments

@mmstick
Copy link
Member

mmstick commented Mar 5, 2019

The end goal is to remove all disk probing logic from distinst, so that it can focus on installations. A crate for probing disk information can be created which will probe information quickly. Currently, distinst uses a mixture of parted (extremely slow at probing), accessing info from /sys/class/block, and shelling out to external commands (error-prone / slow).

Distinst should only use parted when it needs to partition disks. The disk-probing functionality in parted is extremely slow. So slow, in fact, that it can take up to entire minute to complete one probe on some systems. This makes the UI of the installer very unresponsive, as it needs to reload information from time to time.

The /proc/partitions file contains a list of available partitions, and their

  • MAJOR / MINOR
  • BLOCKS
  • NAME

On Linux, libblkid can be used to get the following info from /dev/$NAME:

  • FSTYPE
  • UUID
  • PARTTYPE
  • PARTUUID
  • PARTFLAGS
  • LABEL
  • PARTTABLE
  • START
  • OFFSET
  • SECTOR_SIZE
  • SECTOR_COUNT

We already have a proc-mounts crate which can be used to reference mount points.

Linux provides a /sys/class/block interface which gives access to:

  • DMNAME (/dm/name)
  • DMUUID (/dm/uuid)
  • MODEL
  • SERIAL
  • VENDOR
  • Slaves (/slaves)
  • everything else

The end goal should be to gather all this information in a meaningful way, so that we can get an output similar to lsblk, which could be used as the basis for a disk management library (ecs-disk-manager). This crate should work closely with our disk-types crate, and then ultimately integrate itself within ecs-disk-manager to replace the udisks daemon.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant