archlinux / archinstall

Arch Linux installer - guided, templates etc.
GNU General Public License v3.0
5.82k stars 509 forks source link

Error with archinstall on MacBook9,1 #2524

Closed benfindlay closed 4 weeks ago

benfindlay commented 1 month ago

I get an error when running the archinstall script. Screenshots attached of the error and (since the error seems to pertain to the NVMe in some way) the output of the lsblk command.

I have used multiple different versions of the Arch ISO, and have tried performing an update via pacman prio to install. They always seem to produce the same error.

Please can someone advise? archinstall_error lsblk

C0rn3j commented 1 month ago

A quick dirty fix might be ignoring devices smaller than 1GiB, but it's odd that the block device is there in the first place if it's some kind of unpopulated slot.

Can you upload the full output from dmesg, or at least the part with nvme0n2 initialization?

benfindlay commented 1 month ago

Thanks for the response!

There is no mention of /dev/nvme0n2 in dmesg output (I ran "dmesg | grep nvme0n2") in the Arch ISO environment. Running it via my installed OS (Kubuntu) shows the following lines of relevance:

~$ sudo dmesg | grep nvme0n2 [ 0.795826] nvme0n2: unable to read partition table [ 0.795832] nvme0n2: partition table beyond EOD, truncated ~$

Interestingly, when I run nvme list, I can see that both nvme0n1 and nvme0n2 are present, and have the same serial and model no.:

$ nvme list Node Generic SN Model Namespace Usage Format FW Rev


/dev/nvme0n1 /dev/ng0n1 [serial redacted] APPLE SSD AP0512J 0x1 500.28 GB / 4.00 TB 4 KiB + 0 B 9.135.01 /dev/nvme0n2 /dev/ng0n2 [serial redacted] APPLE SSD AP0512J 0x2 8.19 kB / 65.54 kB 4 KiB + 0 B 9.135.01 benfindlay@macbuntu:~$

Now, how would I get the archinstall script to ignore devices smaller than 1GB as you suggested? I've looked through the man page and couldn't spot any immediately apparent options that would do this?

Thanks again!

C0rn3j commented 1 month ago

https://github.com/archlinux/archinstall/blob/b2d29eeba3b110e458bee752f0fc67f670c7aa36/archinstall/lib/disk/device_handler.py#L60-L62

A condition would have to go here, similar to the existing one that checks device type.
That was more of a suggestion to whoever is going to try and fixing this.

There's probably a more proper way to fix this specific ghost-device issue, but archinstall needs to respect parted's minimums which would solve a ghost-device of a small size anyway, which is your case.

This is the relevant code from Parted, so the check needs to accommodate at least that much:

#define GPT_DEFAULT_PARTITION_ENTRY_ARRAY_SIZE 16384

gpt_alloc (const PedDevice *dev)
{
  PedDisk *disk;
  GPTDiskData *gpt_disk_data;
  PedSector data_start, data_end;

  disk = _ped_disk_alloc ((PedDevice *) dev, &gpt_disk_type);
  if (!disk)
    goto error;

  data_start = 2 + GPT_DEFAULT_PARTITION_ENTRY_ARRAY_SIZE / dev->sector_size;
  data_end = dev->length - 2
    - GPT_DEFAULT_PARTITION_ENTRY_ARRAY_SIZE / dev->sector_size;

  /* If the device is too small to accommodate GPT headers and one data
     sector, reject it.  */
  if (data_end < data_start)
    {
      ped_exception_throw (PED_EXCEPTION_ERROR,
               PED_EXCEPTION_OK,
               _("device is too small for GPT"));
      goto error_free_disk;
    }