Privileged interfaces request for the unofficial Mikaey's Flash Stress Test snap(block-devices)

name: mfst
description: Flash media stress test program
snapcraft: https://github.com/brlin-tw/mfst/blob/impl-snap-packaging-with-patches/snap/snapcraft.yaml
upstream: https://github.com/mikaey/mfst
upstream-relation: >
  No formal relationship but I have been contributing patches:
  https://github.com/mikaey/mfst/pull/9
plugs:
  block-devices:
    request-type: auto-connection
    reasoning: >
      The core functionality of this application is to directly access
      raw block devices for testing, see https://github.com/mikaey/mfst#warning

  raw-usb:
    request-type: auto-connection
    reasoning: >
      This interface is required to issue USBDEVFS_RESET ioctls to reset
      USB flash media on communication failures, see
      <https://github.com/mikaey/mfst/blob/b2e61b66a19931712e8b3a8734f77505a3b81a4d/device.c#L1097>
      for the actual logic of doing so.

This request has been added to the queue for review by the @reviewers team.

Hey @Lin-Buo-Ren

Both interfaces are highly privileged and I believe the best we can do as of now is granting manual-connection. Given the group of users that this application is targeting, I expect them to be able to issue the required snap connect commands without major issues, specially if snapctl is-connected is used to detect and inform the user when the interfaces are not connected during application startup

A program to stress test flash media to the point of failure

Could you please also explain what this exactly means? Is the device still usable after running this program?

1 Like

I can work with that, please proceed.

All flash-based storage mediums are expected to fail after certain amount of writes, one of the features of this utility is to explore the limits of these devices to compare them between products and brands, see On the Capacity, Performance, and Reliability of microSD Cards – Matt Cole for what this utility is meant to be used for.

Aside from endurance test, this utility also tests:

  • Whether the storage devices have falsely advertised their storage capacity.
  • Whether the storage devices are qualified to certain industrial performance classes.
  • General data storage reliability(whether the data will be corrupted afterwards)

Here’s a screenshot of the utility in action:

The device should still be usable as long as one don’t leave the utility running against it for prolonged periods(the previously stored data will be destroyed, though, as shown in the explicitly long command option and the extensive warning screen on launch when it is not specified).

Thanks for clarifying the purpose of the tool and outlining the safety details regarding storage endurance. Suggesting a manual-connection approach with proper startup checks makes total sense for a utility like this, given how destructive and intensive flash stress testing can be. Looking forward to seeing this review progress!

1 Like

All flash-based storage mediums are expected to fail after certain amount of writes, one of the features of this utility is to explore the limits of these devices to compare them between products and brands

@Lin-Buo-Ren I understand the use case, I just think it would be good to make it explicit in the both, the snap description and the startup message shown when the interfaces are not connected. I just want to prevent users to accidentally break their devices.

Besides that, +1 from me for granting mfst manual connection to block-devices interface. It should be possible to connect raw-usb interface manually by default

1 Like

I’ve added the following passage to the snap’s description:

Warning

This program is DESTRUCTIVE. It is designed to stress test storage devices (particularly flash media) to the point of failure. If you let this program run for long enough, it WILL completely destroy the device and render it completely unusable. Do not use it on any storage devices that you care about.

as for the startup message, the application itself already presents the same warning on startup:

which should suffice.

I’ve also implemented plug connection detection in the launcher: https://gitlab.com/brlin/mfst-snap/-/blob/main/snap/local/launchers/mfst-wrapper.sh?ref_type=heads#L8-L28

+1 from me as well to grant manual-connection of block-devices interfaces to mfst

+2 votes for, 0 votes against, Granting manual-connection of block-devices interface to mfst. This is now live.

1 Like