diff --git a/pkg/util/paramtable/component_param.go b/pkg/util/paramtable/component_param.go index ed9c256ec9..63c92abc84 100644 --- a/pkg/util/paramtable/component_param.go +++ b/pkg/util/paramtable/component_param.go @@ -2267,9 +2267,15 @@ Max read concurrency must greater than or equal to 1, and less than or equal to Version: "2.2.0", Formatter: func(v string) string { if len(v) == 0 { - diskUsage, err := disk.Usage("/") + // use local storage path to check correct device + localStoragePath := base.Get("localStorage.path") + if _, err := os.Stat(localStoragePath); os.IsNotExist(err) { + os.MkdirAll(localStoragePath, os.ModePerm) + } + diskUsage, err := disk.Usage(localStoragePath) if err != nil { - panic(err) + // panic(err) + log.Fatal("failed to get disk usage", zap.String("localStoragePath", localStoragePath), zap.Error(err)) } return strconv.FormatUint(diskUsage.Total, 10) }