← Back to team overview

sts-sponsors team mailing list archive

[Bug 1733276] [NEW] Cannot resize partitions on NVME devices due to bad device name parsing

 

You have been subscribed to a public bug by Eric Desrochers (slashd):

[Impact]

It is not possible to resize NVME partitions in the Ubiquity installer.
NVME devices have an unusual device format, specifically e.g. /dev/nvme0n1p1 that has two 'sections' that potentially look like partitions.

Based on the error message, it seems that this device name is being
parsed incorrectly and it attempts to use the device path /dev/nvme0n1
instead of /dev/nvme0n1p1

[Test Case]

You can test this using qemu and a virtual NVME device. If you toggle
the same device/partition between a virtual SCSI/IDE and an NVME device
- the issue appears and disappears.

Commands you can use to replicate the issue - unpack netboot.tar.gz into
the local directory and then

dd if=/dev/zero of=nvme.disk bs=1M count=16384

NVME:
qemu-system-x86_64 -drive file=nvme.disk,if=none,id=drv0,format=raw -device nvme,drive=drv0,serial=foo -enable-kvm -smp 2 -m 1024 -kernel xenial/ubuntu-installer/amd64/linux -initrd xenial/ubuntu-installer/amd64/initrd.gz

SCSI:
qemu-system-x86_64 -drive file=nvme.disk,if=none,id=drv0,format=raw -device virtio-blk-pci,scsi=off,bus=pci.0,addr=0x7,drive=drv0,id=virtio-disk0,bootindex=1 -enable-kvm -smp 2 -m 1024 -kernel ubuntu-installer/amd64/linux -initrd ubuntu-installer/amd64/initrd.gz

[Regression Potential]

 * Low risk of regression, with this patch, partman, will be more robust and align with what disk_name() in the kernel does (linux.git/tree/block/partition-generic.c). It is sufficient to check
whether the last character is a digit.

[Other Info]

* Debian upstream fix :
https://anonscm.debian.org/cgit/d-i/partman-partitioning.git/commit/?id=01087125e07a7b22da589e8116f9ef7a26275006

* Commit [01087125]
Make get_real_device() both simpler and more generic (See: #820818).
Looking at the implementation of the disk_name() function in the kernel
(linux.git/tree/block/partition-generic.c), it is sufficient to check
whether the last character is a digit.

* $ git describe --contains 01087125e07a7b22da589e8116f9ef7a26275006
116~2

* $ rmadison partman-partitioning
 partman-partitioning | 85ubuntu2    | precise/main/debian-installer
 partman-partitioning | 99ubuntu1    | trusty/main/debian-installer
 partman-partitioning | 110ubuntu4.1 | xenial-updates/main/debian-installer
 partman-partitioning | 114ubuntu2   | zesty/main/debian-installer
 partman-partitioning | 114ubuntu2   | artful/main/debian-installer
 partman-partitioning | 120ubuntu1   | bionic/main/debian-installer

[Original Description]

It is not possible to resize NVME partitions in the Ubiquity installer.
This appears to affect multiple filesystem types including NTFS and
ext4.

NVME devices have an unusual device format, specifically e.g.
/dev/nvme0n1p1 that has two 'sections' that potentially look like
partitions.

Based on the error message, it seems that this device name is being
parsed incorrectly and it attempts to use the device path /dev/nvme0n1
instead of /dev/nvme0n1p1

You can test this using qemu and a virtual NVME device.  If you toggle
the same device/partition between a virtual SCSI/IDE and an NVME device
- the issue appears and disappears.

Commands you can use to replicate the issue - unpack netboot.tar.gz into
the local directory and then

dd if=/dev/zero of=nvme.disk bs=1M count=16384

NVME:
qemu-system-x86_64 -drive file=nvme.disk,if=none,id=drv0,format=raw -device nvme,drive=drv0,serial=foo -enable-kvm -smp 2 -m 1024 -kernel xenial/ubuntu-installer/amd64/linux -initrd xenial/ubuntu-installer/amd64/initrd.gz

SCSI:
qemu-system-x86_64 -drive file=nvme.disk,if=none,id=drv0,format=raw  -device virtio-blk-pci,scsi=off,bus=pci.0,addr=0x7,drive=drv0,id=virtio-disk0,bootindex=1  -enable-kvm -smp 2 -m 1024 -kernel ubuntu-installer/amd64/linux -initrd ubuntu-installer/amd64/initrd.gz

** Affects: partman-partitioning
     Importance: Unknown
         Status: Fix Released

** Affects: debian-installer (Ubuntu)
     Importance: Undecided
         Status: Confirmed

** Affects: partman-partitioning (Ubuntu)
     Importance: Undecided
     Assignee: Dimitri John Ledkov (xnox)
         Status: Fix Released

** Affects: debian-installer (Ubuntu Trusty)
     Importance: Undecided
         Status: New

** Affects: partman-partitioning (Ubuntu Trusty)
     Importance: Undecided
         Status: New

** Affects: debian-installer (Ubuntu Xenial)
     Importance: Undecided
         Status: New

** Affects: partman-partitioning (Ubuntu Xenial)
     Importance: Undecided
         Status: New

** Affects: debian-installer (Ubuntu Zesty)
     Importance: Undecided
         Status: New

** Affects: partman-partitioning (Ubuntu Zesty)
     Importance: Undecided
         Status: New

** Affects: debian-installer (Ubuntu Artful)
     Importance: Undecided
         Status: New

** Affects: partman-partitioning (Ubuntu Artful)
     Importance: Undecided
         Status: New

** Affects: debian-installer (Ubuntu Bionic)
     Importance: Undecided
         Status: Confirmed

** Affects: partman-partitioning (Ubuntu Bionic)
     Importance: Undecided
     Assignee: Dimitri John Ledkov (xnox)
         Status: Fix Released


** Tags: patch sts sts-sru-needed
-- 
Cannot resize partitions on NVME devices due to bad device name parsing
https://bugs.launchpad.net/bugs/1733276
You received this bug notification because you are a member of STS Sponsors, which is subscribed to the bug report.