Repository: archlinux/archinstall

Issue:
[2.3.0-RC1] On uninitialized disk (VirtualBox), the selected partition table format 2 does not match that of BlockDevice
![VirtualBox_arch_09_11_2021_10_32_13](https://user-images.githubusercontent.com/277927/140954414-a5c159af-74b5-4645-9b14-06712b163c21.png)



Discussion:
I got this error twice in a row.
I'm looking in to this error now, after running 20+ installations with no breakage surrounding `.format()` or `PARTUUID <partuuid> never showed up` I'm confident enough that it's good enough to merge the other code. And now I can begin chasing down this one.

Resolving patch:
diff --git a/archinstall/lib/disk/filesystem.py b/archinstall/lib/disk/filesystem.py
--- a/archinstall/lib/disk/filesystem.py
+++ b/archinstall/lib/disk/filesystem.py
@@ -20,12 +20,6 @@ def __init__(self, blockdevice, mode):
 		self.mode = mode
 
 	def __enter__(self, *args, **kwargs):
-		# TODO: partition_table_type is hardcoded to GPT at the moment. This has to be changed.
-		if self.mode == self.blockdevice.partition_table_type:
-			log(f'Kept partition format {self.mode} for {self.blockdevice}', level=logging.DEBUG)
-		else:
-			raise DiskError(f'The selected partition table format {self.mode} does not match that of {self.blockdevice}.')
-
 		return self
 
 	def __repr__(self):
diff --git a/archinstall/lib/installer.py b/archinstall/lib/installer.py
--- a/archinstall/lib/installer.py
+++ b/archinstall/lib/installer.py
@@ -7,7 +7,7 @@
 import pathlib
 import subprocess
 import glob
-from .disk import get_partitions_in_use, Partition, find_partition_by_mountpoint
+from .disk import get_partitions_in_use, Partition
 from .general import SysCommand
 from .hardware import has_uefi, is_vm, cpu_vendor
 from .locale_helpers import verify_keyboard_layout, verify_x11_keyboard_layout
@@ -174,6 +174,7 @@ def mount_ordered_layout(self, layouts :dict):
 				mountpoints[partition['mountpoint']] = partition
 
 		for mountpoint in sorted(mountpoints.keys()):
+			log(f"Mounting {mountpoint} to {self.target}{mountpoint}", level=logging.INFO)
 			if mountpoints[mountpoint]['encrypted']:
 				loopdev = storage.get('ENC_IDENTIFIER', 'ai') + 'loop'
 				if not (password := mountpoints[mountpoint].get('!password', None)):
@@ -186,8 +187,10 @@ def mount_ordered_layout(self, layouts :dict):
 				mountpoints[mountpoint]['device_instance'].mount(f"{self.target}{mountpoint}")
 
 			time.sleep(1)
-			if not get_mount_info(f"{self.target}{mountpoint}", traverse=False):
-				raise DiskError(f"Target {self.target}{mountpoint} never got mounted properly.")
+			try:
+				get_mount_info(f"{self.target}{mountpoint}", traverse=False)
+			except DiskError:
+				raise DiskError(f"Target {self.target}{mountpoint} never got mounted properly (unable to get mount information using findmnt).")
 
 			if (subvolumes := mountpoints[mountpoint].get('btrfs', {}).get('subvolumes', {})):
 				for name, location in subvolumes.items():
@@ -619,7 +622,6 @@ def add_bootloader(self, bootloader='systemd-bootctl'):
 				self.helper_flags['bootloader'] = True
 				return True
 			else:
-				boot_partition = find_partition_by_mountpoint(self.partitions, relative_mountpoint=f"/boot")
 				SysCommand(f'/usr/bin/arch-chroot {self.target} grub-install --target=i386-pc --recheck {boot_partition.path}')
 				SysCommand(f'/usr/bin/arch-chroot {self.target} grub-mkconfig -o /boot/grub/grub.cfg')
 				self.helper_flags['bootloader'] = True


Test patch: