pop-os / distinst

Installer Backend
GNU Lesser General Public License v3.0
222 stars 42 forks source link

Installer Crash in Presence of Disks it Cannot Open #253

Open rbosh opened 3 years ago

rbosh commented 3 years ago

When trying to install POP!_OS 20.10 from a Live-OS session on my MacBookPro13,1 it fails just before loading the partitioning page with the installer.log reading

[INFO distinst:crates/disks/src/config/disk.rs:164] obtaining disk information from /dev/sda
[INFO distinst:crates/disks/src/serial.rs:14] obtaining serial model from /dev/sda
[INFO distinst:crates/disk-ops/src/parted.rs:31] opening disk at /dev/sda
[INFO distinst:crates/disks/src/config/partitions/mod.rs:112] obtaining partition information from /dev/sda1
[INFO distinst:crates/disks/src/config/disk.rs:164] obtaining disk information from /dev/nvme0n1
[INFO distinst:crates/disks/src/serial.rs:14] obtaining serial model from /dev/nvme0n1
[INFO distinst:crates/disk-ops/src/parted.rs:31] opening disk at /dev/nvme0n1
[INFO distinst:crates/disks/src/config/partitions/mod.rs:112] obtaining partition information from /dev/nvme0n1p1
[INFO distinst:crates/disks/src/config/partitions/mod.rs:112] obtaining partition information from /dev/nvme0n1p2
[INFO distinst:crates/disks/src/config/partitions/mod.rs:112] obtaining partition information from /dev/nvme0n1p3
[INFO distinst:crates/disks/src/config/disk.rs:164] obtaining disk information from /dev/nvme0n2
[INFO distinst:crates/disks/src/serial.rs:14] obtaining serial model from /dev/nvme0n2
[INFO distinst:crates/disk-ops/src/parted.rs:31] opening disk at /dev/nvme0n2
[INFO distinst:crates/disk-ops/src/parted.rs:37] unable to open disk; creating new table on it
[INFO distinst:ffi/src/disk.rs:452] unable to probe devices: failed to create new partition table on "/dev/nvme0n2": Invalid argument (os error 22)
[ERROR distinst:ffi/src/lib.rs:48] libdistinst: pointer in FFI is null
[ERROR distinst:ffi/src/lib.rs:48] libdistinst: pointer in FFI is null
[ERROR distinst:ffi/src/lib.rs:48] libdistinst: pointer in FFI is null
[ERROR distinst:ffi/src/lib.rs:48] libdistinst: pointer in FFI is null
[INFO distinst:crates/disks/src/config/disk.rs:164] obtaining disk information from /dev/sda
[INFO distinst:crates/disks/src/serial.rs:14] obtaining serial model from /dev/sda
[INFO distinst:crates/disk-ops/src/parted.rs:31] opening disk at /dev/sda
[INFO distinst:crates/disks/src/config/partitions/mod.rs:112] obtaining partition information from /dev/sda1
[INFO distinst:crates/disks/src/config/disk.rs:164] obtaining disk information from /dev/nvme0n1
[INFO distinst:crates/disks/src/serial.rs:14] obtaining serial model from /dev/nvme0n1
[INFO distinst:crates/disk-ops/src/parted.rs:31] opening disk at /dev/nvme0n1
[INFO distinst:crates/disks/src/config/partitions/mod.rs:112] obtaining partition information from /dev/nvme0n1p1
[INFO distinst:crates/disks/src/config/partitions/mod.rs:112] obtaining partition information from /dev/nvme0n1p2
[INFO distinst:crates/disks/src/config/partitions/mod.rs:112] obtaining partition information from /dev/nvme0n1p3
[INFO distinst:crates/disks/src/config/disk.rs:164] obtaining disk information from /dev/nvme0n2
[INFO distinst:crates/disks/src/serial.rs:14] obtaining serial model from /dev/nvme0n2
[INFO distinst:crates/disk-ops/src/parted.rs:31] opening disk at /dev/nvme0n2
[INFO distinst:crates/disk-ops/src/parted.rs:37] unable to open disk; creating new table on it
[INFO distinst:ffi/src/disk.rs:452] unable to probe devices: failed to create new partition table on "/dev/nvme0n2": Invalid argument (os error 22)
[ERROR distinst:ffi/src/lib.rs:48] libdistinst: pointer in FFI is null
[ERROR distinst:ffi/src/lib.rs:48] libdistinst: pointer in FFI is null
[ERROR distinst:ffi/src/lib.rs:48] libdistinst: pointer in FFI is null
[ERROR distinst:ffi/src/lib.rs:48] libdistinst: pointer in FFI is null

So, the problem is the second nvme-namespace /dev/nvme0n2 which seems to be particular to Apple-Devices and to contain proprietary stuff and is impossible to access using e.g. gparted which soft-fails with Invalid argument during seek for read on /dev/nvme0n2. /dev/nvme0n1 corresponds to the internal hard drive in the sense that when I create partitions on macOS it creates them in nvm0n1. nvme0n2 instead is hidden in macOS.

I get that this is hardware specific (or is it?), but what maybe makes this a POP!_OS issue is that the Ubuntu installer doesn't crash in this case, it successfully loads the partitioning selection and just lists the namespace nvme0n2 as a device without complaining. Installation works fine.

Also, in the POP!_OS live session, when deleting /dev/nvme0n2, the installer successfully loads the partitioning dialogue but displays my 500GB drive as just being ~63GB. The partitions on nvme0n1 are also proportionally smaller which makes it impossible to try to install POP!_OS that way because the installer says the ESP is too small.

So, maybe one could make the installer soft-fail on drives it cannot access?

Noirbot commented 2 years ago

I'm also having this issue on a 2017 Macbook and it's completely blocking me from installing Pop. @rbosh did you ever find a workaround?

For what it's worth, Ubuntu LTS does indeed still cleanly work around this and just install fine, so it seems to be an issue with Pop. In my case, I'm getting through the "Pick your Language" and "Keyboard Layout" pages of the Pop Installer only to have it hard-crash when trying to do whatever comes next.

CAReyes commented 2 weeks ago

I am also running into this issue on my 2016 MacBook Pro non-touchbar. I'm willing to work on this issue if no one else has the time. Feel free to reach out.

jacobgkau commented 2 weeks ago

@CAReyes Contributions are certainly welcome. I see you've made a fork with a commit, is that working for you? Feel free to open a PR to get some eyes on it.

CAReyes commented 2 weeks ago

I haven't been able to test it yet. I'll open a pull request if you think it's a beneficial addition.