Ubiquity crashes when partitioning the disk with ZFS installation

Bug #1856863 reported by Pablo Mendez Hernandez
28
This bug affects 4 people
Affects Status Importance Assigned to Milestone
ubiquity (Ubuntu)
Fix Released
High
Jean-Baptiste Lallement
Focal
Fix Released
High
Jean-Baptiste Lallement

Bug Description

Ubiquity crashes while formatting ZFS disks.

ProblemType: Bug
DistroRelease: Ubuntu 19.10
Package: ubiquity 19.10.21
ProcVersionSignature: Ubuntu 5.3.0-18.19-generic 5.3.1
Uname: Linux 5.3.0-18-generic x86_64
NonfreeKernelModules: zfs zunicode zavl icp zcommon znvpair
ApportVersion: 2.20.11-0ubuntu8
Architecture: amd64
CasperVersion: 1.427
Date: Wed Dec 18 16:24:36 2019
InstallCmdLine: file=/cdrom/preseed/ubuntu.seed initrd=/casper/initrd quiet splash --- maybe-ubiquity
LiveMediaBuild: Ubuntu 19.10 "Eoan Ermine" - Release amd64 (20191017)
SourcePackage: ubiquity
UpgradeStatus: No upgrade log present (probably fresh install)

Related branches

Revision history for this message
Pablo Mendez Hernandez (pablomh) wrote :
Revision history for this message
Pablo Mendez Hernandez (pablomh) wrote :

This is using a KVM console offered as HETZNER service.

Revision history for this message
Pablo Mendez Hernandez (pablomh) wrote :

The backend installation disk is a 8 TB SATA drive and the weird part of the logs is (to me):

. . .
Dec 18 15:24:28 ubuntu ubiquity: >>> Created a new GPT disklabel (GUID: 7AC8DCFB-DB54-8D48-9004-E1540F18BD4B).
Dec 18 15:24:28 ubuntu ubiquity: /dev/sda1: Created a new partition 2 of type 'VMware Virsto' and of size 50 MiB.
Dec 18 15:24:28 ubuntu ubiquity: Partition #2 contains a ext4 signature.
Dec 18 15:24:28 ubuntu ubiquity: /dev/sda3: Created a new partition 3 of type 'Sony boot partition' and of size 7.3 TiB.
Dec 18 15:24:28 ubuntu ubiquity: /dev/sda4: Created a new partition 5 of type 'VMware Virtual SAN' and of size 512 B.
Dec 18 15:24:28 ubuntu ubiquity: /dev/sda6:
Dec 18 15:24:28 ubuntu ubiquity: Failed to add #6 partition
Dec 18 15:24:28 ubuntu ubiquity: : Invalid argument
Dec 18 15:24:28 ubuntu ubiquity: Leaving.

Changed in ubiquity (Ubuntu):
status: New → Confirmed
importance: Undecided → Medium
tags: added: rls-ff-incoming
summary: - Ubiquity crashes while installing on ZFS
+ Ubiquity crashes when partitioning the disk with ZFS installation
Revision history for this message
Pablo Mendez Hernandez (pablomh) wrote :

The issue seems to affect only non-UEFI system configurations (after disabling CSM in the BIOS) I haven't been able to reproduce it, so I assume it has something to do with trying to install ZFS (GPT??) on disks >4TB, but I haven't been able to test that hypothesis.

Revision history for this message
Jean-Baptiste Lallement (jibel) wrote :

Right it's an issue with CSM but I haven't been able to figure out exactly what and produce a test case. The 4TB limit is a very good point though. I'll do some more testing based on this hypothesis after EOY break.
Thanks for testing and your help.

tags: added: zfs
Revision history for this message
Pablo Mendez Hernandez (pablomh) wrote :

The issue stems from the assumption made by the installer that only EFI systems need to label disks as GPT. I've created a non-UEFI VM with an 8 GB thin-disk and was able to reproduce the issue, but the following diff was enough to make the installation to succeed:

---

root@ubuntu:/usr/share/ubiquity# diff -u zsys-setup.orig zsys-setup
--- zsys-setup.orig 2019-12-31 20:53:20.861713613 +0200
+++ zsys-setup 2019-12-31 21:23:50.115938723 +0200
@@ -167,9 +167,11 @@
  sfdiskopts=""
  partprefix="${disk}${PARTBASE}"

+ labeltype=$(sfdisk -l "${disk}"|grep '^Disklabel type:'|awk '{print $NF}')
+
  echo "I: Formatting disk $disk with partitions grub:${partgrub} ext:${partext} bpool:${partbpool} rpool:${partrpool}"

- if [ "${IS_EFI}" = "true" ]; then
+ if [ "${IS_EFI}" = "true" -o "${labeltype}" = "gpt" ]; then

   # Improvement: Delete all the partitions but the ESP
   # We should be only 1 or 2 partittion but well it can be made generic

---

It is a bit rough and doesn't apply to current HEAD (I applied it to the live image code) but it shows the issue and how it can be patched/"workarounded".

Regards, and happy new year.

Changed in ubiquity (Ubuntu Focal):
importance: Medium → High
status: Confirmed → Triaged
assignee: nobody → Jean-Baptiste Lallement (jibel)
Revision history for this message
Jean-Baptiste Lallement (jibel) wrote :

Thank you for the patch. I'll apply it.

Looking at partman-auto it uses gpt instead of msdos disklabel if the disk is larger than 2TB. It was the case of the original bug report and the duplicate.

Revision history for this message
Jean-Baptiste Lallement (jibel) wrote :

I attached a branch that fixes this issue. It's a slightly different implementation from what you suggested but basically the idea is the same.

I tested it on a system with gpt and msdos disk labels with and without an efi firmware.

Revision history for this message
Pablo Mendez Hernandez (pablomh) wrote :

Thanks for your fix (it's indeed much cleaner than mine) and I look forward to test it.

Do you plean to integrate it in any 19.10.x installer release? Is there any daily build I can test with the fix included?

Revision history for this message
Jean-Baptiste Lallement (jibel) wrote :

We'll do a release of ubiquity with this fix likely this week or next. It'll close this bug report automatically and you'll be notified. Then, next daily of focal will have the fix.

It won't be released to 19.10. There is no point release or daily images for non-LTS releases.

Revision history for this message
Jean-Baptiste Lallement (jibel) wrote :

Setting back to "In progress", there is still one bit of the fix missing according to 1856863 to make a gpt partition bootable on legacy bios.

Changed in ubiquity (Ubuntu Focal):
status: Triaged → In Progress
Revision history for this message
Jean-Baptiste Lallement (jibel) wrote :

I meant bug 1858966

Steve Langasek (vorlon)
tags: removed: rls-ff-incoming
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package ubiquity - 20.04.5

---------------
ubiquity (20.04.5) focal; urgency=medium

  [ Jean-Baptiste Lallement ]
  * zsys-setup: Drives bigger than 2TB use GPT but if the machine has been
    booted in legacy mode the ESP is not created. Rely on the label type
    instead of the firmware to know how to partition the disk (LP: #1856863).
    Thanks to Pablo Mendez Hernandez for the investigation.

  [ Iain Lane ]
  * Automatic update of included source packages: choose-mirror
    2.78ubuntu7, console-setup 1.194ubuntu2, partman-basicmethods 70,
    partman-jfs 58, partman-lvm 132, preseed 1.71ubuntu11, shim-signed
    1.41.

  [ Dimitri John Ledkov ]
  * Automatic update of included source packages: partman-auto
    134ubuntu13.

 -- Dimitri John Ledkov <email address hidden> Wed, 19 Feb 2020 20:15:17 +0000

Changed in ubiquity (Ubuntu Focal):
status: In Progress → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.