Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

archinstall.lib.exceptions.DiskError: Unable to determine new partition number: /dev/sda1 #2222

Closed
qwelias opened this issue Nov 20, 2023 · 3 comments

Comments

@qwelias
Copy link

qwelias commented Nov 20, 2023

I've been following this for installation from host system.

user_configuration.json:

{
    "additional-repositories": [
        "multilib"
    ],
    "archinstall-language": "English",
    "audio_config": {
        "audio": "pipewire"
    },
    "bootloader": "Systemd-boot",
    "config_version": "2.6.3",
    "debug": false,
    "disk_config": {
        "config_type": "default_layout",
        "device_modifications": [
            {
                "device": "/dev/sda",
                "partitions": [
                    {
                        "btrfs": [],
                        "dev_path": null,
                        "flags": [
                            "Boot",
                            "ESP"
                        ],
                        "fs_type": "fat32",
                        "mount_options": [],
                        "mountpoint": "/boot",
                        "obj_id": "5cedc589-9b49-471d-b5a8-6d3ceec4a9bd",
                        "size": {
                            "sector_size": {
                                "unit": "B",
                                "value": 512
                            },
                            "unit": "MiB",
                            "value": 512
                        },
                        "start": {
                            "sector_size": {
                                "unit": "B",
                                "value": 512
                            },
                            "unit": "MiB",
                            "value": 1
                        },
                        "status": "create",
                        "type": "primary"
                    },
                    {
                        "btrfs": [],
                        "dev_path": null,
                        "flags": [],
                        "fs_type": "ext4",
                        "mount_options": [],
                        "mountpoint": "/",
                        "obj_id": "41c0fc4b-709f-4efb-afd8-198bdbd3d263",
                        "size": {
                            "sector_size": {
                                "unit": "B",
                                "value": 512
                            },
                            "unit": "B",
                            "value": 1023671623680
                        },
                        "start": {
                            "sector_size": {
                                "unit": "B",
                                "value": 512
                            },
                            "unit": "MiB",
                            "value": 513
                        },
                        "status": "create",
                        "type": "primary"
                    }
                ],
                "wipe": true
            }
        ]
    },
    "disk_encryption": {
        "encryption_type": "luks",
        "partitions": [
            "41c0fc4b-709f-4efb-afd8-198bdbd3d263"
        ]
    },
    "hostname": "extmaze",
    "kernels": [
        "linux"
    ],
    "locale_config": {
        "kb_layout": "us",
        "sys_enc": "UTF-8",
        "sys_lang": "en_GB"
    },
    "mirror_config": {
        "custom_mirrors": [],
        "mirror_regions": {
            "Norway": [
                "https://mirror.neuf.no/archlinux/$repo/os/$arch",
                "https://mirror.archlinux.no/$repo/os/$arch",
                "https://lysakermoen.com/Software/Linux/Mirrors/ArchLinux/$repo/os/$arch",
                "http://mirror.terrahost.no/linux/archlinux/$repo/os/$arch",
                "http://mirror.neuf.no/archlinux/$repo/os/$arch",
                "http://mirror.archlinux.no/$repo/os/$arch",
                "http://lysakermoen.com/Software/Linux/Mirrors/ArchLinux/$repo/os/$arch",
                "http://archlinux.uib.no/$repo/os/$arch"
            ]
        }
    },
    "network_config": {},
    "no_pkg_lookups": false,
    "ntp": true,
    "offline": false,
    "packages": [
        "networkmanager",
        "git",
        "micro",
        "base-devel"
    ],
    "parallel downloads": 0,
    "profile_config": {
        "gfx_driver": "All open-source",
        "greeter": null,
        "profile": {
            "custom_settings": {},
            "details": [],
            "main": "Xorg"
        }
    },
    "script": "guided",
    "silent": false,
    "swap": false,
    "timezone": "UTC",
    "version": "2.6.3"
}

Trace:

Traceback (most recent call last):
  File "/usr/bin/archinstall", line 8, in <module>
    sys.exit(run_as_a_module())
             ^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/archinstall/__init__.py", line 291, in run_as_a_module
    importlib.import_module(mod_name)
  File "/usr/lib/python3.11/importlib/__init__.py", line 126, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "<frozen importlib._bootstrap>", line 1204, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1176, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1147, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 690, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 940, in exec_module
  File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
  File "/usr/lib/python3.11/site-packages/archinstall/scripts/guided.py", line 254, in <module>
    fs_handler.perform_filesystem_operations()
  File "/usr/lib/python3.11/site-packages/archinstall/lib/disk/filesystem.py", line 55, in perform_filesystem_operations
    device_handler.format(mod, enc_conf=self._enc_config)
  File "/usr/lib/python3.11/site-packages/archinstall/lib/disk/device_handler.py", line 304, in format
    lsblk_info = self._fetch_part_info(part_mod.safe_dev_path)
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/archinstall/lib/disk/device_handler.py", line 396, in _fetch_part_info
    raise DiskError(f'Unable to determine new partition number: {path}')
archinstall.lib.exceptions.DiskError: Unable to determine new partition number: /dev/sda1
@Torxed
Copy link
Member

Torxed commented Nov 20, 2023

Duplicate of #2192

@Torxed Torxed marked this as a duplicate of #2192 Nov 20, 2023
@Torxed Torxed closed this as completed Nov 20, 2023
@qwelias
Copy link
Author

qwelias commented Nov 20, 2023

@Torxed hey I've tried fresh master and got that:

Traceback (most recent call last):
  File "/usr/lib/python3.11/site-packages/archinstall/__init__.py", line 327, in run_as_a_module
    main()
  File "/usr/lib/python3.11/site-packages/archinstall/__init__.py", line 322, in main
    importlib.import_module(mod_name)
  File "/usr/lib/python3.11/importlib/__init__.py", line 126, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "<frozen importlib._bootstrap>", line 1204, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1176, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1147, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 690, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 940, in exec_module
  File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
  File "/usr/lib/python3.11/site-packages/archinstall/scripts/guided.py", line 254, in <module>
    fs_handler.perform_filesystem_operations()
  File "/usr/lib/python3.11/site-packages/archinstall/lib/disk/filesystem.py", line 55, in perform_filesystem_operations
    device_handler.format(mod, enc_conf=self._enc_config)
  File "/usr/lib/python3.11/site-packages/archinstall/lib/disk/device_handler.py", line 305, in format
    lsblk_info = self._fetch_part_info(part_mod.safe_dev_path)
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/archinstall/lib/disk/device_handler.py", line 394, in _fetch_part_info
    raise DiskError(f'Unable to determine new partition number: {path}')
archinstall.lib.exceptions.DiskError: Unable to determine new partition number: /dev/sda1

(I just cloned the repo and cp -r archinstall/archinstall/* /usr/lib/python3.11/site-packages/archinstall/)
log

EDIT: tried with fresh config and python archinstall/archinstall/__main__.py, same error, added fresh log to gist linked above

@codefiles
Copy link
Contributor

The root partition size in both the configuration file you gave in the initial issue comment and in the last run in the log is 1023671623680 bytes. A new configuration is needed with the master branch to get the correct disk geometry but you said you used a "fresh config" so that is not it.

Here is information about /dev/sda I extrapolated from the log.

Disk size

Total           1024209190912 B (976762 MiB)

Resulting partition table

Free space            1048576 B      (1 MiB)
Boot partition      536870912 B    (512 MiB)
Root partition  1023671623680 B (976249 MiB)

The root partition exceeds the disk space by 352256 bytes. This would make the partition table appear corrupt since the backup GPT header is stored at the end of the disk.

Expected partition table

Free space            1048576 B      (1 MiB)
Boot partition      536870912 B    (512 MiB)
Root partition  1023670222848 B (976248 MiB)
Free space            1048576 B      (1 MiB)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants