Repository: archlinux/archinstall

Issue:
Errors while partitioning disk
![image](https://user-images.githubusercontent.com/17101532/142687890-e8ea82ed-5447-4b3e-ac54-52dc85fb663a.png)
I'm using v2.3.0.RC2 version with Disk Encryption. I was getting the same thing while using master branch version before.


Discussion:
This looks like an overlap of partitions.
Did you use the manual partitioning function or wipe the entire disk?
> This looks like an overlap of partitions. Did you use the manual partitioning function or wipe the entire disk?

I selected "Wipe entire disk".
Could you supply me the `/var/log/archinstall/install.log` and `user_disk_layout.json` in the same folder?
> Could you supply me the `/var/log/archinstall/install.log` and `user_disk_layout.json` in the same folder?

there you go

install.log
```
Hardware model detected: innotek GmbH VirtualBox; UEFI mode: True
Processor model detected: Intel(R) Core(TM) i5-7400 CPU @ 3.00GHz
Memory statistics: 3451964 available out of 4006236 total installed
Virtualization detected: oracle; is VM: True
Graphics devices detected: dict_keys(['VMware SVGA II Adapter'])
Disk states before installing: {'blockdevices': [{'name': 'loop0', 'fstype': 'squashfs', 'fsver': '4.0', 'label': None, 'uuid': None, 'fsavail': '0', 'fsuse%': '100%', 'mountpoints': ['/run/archiso/airootfs'], 'type': 'loop', 'size': '700.2M'}, {'name': 'sda', 'fstype': None, 'fsver': None, 'label': None, 'uuid': None, 'fsavail': None, 'fsuse%': None, 'mountpoints': [None], 'type': 'disk', 'size': '52G', 'children': [{'name': 'sda1', 'fstype': 'vfat', 'fsver': 'FAT32', 'label': None, 'uuid': '8DCE-7ECF', 'fsavail': None, 'fsuse%': None, 'mountpoints': [None], 'type': 'part', 'size': '508M'}, {'name': 'sda2', 'fstype': 'crypto_LUKS', 'fsver': '2', 'label': None, 'uuid': '0a11a8b9-65ce-42ba-84de-217cd6f9f366', 'fsavail': None, 'fsuse%': None, 'mountpoints': [None], 'type': 'part', 'size': '19.5G'}]}, {'name': 'sr0', 'fstype': 'iso9660', 'fsver': 'Joliet Extension', 'label': 'ARCH_202111', 'uuid': '2021-11-18-21-19-27-00', 'fsavail': '0', 'fsuse%': '100%', 'mountpoints': ['/run/archiso/bootmnt'], 'type': 'rom', 'size': '879.3M'}]}
Testing connectivity to the Arch Linux mirrors ...
Unknown blockdevice type for /dev/sr0: rom
Unknown blockdevice type for /dev/sr0: rom
Verifying that additional packages exist (this might take a few seconds)
Specified timezone Eu/London does not exist.
Specified timezone Eu/Vienna does not exist.
Specified timezone Eu/Berlin does not exist.
Hardware time and other post-configuration steps might be required in order for NTP to work. For more information, please check the Arch wiki.
-- Guided template chosen (with below config) --
{
    "audio": null,
    "bootloader": "grub-install",
    "desktop-environment": "kde",
    "dry-run": false,
    "gfx_driver": "VMware / VirtualBox (open-source)",
    "harddrives": [
        "/dev/sda"
    ],
    "hostname": "arch",
    "kernels": [
        "linux"
    ],
    "keyboard-layout": "us",
    "mirror-region": {
        "Poland": {
            "http://arch.midov.pl/arch/$repo/os/$arch": true,
            "http://arch.nixlab.pl/$repo/os/$arch": true,
            "http://ftp.icm.edu.pl/pub/Linux/dist/archlinux/$repo/os/$arch": true,
            "http://ftp.psnc.pl/linux/archlinux/$repo/os/$arch": true,
            "http://ftp.vectranet.pl/archlinux/$repo/os/$arch": true,
            "http://mirror.juniorjpdj.pl/archlinux/$repo/os/$arch": true,
            "http://mirror.onet.pl/pub/mirrors/archlinux/$repo/os/$arch": true,
            "http://mirror.sfinae.tech/pub/mirrors/archlinux/$repo/os/$arch": true,
            "http://repo.skni.umcs.pl/archlinux/$repo/os/$arch": true,
            "https://arch.midov.pl/arch/$repo/os/$arch": true,
            "https://arch.nixlab.pl/$repo/os/$arch": true,
            "https://ftp.icm.edu.pl/pub/Linux/dist/archlinux/$repo/os/$arch": true,
            "https://ftp.psnc.pl/linux/archlinux/$repo/os/$arch": true,
            "https://mirror.juniorjpdj.pl/archlinux/$repo/os/$arch": true,
            "https://mirror.sfinae.tech/pub/mirrors/archlinux/$repo/os/$arch": true,
            "https://repo.skni.umcs.pl/archlinux/$repo/os/$arch": true
        }
    },
    "nic": {
        "NetworkManager": true,
        "nic": "Use NetworkManager (necessary to configure internet graphically in GNOME and KDE)"
    },
    "ntp": true,
    "packages": [
        "firefox"
    ],
    "profile": {
        "path": "/usr/lib/python3.9/site-packages/archinstall-2.3.0.dev0-py3.9.egg/archinstall/profiles/desktop.py"
    },
    "script": "guided",
    "swap": true,
    "sys-encoding": "utf-8",
    "sys-language": "en_US",
    "timezone": "UTC"
}
```

```
{
    "/dev/sda": {
        "partitions": [
            {
                "boot": true,
                "encrypted": false,
                "filesystem": {
                    "format": "fat32"
                },
                "format": true,
                "mountpoint": "/boot",
                "size": "513MiB",
                "start": "5MiB",
                "type": "primary"
            },
            {
                "encrypted": true,
                "filesystem": {
                    "format": "ext4"
                },
                "format": true,
                "mountpoint": "/",
                "size": "20480MiB",
                "start": "518MiB",
                "type": "primary"
            },
            {
                "encrypted": false,
                "filesystem": {
                    "format": "ext4"
                },
                "format": true,
                "mountpoint": "/home",
                "size": "100%",
                "start": "10649.6MiB",
                "type": "primary"
            }
        ],
        "wipe": true
    }
}
Creating a new partition labling on /dev/sda
Adding partition to BlockDevice(/dev/sda, size=52.0GB, free_space=55.8GB, bus_type=sata), 5MiB->513MiB
Getting mount information for device path /dev/sda1
Formatting /dev/sda1 -fat32
Marking partition Partition(path=/dev/sda1, size=508M, PARTUUID=23eb7bee-eebe-4ece-91ca-55abe9b2f9c1, fs=fat32) as bootable.
Setting boot on on (parted) partition index 1
Adding partition to BlockDevice(/dev/sda, size=52.0GB, free_space=5225kB+55.3GB, bus_type=sata), 518MiB->20480MiB
Getting mount information for device path /dev/sda2
Encrypting Partition(path=/dev/sda2, size=19.5G, PARTUUID=f8b16630-42f7-4075-ac47-f497108d7eef, parent=/dev/sda, fs=crypto_LUKS) (This might take a while)
Getting mount information for device path /dev/mapper/ainstloop
Formatting /dev/mapper/ainstloop -ext4
Adding partition to BlockDevice(/dev/sda, size=52.0GB, free_space=5225kB+5243kB+34.4GB, bus_type=sata), 10649.6MiB->100%
Parted ended with a bad exit code: Error: You requested a partition from 11.2GB to 55.8GB (sectors 21810380..109051903).
The closest location we can manage is 21.5GB to 55.8GB (sectors 41943040..109051870).

and user_disk_layout.json

{
    "/dev/sda": {
        "partitions": [
            {
                "boot": true,
                "encrypted": false,
                "filesystem": {
                    "format": "fat32"
                },
                "format": true,
                "mountpoint": "/boot",
                "size": "513MiB",
                "start": "5MiB",
                "type": "primary"
            },
            {
                "encrypted": true,
                "filesystem": {
                    "format": "ext4"
                },
                "format": true,
                "mountpoint": "/",
                "size": "20480MiB",
                "start": "518MiB",
                "type": "primary"
            },
            {
                "encrypted": false,
                "filesystem": {
                    "format": "ext4"
                },
                "format": true,
                "mountpoint": "/home",
                "size": "100%",
                "start": "10649.6MiB",
                "type": "primary"
            }
        ],
        "wipe": true
    }
}
```
Something in the calculations surely have gone wrong.
I'll investigate. Thank you for supplying the logs, they will help a lot!

Resolving patch:
diff --git a/archinstall/lib/disk/user_guides.py b/archinstall/lib/disk/user_guides.py
--- a/archinstall/lib/disk/user_guides.py
+++ b/archinstall/lib/disk/user_guides.py
@@ -23,8 +23,8 @@ def suggest_single_disk_layout(block_device, default_filesystem=None):
 	layout[block_device.path]['partitions'].append({
 		# Boot
 		"type" : "primary",
-		"start" : "5MiB",
-		"size" : "513MiB",
+		"start" : "5MB",
+		"size" : "513MB",
 		"boot" : True,
 		"encrypted" : False,
 		"format" : True,
@@ -36,16 +36,23 @@ def suggest_single_disk_layout(block_device, default_filesystem=None):
 	layout[block_device.path]['partitions'].append({
 		# Root
 		"type" : "primary",
-		"start" : "518MiB",
+		"start" : "518MB",
 		"encrypted" : False,
 		"format" : True,
-		"size" : "100%" if (using_subvolumes or block_device.size < MIN_SIZE_TO_ALLOW_HOME_PART) else f"{min(block_device.size, 20)*1024}MiB",
 		"mountpoint" : "/",
 		"filesystem" : {
 			"format" : default_filesystem
 		}
 	})
 
+	# Set a size for / (/root)
+	if using_subvolumes or block_device.size < MIN_SIZE_TO_ALLOW_HOME_PART:
+		# We'll use subvolumes
+		# Or the disk size is too small to allow for a separate /home
+		layout[block_device.path]['partitions'][-1]['size'] = '100%'
+	else:
+		layout[block_device.path]['partitions'][-1]['size'] = f"{min(block_device.size, 20)}GB"
+
 	if default_filesystem == 'btrfs' and using_subvolumes:
 		if input('Do you want to use a recommended structure? (Y/n): ').strip().lower() in ('', 'y', 'yes'):
 			# https://btrfs.wiki.kernel.org/index.php/FAQ
@@ -71,7 +78,7 @@ def suggest_single_disk_layout(block_device, default_filesystem=None):
 			"type" : "primary",
 			"encrypted" : False,
 			"format" : True,
-			"start" : f"{min(block_device.size*0.2, 20)*1024}MiB",
+			"start" : f"{min(block_device.size+0.5, 20.5)}GB",
 			"size" : "100%",
 			"mountpoint" : "/home",
 			"filesystem" : {
@@ -115,8 +122,8 @@ def suggest_multi_disk_layout(block_devices, default_filesystem=None):
 	layout[root_device.path]['partitions'].append({
 		# Boot
 		"type" : "primary",
-		"start" : "5MiB",
-		"size" : "513MiB",
+		"start" : "5MB",
+		"size" : "513MB",
 		"boot" : True,
 		"encrypted" : False,
 		"format" : True,
@@ -128,7 +135,7 @@ def suggest_multi_disk_layout(block_devices, default_filesystem=None):
 	layout[root_device.path]['partitions'].append({
 		# Root
 		"type" : "primary",
-		"start" : "518MiB",
+		"start" : "518MB",
 		"encrypted" : False,
 		"format" : True,
 		"size" : "100%",
@@ -143,7 +150,7 @@ def suggest_multi_disk_layout(block_devices, default_filesystem=None):
 		"type" : "primary",
 		"encrypted" : False,
 		"format" : True,
-		"start" : "4MiB",
+		"start" : "5MB",
 		"size" : "100%",
 		"mountpoint" : "/home",
 		"filesystem" : {
diff --git a/examples/guided.py b/examples/guided.py
--- a/examples/guided.py
+++ b/examples/guided.py
@@ -135,7 +135,7 @@ def ask_user_questions():
 
 	# Ask for a root password (optional, but triggers requirement for super-user if skipped)
 	if not archinstall.arguments.get('!root-password', None):
-		archinstall.arguments['!root-password'] = archinstall.get_password(prompt='Enter root password (leave blank to disable disabled & create superuser): ')
+		archinstall.arguments['!root-password'] = archinstall.get_password(prompt='Enter root password (leave blank to disable root & create superuser): ')
 
 	# Ask for additional users (super-user if root pw was not set)
 	if not archinstall.arguments.get('!root-password', None) and not archinstall.arguments.get('!superusers', None):


Test patch: