Comment 0 for bug 1942416

Revision history for this message
Soar Huang (soarhuang) wrote :

[Impact]
ubuntu-image will generate prebuilt image with 512B sector size only

https://github.com/CanonicalLtd/ubuntu-image/blob/12fbf84b0ec556f28dac8e4ba56f07e69efc9720/ubuntu_image/common_builder.py#L395
https://github.com/CanonicalLtd/ubuntu-image/blob/12fbf84b0ec556f28dac8e4ba56f07e69efc9720/ubuntu_image/helpers.py#L269

Unfortunately, the prebuilt image with 512B sector size
cannot work on 4K logical & physical sector size NVMe SSD

ie. Micron_7300_MTFDHBG3T8TDF 4K logical & physical sector size NVMe SSD
(Micron_7300_MTFDHBG3T8TDF_NVMeSSD.jpg)
OEM project (LP: #1942414)

[Test Plan]
Check if follow steps below, try boot from SSD, and get into Ubuntu Server/Core

* Ubuntu Server 20.04
# Running command below to generate prebuilt image, erase and dd on 4K sector size NVMe SSD
$ UBUNTU_STORE_AUTH_DATA_FILENAME=store.cred TARGET_ARCH=amd64 \
    ubuntu-image classic -d -O out -w work -f cloud-image \
    --hooks-directory hooks -a amd64 gadget/prime

$ sudo fstrim --fstab --verbose
$ sudo blkdiscard /dev/nvme0n1
$ sudo wipefs -a /dev/nvme0n1
$ sudo dd if=US2004-prebuilt.img of=/dev/nvme0n1 status=progress && sync

* Ubuntu Core 20
# Download image, erase and dd on 4K sector size NVMe SSD
# https://cdimage.ubuntu.com/ubuntu-core/20/stable/current/ubuntu-core-20-amd64.img.xz

$ sudo fstrim --fstab --verbose
$ sudo blkdiscard /dev/nvme0n1
$ sudo wipefs -a /dev/nvme0n1
$ xzcat ubuntu-core-20-amd64.img.xz | sudo dd of=/dev/nvme0n1 status=progress && sync

[Where problems could occur]
Flash 512B sector size prebuilt image on 4K sector size NVMe SSD

[Regression potential]
Use advanced format 4K sector size to become more reliable
https://www.seagate.com/as/en/tech-insights/advanced-format-4k-sector-hard-drives-master-ti/