From aaf65173c0d9a4818ab4171b58b2d620ee739136 Mon Sep 17 00:00:00 2001 From: Mateus Melchiades Date: Sun, 6 Aug 2023 19:32:37 -0300 Subject: [PATCH] Find root disk by evaluating the root path --- core/disk-manager.go | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/core/disk-manager.go b/core/disk-manager.go index 855088e1..db98b721 100644 --- a/core/disk-manager.go +++ b/core/disk-manager.go @@ -86,15 +86,9 @@ func (d *DiskManager) GetDiskByPartition(partition string) (Disk, error) { func (d *DiskManager) GetCurrentDisk() (Disk, error) { PrintVerbose("DiskManager.GetCurrentDisk: running...") - root, err := os.Getwd() - if err != nil { - PrintVerbose("DiskManager.GetCurrentDisk:err: %s", err) - return Disk{}, err - } - // we need to evaluate symlinks to get the real root path // in case of weird setups - root, err = filepath.EvalSymlinks(root) + root, err := filepath.EvalSymlinks("/") if err != nil { PrintVerbose("DiskManager.GetCurrentDisk:err(2): %s", err) return Disk{}, err