From 985ff449db6d681d852c4fa558d2a90ecf2a2bc3 Mon Sep 17 00:00:00 2001 From: Anton Hvornum Date: Wed, 21 Sep 2022 12:36:54 +0200 Subject: On certain hardware where virtual and physical harddrives share the same common name, a smart mapping is done and block devices will show up under /sys/class/block/ but not always under /dev/* and thus breaking the all_blockdevices() logic. This should fix that. (#1475) --- archinstall/lib/disk/helpers.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'archinstall/lib') diff --git a/archinstall/lib/disk/helpers.py b/archinstall/lib/disk/helpers.py index a148a5db..f19125f4 100644 --- a/archinstall/lib/disk/helpers.py +++ b/archinstall/lib/disk/helpers.py @@ -220,7 +220,12 @@ def all_blockdevices(mappers=False, partitions=False, error=False) -> Dict[str, # we'll iterate the /sys/class definitions and find the information # from there. for block_device in glob.glob("/sys/class/block/*"): - device_path = f"/dev/{pathlib.Path(block_device).readlink().name}" + device_path = pathlib.Path(f"/dev/{pathlib.Path(block_device).readlink().name}") + + if device_path.exists() is False: + log(f"Unknown device found by '/sys/class/block/*', ignoring: {device_path}", level=logging.WARNING, fg="yellow") + continue + try: information = blkid(f'blkid -p -o export {device_path}') except SysCallError as ex: -- cgit v1.2.3-70-g09d2