Repository: archlinux/archinstall

Issue:
archinstall failed /dev/sda1 log attached
Hi there, thanks for help 

https://[0x0.st/HLEM.txt](https://0x0.st/HLEM.txt)

ArchInstall failed and I used the guide to upload the log file.

Log output tells me to create a post here!!!


Discussion:
Have you checket the other issues for duplicate first? There are already about 5 issues created with the same problem.

please add your issue to:  #1971 

Additionally: It seems you are using a VM? I  think that others also have a problem related to VMs or not using UEFI
Duplicate of #1971

Resolving patch:
diff --git a/archinstall/lib/disk/device_handler.py b/archinstall/lib/disk/device_handler.py
--- a/archinstall/lib/disk/device_handler.py
+++ b/archinstall/lib/disk/device_handler.py
@@ -117,6 +117,10 @@ def find_partition(self, path: Path) -> Optional[_PartitionInfo]:
 				return part
 		return None
 
+	def get_parent_device_path(self, dev_path: Path) -> Path:
+		lsblk = get_lsblk_info(dev_path)
+		return Path(f'/dev/{lsblk.pkname}')
+
 	def get_uuid_for_path(self, path: Path) -> Optional[str]:
 		partition = self.find_partition(path)
 		return partition.partuuid if partition else None
diff --git a/archinstall/lib/disk/device_model.py b/archinstall/lib/disk/device_model.py
--- a/archinstall/lib/disk/device_model.py
+++ b/archinstall/lib/disk/device_model.py
@@ -1080,7 +1080,6 @@ def get_lsblk_info(dev_path: Union[Path, str]) -> LsblkInfo:
 def get_all_lsblk_info() -> List[LsblkInfo]:
 	return _fetch_lsblk_info()
 
-
 def get_lsblk_by_mountpoint(mountpoint: Path, as_prefix: bool = False) -> List[LsblkInfo]:
 	def _check(infos: List[LsblkInfo]) -> List[LsblkInfo]:
 		devices = []
diff --git a/archinstall/lib/installer.py b/archinstall/lib/installer.py
--- a/archinstall/lib/installer.py
+++ b/archinstall/lib/installer.py
@@ -880,17 +880,31 @@ def _add_grub_bootloader(
 			self.pacman.strap('efibootmgr') # TODO: Do we need? Yes, but remove from minimal_installation() instead?
 
 			try:
-				SysCommand(f'/usr/bin/arch-chroot {self.target} grub-install --debug --target=x86_64-efi --efi-directory={boot_partition.mountpoint} --bootloader-id=GRUB --removable', peek_output=True)
+				SysCommand(
+					f'/usr/bin/arch-chroot {self.target} grub-install '
+					f'--debug '
+					f'--target=x86_64-efi '
+					f'--efi-directory={boot_partition.mountpoint} '
+					f'--bootloader-id=GRUB '
+					f'--removable',
+					peek_output=True
+				)
 			except SysCallError:
 				try:
-					SysCommand(f'/usr/bin/arch-chroot {self.target} grub-install --debug --target=x86_64-efi --efi-directory={boot_partition.mountpoint} --bootloader-id=GRUB --removable', peek_output=True)
+					SysCommand(
+						f'/usr/bin/arch-chroot {self.target} '
+						f'grub-install '
+						f'--debug '
+						f'--target=x86_64-efi '
+						f'--efi-directory={boot_partition.mountpoint} '
+						f'--bootloader-id=GRUB '
+						f'--removable',
+						peek_output=True
+					)
 				except SysCallError as err:
 					raise DiskError(f"Could not install GRUB to {self.target}{boot_partition.mountpoint}: {err}")
 		else:
-			device = disk.device_handler.get_device_by_partition_path(boot_partition.safe_dev_path)
-
-			if not device:
-				raise ValueError(f'Can not find block device: {boot_partition.safe_dev_path}')
+			parent_dev_path = disk.device_handler.get_parent_device_path(boot_partition.safe_dev_path)
 
 			try:
 				cmd = f'/usr/bin/arch-chroot' \
@@ -898,14 +912,17 @@ def _add_grub_bootloader(
 					f' grub-install' \
 					f' --debug' \
 					f' --target=i386-pc' \
-					f' --recheck {device.device_info.path}'
+					f' --recheck {parent_dev_path}'
 
 				SysCommand(cmd, peek_output=True)
 			except SysCallError as err:
 				raise DiskError(f"Failed to install GRUB boot on {boot_partition.dev_path}: {err}")
 
 		try:
-			SysCommand(f'/usr/bin/arch-chroot {self.target} grub-mkconfig -o {boot_partition.mountpoint}/grub/grub.cfg')
+			SysCommand(
+				f'/usr/bin/arch-chroot {self.target} '
+				f'grub-mkconfig -o {boot_partition.mountpoint}/grub/grub.cfg'
+			)
 		except SysCallError as err:
 			raise DiskError(f"Could not configure GRUB: {err}")
 
@@ -923,10 +940,6 @@ def _add_limine_bootloader(
 		#      partition before the format.
 		root_uuid = get_lsblk_info(root_partition.safe_dev_path).uuid
 
-		device = disk.device_handler.get_device_by_partition_path(boot_partition.safe_dev_path)
-		if not device:
-			raise ValueError(f'Can not find block device: {boot_partition.safe_dev_path}')
-
 		def create_pacman_hook(contents: str):
 			HOOK_DIR = "/etc/pacman.d/hooks"
 			SysCommand(f"/usr/bin/arch-chroot {self.target} mkdir -p {HOOK_DIR}")
@@ -940,6 +953,8 @@ def create_pacman_hook(contents: str):
 					f' cp' \
 					f' /usr/share/limine/BOOTX64.EFI' \
 					f' /boot/EFI/BOOT/'
+
+				SysCommand(cmd, peek_output=True)
 			except SysCallError as err:
 				raise DiskError(f"Failed to install Limine BOOTX64.EFI on {boot_partition.dev_path}: {err}")
 
@@ -957,6 +972,8 @@ def create_pacman_hook(contents: str):
 Exec = /usr/bin/cp /usr/share/limine/BOOTX64.EFI /boot/EFI/BOOT/
 			""")
 		else:
+			parent_dev_path = disk.device_handler.get_parent_device_path(boot_partition.safe_dev_path)
+
 			try:
 				# The `limine.sys` file, contains stage 3 code.
 				cmd = f'/usr/bin/arch-chroot' \
@@ -972,7 +989,7 @@ def create_pacman_hook(contents: str):
 					f' {self.target}' \
 					f' limine' \
 					f' bios-install' \
-					f' {device.device_info.path}'
+					f' {parent_dev_path}'
 
 				SysCommand(cmd, peek_output=True)
 			except SysCallError as err:
@@ -1062,13 +1079,10 @@ def _add_efistub_bootloader(
 				debug(f'Root partition is an encrypted device identifying by PARTUUID: {root_partition.partuuid}')
 				kernel_parameters.append(f'root=PARTUUID={root_partition.partuuid} rw rootfstype={root_partition.safe_fs_type.value} {" ".join(self._kernel_params)}')
 
-			device = disk.device_handler.get_device_by_partition_path(boot_partition.safe_dev_path)
-
-			if not device:
-				raise ValueError(f'Unable to find block device: {boot_partition.safe_dev_path}')
+			parent_dev_path = disk.device_handler.get_parent_device_path(boot_partition.safe_dev_path)
 
 			cmd = f'efibootmgr ' \
-				f'--disk {device.device_info.path} ' \
+				f'--disk {parent_dev_path} ' \
 				f'--part {boot_partition.safe_dev_path} ' \
 				f'--create ' \
 				f'--label "{label}" ' \


Test patch: