Curtin installer failed with 4096 byte logical sector on UEFI boot

Bug #1436632 reported by Takenori MATSUMOTO
22
This bug affects 4 people
Affects Status Importance Assigned to Milestone
curtin
Fix Released
High
Ryan Harper

Bug Description

[Ubuntu version]
$ uname -a
Linux maas-17 3.16.0-33-generic #44~14.04.1-Ubuntu SMP Fri Mar 13 10:33:29 UTC 2015 x86_64 x86_64 x86_64 GNU/Linux

$ cat /etc/lsb-release
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=14.04
DISTRIB_CODENAME=trusty
DISTRIB_DESCRIPTION="Ubuntu 14.04.2 LTS"

[MAAS version]
1.7.1+bzr3341-0ubuntu1~trusty1

[Other information]
- Target node is configure as UEFI boot and 4K sector
- In case of changing boot mode to BIOS/legacy, both 12.04 and 14.04 can be provisioned by MAAS via fastpath installer. At BIOS/Legacy mode, sda is recognized as 512 sector.

[Symptom]
When target node is configured as UEFI boot, acquire & start always failed due to sgdisk failed.
The attachment is relevant log (actually this is SoL output) while enlist, commissioning, acquire & start.

The following snip is key message.
(When the node is boot as BIOS/legacy mode, sda is recognized as "584843264 512-byte logical blocks: (299 GB/278 GiB)")

I suspect that curtin installer assumes 512-byte logical sector, but it is 4096-byte logical block and total number of sector is 219594752. While, sgdisk attempts to create root partition with end sector is specified as 1756755968 which exceeds actual size (219594752).

...(snip)...
[ 17.836143] scsi 0:0:0:0: Direct-Access LSI MR9362-8i 4.22 PQ: 0 ANSI: 5
[ 17.843631] scsi 0:2:0:0: Direct-Access LSI MR9362-8i 4.22 PQ: 0 ANSI: 5
[ 17.847214] sd 0:2:0:0: [sda] 219594752 4096-byte logical blocks: (899 GB/837 GiB)
[ 17.847227] sd 0:2:0:0: Attached scsi generic sg0 type 0
[ 17.847250] sd 0:2:0:0: [sda] Write Protect is off
[ 17.847276] sd 0:2:0:0: [sda] Write cache: enabled, read cache: enabled, doesn't support DPO or FUA
[ 17.847357] sd 0:2:0:0: [sda] 219594752 4096-byte logical blocks: (899 GB/837 GiB)
[ 17.847816] sda: unknown partition table
[ 17.847871] sd 0:2:0:0: [sda] 219594752 4096-byte logical blocks: (899 GB/837 GiB)
[ 17.847916] sd 0:2:0:0: [sda] Attached SCSI disk
[ 17.865199] ipmi_si 00:09: Found new BMC (man_id: 0x000077, prod_id: 0x0683, dev_id: 0x88)

...(snip)...
Cloud-init v. 0.7.5 running 'modules:final' at Tue, 17 Mar 2015 01:12:23 +0000. Up 31.47 seconds.
Creating new GPT entries.
Could not create partition 1 from 133120 to 1756755968
Could not change partition 1's type code to 8300!
Error encountered; not saving changes.
failed to sgdisk for uefi to /dev/sda
Could not stat /dev/sda1 --- No such file or directory

The device apparently does not exist; did you specify it correctly?
Unexpected error while running command.
Command: ['mkfs.ext4', '-q', '-L', 'cloudimg-rootfs', '/dev/sda1']
Exit code: 1
Reason: -
Stdout: ''
Stderr: ''
Installation failed with exception: Unexpected error while running command.
Command: ['curtin', 'block-meta', 'simple']
Exit code: 3
Reason: -
Stdout: "Creating new GPT entries.\nCould not create partition 1 from 133120 to 1756755968\nCould not change partition 1's type code to 8300!\nError encountered; not saving changes.\nfailed to sgdisk for uefi to /dev/sda\nCould not stat /dev/sda1 --- No such file or directory\n\nThe device apparently does not exist; did you specify it correctly?\nUnexpected error while running command.\nCommand: ['mkfs.ext4', '-q', '-L', 'cloudimg-rootfs', '/dev/sda1']\nExit code: 1\nReason: -\nStdout: ''\nStderr: ''\n"
Stderr: ''
...(snip)...

Tags: curtin-sru

Related branches

Revision history for this message
Takenori MATSUMOTO (takenori-matsumoto) wrote :
Revision history for this message
Takenori MATSUMOTO (takenori-matsumoto) wrote :

Just in case, the attachment is SoL output of BIOS/legacy mode installation.

Revision history for this message
Andres Rodriguez (andreserl) wrote :

Takenori,

Please also attach the Curtin version.

Thanks!

Revision history for this message
Takenori MATSUMOTO (takenori-matsumoto) wrote :

Hi Andres,

Curtin version is as below.

$ dpkg -l | grep curtin
ii curtin-common 0.1.0~bzr201-0ubuntu1~14.04.1~ppa0 all Library and tools for curtin installer
ii python-curtin 0.1.0~bzr201-0ubuntu1~14.04.1~ppa0 all Library and tools for curtin installer

Just in case, we tried to deploy Ubuntu 12.04 with UEFI mode via d-i installer. In that case, installation is finished successfully.
So we suspect this is curtin installer issue rather than MAAS. We are not an expert, but as far as we grep typical error message "failed to sgdisk for uefi to", it looks pt_gpt() function at /usr/lib/curtin/helpers/common (which is part of curtin-common package) assumes 512 block sector.

Please let us know, if you need more information.

Revision history for this message
Narinder Gupta (narindergupta) wrote :

in non efi mode partition table created is as follows:

Number Start End Size File system Name Flags
        17.4kB 1049kB 1031kB Free Space
15 1049kB 538MB 537MB fat32 boot
 1 538MB 299GB 299GB ext4
        299GB 299GB 1031kB Free Space

Revision history for this message
Narinder Gupta (narindergupta) wrote :

ubuntu@hot-pickle:/var/log$ df -h
Filesystem Size Used Avail Use% Mounted on
/dev/sda1 274G 10G 251G 4% /
none 4.0K 0 4.0K 0% /sys/fs/cgroup
udev 16G 4.0K 16G 1% /dev
tmpfs 3.2G 1.9M 3.2G 1% /run
none 5.0M 0 5.0M 0% /run/lock
none 16G 0 16G 0% /run/shm
none 100M 0 100M 0% /run/user
/dev/sda15 511M 3.4M 508M 1% /boot/efi
ubuntu@hot-pickle:/var/log$ df
Filesystem 1K-blocks Used Available Use% Mounted on
/dev/sda1 287184296 10419336 262153812 4% /
none 4 0 4 0% /sys/fs/cgroup
udev 16414532 4 16414528 1% /dev
tmpfs 3285616 1916 3283700 1% /run
none 5120 0 5120 0% /run/lock
none 16428076 0 16428076 0% /run/shm
none 102400 0 102400 0% /run/user
/dev/sda15 523248 3428 519820 1% /boot/efi
ubuntu@hot-pickle:/var/log$

Ryan Harper (raharper)
Changed in curtin:
assignee: nobody → Ryan Harper (raharper)
importance: Undecided → High
status: New → Confirmed
Ryan Harper (raharper)
Changed in curtin:
status: Confirmed → Fix Committed
tags: added: curtin-sru
Revision history for this message
Scott Moser (smoser) wrote : Fixed in Curtin 17.1

This bug is believed to be fixed in curtin in 17.1. If this is still a problem for you, please make a comment and set the state back to New

Thank you.

Changed in curtin:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

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