mirror of
https://github.com/scylladb/scylladb.git
synced 2026-05-23 16:22:15 +00:00
dist/common/scripts/scylla_setup: check disk is used in MDRAID
Check disk is used in MDRAID by /proc/mdstat.
This commit is contained in:
6
dist/common/scripts/scylla_setup
vendored
6
dist/common/scripts/scylla_setup
vendored
@@ -93,6 +93,12 @@ def get_unused_disks():
|
||||
s = out('swapon --show=NAME --noheadings')
|
||||
if len(re.findall(dev, s, flags=re.MULTILINE)) > 0:
|
||||
continue
|
||||
# dev is used in MDRAID
|
||||
if os.path.exists('/proc/mdstat'):
|
||||
with open('/proc/mdstat') as f:
|
||||
s = f.read().strip()
|
||||
if len(re.findall(dev, s, flags=re.MULTILINE)) > 0:
|
||||
continue
|
||||
unused.append(dev)
|
||||
return unused
|
||||
|
||||
|
||||
Reference in New Issue
Block a user