Bug 11231 - fdisk reread partition table fails
Summary: fdisk reread partition table fails
Status: NEW
Alias: None
Product: Busybox
Classification: Unclassified
Component: Networking (show other bugs)
Version: unspecified
Hardware: All Linux
: P5 normal
Target Milestone: ---
Assignee: unassigned
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-08-14 10:10 UTC by Olliver Schinagl
Modified: 2018-08-14 10:10 UTC (History)
1 user (show)

See Also:
Host:
Target:
Build:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Olliver Schinagl 2018-08-14 10:10:12 UTC
In our current test setup, we create a docker container where we have a simple file (created with dd if=/dev/zero) which we use fdisk on to create partitions on.

This works, until fdisk tries to re-read the partition table. This fails! with a warning and the exit code is non-null.

As we want to do more partitions from the script, we now have to resolve to using fdisk || true which is non-ideal, as other errors also get skipped.

It seems that fdisk opens de fd to the image file (which I'm reasonably sure also happens with a real disk) does its operation but when calling a re-read of the partition table, the file is still opened by fdisk/busybox.

Using the partprobe applet on the image file works fine without fdisk running.

I suspect that the fdisk 'write_table' command should probably close the file, write, reread and reopen the file rather then the current write and reread.