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

NAS-130084 / 24.10 / try to help partition detection #88

Merged
merged 1 commit into from
Jul 17, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions truenas_installer/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,15 @@ async def get_partitions(
else:
tries = min(tries, MAX_PARTITION_WAIT_TIME_SECS)

# by the time this function is called, partitions should have been
# written to the disk. However, it doesn't mean the kernel/udev has
# updated the various symlinks in sysfs. We'll open the block device
# in write mode. This should send a kernel and udev change event for
# the device and any partitions as well. Ideally, this will help bubble
# up the events so sysfs is populated before the logic below kicks in
with open(device, 'w'):
pass

disk_partitions = {i: None for i in partitions}
device = device.removeprefix('/dev/')
for _try in range(tries):
Expand Down
Loading