archinstall icon indicating copy to clipboard operation
archinstall copied to clipboard

"ValueError: Crypto luks cannot be set as a filesystem type" when attempting to delete crypto_LUKS partition

Open correctmost opened this issue 2 years ago • 2 comments

Steps to reproduce

Prerequisite: create an installation with a crypto_LUKS partition

  1. Run archinstall
  2. Navigate to Disk configuration
    1. Select Use a best-effort default partition layout
    2. Select the /dev/sda (or /dev/vda) entry and press enter
    3. Select ext4
  3. Navigate to Disk encryption
    1. Select Encryption password
      1. Set a non-blank password
    2. Select Partitions
      1. Select the ext4 partition and press enter
    3. Select <- Back
  4. Navigate to User account
    1. Select Add a user
      1. Enter a username and password
      2. Choose superuser permissions
    2. Select Confirm and exit
  5. Select Install
    1. Press the enter key to continue
  6. Wait for the installation to complete
  7. Shut down the machine

Attempt to delete an existing crypto_LUKS partition during an installation

  1. Boot the existing machine with the Arch .iso still attached
    1. Make sure to boot into the install medium
  2. Run archinstall
  3. Navigate to Disk configuration
    1. Select Manual Partitioning
    2. Select the /dev/sda (or /dev/vda) entry and press enter
    3. Select the existing boot partition and press enter
      1. Select Assign mountpoint
      2. Enter /boot and press enter
    4. Select the existing crypto_LUKS partition and press enter
      1. Select Delete partition
    5. Select Create a new partition
      1. Select ext4
      2. Accept the default start value
      3. Accept the default end value
      4. Set the mountpoint to /
    6. Select Confirm and exit
  4. Navigate to User account
    1. Select Add a user
      1. Enter a username and password
      2. Choose superuser permissions
    2. Select Confirm and exit
  5. Select Install
    1. Press the enter key to continue

Debugging

My assumption is that the installer is trying to prevent the creation of an opaque crypto_LUKS partition rather than prevent the deletion of one, but I may be misreading the code.

Log

Full log

Disk configs
 -- Chosen configuration --
{
    ...
    "disk_config": {
        "config_type": "manual_partitioning",
        "device_modifications": [
            {
                "device": "/dev/vda",
                "partitions": [
                    {
                        "btrfs": [],
                        "dev_path": "/dev/vda1",
                        "flags": [
                            "Boot"
                        ],
                        "fs_type": "fat32",
                        "mount_options": [],
                        "mountpoint": "/boot",
                        "obj_id": "9ae39016-55be-4783-a355-0f0138f224f6",
                        "size": {
                            "sector_size": {
                                "unit": "B",
                                "value": 512
                            },
                            "unit": "B",
                            "value": 212860928
                        },
                        "start": {
                            "sector_size": {
                                "unit": "B",
                                "value": 512
                            },
                            "unit": "sectors",
                            "value": 6144
                        },
                        "status": "existing",
                        "type": "primary"
                    },
                    {
                        "btrfs": [],
                        "dev_path": "/dev/vda2",
                        "flags": [],
                        "fs_type": "crypto_LUKS",
                        "mount_options": [],
                        "mountpoint": null,
                        "obj_id": "7a9c6cf7-7585-400c-8a9c-d1ed6afac5c7",
                        "size": {
                            "sector_size": {
                                "unit": "B",
                                "value": 512
                            },
                            "unit": "B",
                            "value": 21123563520
                        },
                        "start": {
                            "sector_size": {
                                "unit": "B",
                                "value": 512
                            },
                            "unit": "sectors",
                            "value": 522240
                        },
                        "status": "delete",
                        "type": "primary"
                    },
                    {
                        "btrfs": [],
                        "dev_path": null,
                        "flags": [],
                        "fs_type": "ext4",
                        "mount_options": [],
                        "mountpoint": "/",
                        "obj_id": "0f5f3eb1-8c9f-4929-a980-c21943c7fa41",
                        "size": {
                            "sector_size": {
                                "unit": "B",
                                "value": 512
                            },
                            "unit": "B",
                            "value": 83819008
                        },
                        "start": {
                            "sector_size": {
                                "unit": "B",
                                "value": 512
                            },
                            "unit": "sectors",
                            "value": 41779200
                        },
                        "status": "create",
                        "type": "primary"
                    }
                ],
                "wipe": false
            }
        ]
    },
    "disk_encryption": null,
   ...

Backtrace

Traceback (most recent call last):
  File "/usr/lib/python3.11/site-packages/archinstall/__init__.py", line 329, in run_as_a_module
    main()
  File "/usr/lib/python3.11/site-packages/archinstall/__init__.py", line 324, 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 302, in format
    self._validate_partitions(filtered_part)
  File "/usr/lib/python3.11/site-packages/archinstall/lib/disk/device_handler.py", line 287, in _validate_partitions
    raise exc
ValueError: Crypto luks cannot be set as a filesystem type

Version

2.7.1

correctmost avatar Jan 18 '24 03:01 correctmost

Thanks for the comprehensive steps! It seems there is some issues with the partition that is meant to be deleted. We'll have a look at it

svartkanin avatar Jan 20 '24 23:01 svartkanin

Also seems to be a duplicate of https://github.com/archlinux/archinstall/issues/2316

svartkanin avatar Jan 21 '24 01:01 svartkanin