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

Need to check to see if a disk is mounted before using it. #39

Open
dvalinrh opened this issue Apr 3, 2025 · 3 comments
Open

Need to check to see if a disk is mounted before using it. #39

dvalinrh opened this issue Apr 3, 2025 · 3 comments

Comments

@dvalinrh
Copy link
Contributor

dvalinrh commented Apr 3, 2025

We are running into a situation where disks get renamed on the system (install usually), and when the scenario file is used it ends up overwriting the boot disk. We need to check to see if the device is in use. If so, abort the script with the appropriate message. The grab_disks util can be used to get a list of the devices that are currently not mounted.

@frival
Copy link

frival commented Apr 3, 2025

Note that grab_disks won't necessarily work for bare metal systems because there could be e.g. SAS disks meant for OS installs that aren't yet used but also shouldn't be used for a NVMe-based benchmark. We could add another feature to grab_disks to only take a certain type of disk but that also won't solve 100% of the issues as we have bare metal hosts that use e.g. M.2 NVMe drives for boot and those shouldn't be selected for benchmarking either.

TL;DR: I think we have to take whatever the user says to use (what we do now) but also "first do no harm" and not destroy any in-use disks. Wiping out the OS install really gives the whole ecosystem a bad look and is a really negative user experience. We could add a "--dude_trust_me" option to use drives that persist in reporting as in-use that actually aren't if we really wanted to but I'd like to see a use case before suggesting that.

@malucius-rh
Copy link
Contributor

There's already a call to the "detect_mounts" tool, right after we check for "block device-ness," so we should be picking up anything currently mounted. It may make sense to add an "I see LVM partitions on the disk and they might be important" check.

@dvalinrh
Copy link
Contributor Author

dvalinrh commented Apr 7, 2025

maybe use fdisk -l . If there is a Type associated with the partition, we abort. Allow an option to ignore that particular enforcement. Lets talk about it at the team meeting.

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

No branches or pull requests

3 participants