From 76c6f607dae350f6a03356cfc4904869b3819729 Mon Sep 17 00:00:00 2001 From: boyamurthy <92081029+boyamurthy@users.noreply.github.com> Date: Wed, 13 Sep 2023 15:19:24 +0530 Subject: [PATCH] Adding_Partprobe_cmd (#29) --- gofsutil_mount_linux.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/gofsutil_mount_linux.go b/gofsutil_mount_linux.go index b01b915..8f21de6 100644 --- a/gofsutil_mount_linux.go +++ b/gofsutil_mount_linux.go @@ -575,10 +575,10 @@ func reReadPartitionTable(ctx context.Context, devicePath string) error { if err := validatePath(path); err != nil { return fmt.Errorf("Failed to validate path: %s error %v", devicePath, err) } - args := []string{"--rereadpt", path} - _, err := exec.Command("blockdev", args...).CombinedOutput() + args := []string{path} + _, err := exec.Command("partprobe", args...).CombinedOutput() if err != nil { - log.Errorf("Failed to execute blockdev on %s: %v", devicePath, err) + log.Errorf("Failed to execute partprobe on %s: %s", devicePath, err.Error()) return err } return nil