The gdisk package and therefor sgdisk was not installed. It seems this
is why the GPT partition was not created correctly. After installing
sgdisk the partition was created successfully from sector 2048.

** Changed in: cloud-init
       Status: New => Invalid

-- 
You received this bug notification because you are a member of Yahoo!
Engineering Team, which is subscribed to cloud-init.
https://bugs.launchpad.net/bugs/1796959

Title:
  cloud-init disk_setup creates misaligned partition

Status in cloud-init:
  Invalid

Bug description:
  [Impact]
  Cloud-init disk_setup has the function to partition disks on devices.
  Partitions are not usable as sfdisk creates new partitions starting on sector 
1. It seems either no start sector value is being passed to sfdisk during 
execution, or an incorrect start sector value of 1 is being passed.

  [Configuration]
  ### User Data ###
  disk_setup:
    /dev/sdc:
      type: gpt
      layout: auto
      overwrite: True

  [Resulting Logs]
  ### /var/log/cloud-init.log ###
  2018-10-08 12:51:29,732 - cc_disk_setup.py[DEBUG]: Partitioning disks: 
{'/dev/disk/cloud/azure_resource': {'_origname': 'ephemeral0', 'table_type': 
'gpt', 'layout': [100], 'overwrite': True}, '/dev/sdc': {'layout': True, 
'type': 'gpt'}}
  2018-10-08 12:51:29,920 - cc_disk_setup.py[DEBUG]: Checking values for 
/dev/sdc definition
  2018-10-08 12:51:29,921 - cc_disk_setup.py[DEBUG]: Checking if device 
/dev/sdc is a valid device
  2018-10-08 12:51:29,921 - util.py[DEBUG]: Running command ['/usr/bin/lsblk', 
'--pairs', '--output', 'NAME,TYPE,FSTYPE,LABEL', '/dev/sdc', '--nodeps'] with 
allowed return codes [0] (shell=False, capture=True)
  2018-10-08 12:51:29,939 - util.py[DEBUG]: Running command 
['/usr/sbin/blockdev', '--rereadpt', '/dev/sdc'] with allowed return codes [0] 
(shell=False, capture=True)
  2018-10-08 12:51:29,955 - util.py[DEBUG]: Running command 
['/usr/sbin/sfdisk', '-l', '/dev/sdc'] with allowed return codes [0] 
(shell=False, capture=True)
  2018-10-08 12:51:30,040 - util.py[DEBUG]: Running command ['/usr/bin/lsblk', 
'--pairs', '--output', 'NAME,TYPE,FSTYPE,LABEL', '/dev/sdc'] with allowed 
return codes [0] (shell=False, capture=True)
  2018-10-08 12:51:30,045 - util.py[DEBUG]: Running command ['/usr/sbin/blkid', 
'-c', '/dev/null', '/dev/sdc'] with allowed return codes [0, 2] (shell=False, 
capture=True)
  2018-10-08 12:51:30,055 - util.py[DEBUG]: Running command ['/usr/sbin/blkid', 
'-c', '/dev/null', '/dev/sdc'] with allowed return codes [0, 2] (shell=False, 
capture=True)
  2018-10-08 12:51:30,063 - util.py[DEBUG]: Running command 
['/usr/sbin/blockdev', '--getsize64', '/dev/sdc'] with allowed return codes [0] 
(shell=False, capture=True)
  2018-10-08 12:51:30,066 - util.py[DEBUG]: Running command 
['/usr/sbin/blockdev', '--getss', '/dev/sdc'] with allowed return codes [0] 
(shell=False, capture=True)
  2018-10-08 12:51:30,070 - cc_disk_setup.py[DEBUG]: Creating partition table 
on /dev/sdc
  2018-10-08 12:51:30,070 - util.py[DEBUG]: Running command 
['/usr/sbin/sfdisk', '--Linux', '--unit=S', '--force', '/dev/sdc'] with allowed 
return codes [0] (shell=False, capture=True)
  2018-10-08 12:51:30,178 - util.py[DEBUG]: Running command 
['/usr/sbin/blockdev', '--rereadpt', '/dev/sdc'] with allowed return codes [0] 
(shell=False, capture=True)
  2018-10-08 12:51:30,218 - cc_disk_setup.py[DEBUG]: Partition table created 
for /dev/sdc
  2018-10-08 12:51:30,218 - util.py[DEBUG]: Creating partition on /dev/sdc took 
0.298 seconds
  2018-10-08 12:51:30,218 - cc_disk_setup.py[DEBUG]: setting up filesystems: 
[{'device': '/dev/sdc1', 'label': 'data-dsk01', 'filesystem': 'xfs'}]

  2018-10-08 12:51:30,225 - util.py[DEBUG]: Running command 
['/usr/sbin/mkfs.xfs', '/dev/sdc1', '-L', 'data-dsk01'] with allowed return 
codes [0] (shell=Fal$
  2018-10-08 12:51:30,300 - util.py[DEBUG]: Creating fs for /dev/sdc1 took 
0.082 seconds
  2018-10-08 12:51:30,300 - util.py[WARNING]: Failed during filesystem operation
  Failed to exec of '['/usr/sbin/mkfs.xfs', '/dev/sdc1', '-L', 'data-dsk01']':
  Unexpected error while running command.
  Command: ['/usr/sbin/mkfs.xfs', '/dev/sdc1', '-L', 'data-dsk01']
  Exit code: 1
  Reason: -
  Stdout: -
  Stderr: warning: device is not properly aligned /dev/sdc1
          Use -f to force usage of a misaligned device
  2018-10-08 12:51:30,300 - util.py[DEBUG]: Failed during filesystem operation
  Failed to exec of '['/usr/sbin/mkfs.xfs', '/dev/sdc1', '-L', 'data-dsk01']':
  Unexpected error while running command.
  Command: ['/usr/sbin/mkfs.xfs', '/dev/sdc1', '-L', 'data-dsk01']
  Exit code: 1
  Reason: -
  Stdout: -
  Stderr: warning: device is not properly aligned /dev/sdc1
          Use -f to force usage of a misaligned device

  ### fdisk ###
  $fdisk -l /dev/sdc

  Disk /dev/sdc: 10.7 GB, 10737418240 bytes, 20971520 sectors
  Units = sectors of 1 * 512 = 512 bytes
  Sector size (logical/physical): 512 bytes / 4096 bytes
  I/O size (minimum/optimal): 4096 bytes / 4096 bytes
  Disk label type: dos
  Disk identifier: 0x00000000

     Device Boot      Start         End      Blocks   Id  System
  /dev/sdc1               1    20971519    10485759+  83  Linux
  Partition 1 does not start on physical sector boundary.

  [System Information]
  CentOS Linux release 7.5.1804 (Core)
  Kernel 3.10.0-862.14.4.el7.x86_64
  Package:
    Name        : cloud-init
    Arch        : x86_64
    Version     : 0.7.9
    Release     : 24.el7.centos.1

To manage notifications about this bug go to:
https://bugs.launchpad.net/cloud-init/+bug/1796959/+subscriptions

-- 
Mailing list: https://launchpad.net/~yahoo-eng-team
Post to     : yahoo-eng-team@lists.launchpad.net
Unsubscribe : https://launchpad.net/~yahoo-eng-team
More help   : https://help.launchpad.net/ListHelp

Reply via email to