From d1ab37654ec065c98b33533d861d676a50ab5380 Mon Sep 17 00:00:00 2001 From: Takuya ASADA Date: Fri, 5 Feb 2021 02:34:11 +0900 Subject: [PATCH] scylla_util.py: resolve /dev/root to get actual device on aws When psutil.disk_paritions() reports / is /dev/root, aws_instance mistakenly reports root partition is part of ephemeral disks, and RAID construction will fail. This prevents the error and reports correct free disks. Fixes #8055 Closes #8040 (cherry picked from commit 32d4ec6b8a519658db30a944ba10f03e7f237258) --- dist/common/scripts/scylla_util.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/dist/common/scripts/scylla_util.py b/dist/common/scripts/scylla_util.py index e89a6a89b22b..0390cb0ca6d1 100644 --- a/dist/common/scripts/scylla_util.py +++ b/dist/common/scripts/scylla_util.py @@ -380,6 +380,8 @@ def _non_root_nvmes(self): raise Exception("found more than one disk mounted at root'".format(root_dev_candidates)) root_dev = root_dev_candidates[0].device + if root_dev == '/dev/root': + root_dev = run('findmnt -n -o SOURCE /', shell=True, check=True, capture_output=True, encoding='utf-8').stdout.strip() nvmes_present = list(filter(nvme_re.match, os.listdir("/dev"))) return {"root": [ root_dev ], "ephemeral": [ x for x in nvmes_present if not root_dev.startswith(os.path.join("/dev/", x)) ] }