Run partprobe when partitions do not appear

This commit is contained in:
Vitaliy Filippov
2022-08-18 02:05:16 +03:00
parent 40d8d65188
commit c0d5e83fb8
4 changed files with 44 additions and 9 deletions
+2 -2
View File
@@ -206,10 +206,10 @@ int write_zero(int fd, uint64_t offset, uint64_t size)
json11::Json read_parttable(std::string dev)
{
std::string part_dump;
int r = shell_exec({ "/sbin/sfdisk", "--dump", dev, "--json" }, "", &part_dump, NULL);
int r = shell_exec({ "sfdisk", "--dump", dev, "--json" }, "", &part_dump, NULL);
if (r == 255)
{
fprintf(stderr, "Error running /sbin/sfdisk --dump %s --json\n", dev.c_str());
fprintf(stderr, "Error running sfdisk --dump %s --json\n", dev.c_str());
return json11::Json(false);
}
// Decode partition table