How to extend a disk which contains a GPT partition table?

Solution Verified - Updated -

Issue

  • After extending a disk on the storage side and verifying the additional space is seen from the operating system, the following messages can be seen every time the disk is discovered, i.e., during boot:

    Nov  9 11:05:51 rhel72 kernel: sd 9:0:0:3: [sdd] 245760 512-byte logical blocks: (125 MB/120 MiB)
    Nov  9 11:05:51 rhel72 kernel: sd 9:0:0:3: Attached scsi generic sg4 type 0
    Nov  9 11:05:51 rhel72 kernel: sd 9:0:0:3: [sdd] Write Protect is off
    Nov  9 11:05:51 rhel72 kernel: sd 9:0:0:3: [sdd] Write cache: enabled, read cache: enabled, supports DPO and FUA
    Nov  9 11:05:51 rhel72 kernel: GPT:Primary header thinks Alt. header is not at the end of the disk.
    Nov  9 11:05:51 rhel72 kernel: GPT:212991 != 245759
    Nov  9 11:05:51 rhel72 kernel: GPT:Alternate GPT header not at the end of the disk.
    Nov  9 11:05:51 rhel72 kernel: GPT:212991 != 245759
    Nov  9 11:05:51 rhel72 kernel: GPT: Use GNU Parted to correct GPT errors.
  • Why can't I use all the disk space to create a new GPT partition?

    Model: Linux device-mapper (multipath) (dm)
    Disk /dev/mapper/mpathb: 245760s
    Sector size (logical/physical): 512B/512B
    Partition Table: gpt
    Disk Flags: 
    
    Number  Start  End      Size    File system  Name     Flags
     1      34s    100000s  99967s               primary
    
    (parted) mkpart primary 100001s 245700s                              
    Warning: You requested a partition from 100001s to 245700s (sectors 100001..245700).
    The closest location we can manage is 100001s to 212958s (sectors 100001..212958).
    Is this still acceptable to you?
    Yes/No? 
    
  • A resized disk is not showing the correct, increased size.
    • before:
      # fdisk -lu /dev/sdaf
      WARNING: fdisk GPT support is currently new, and therefore in an experimental phase. Use at your own discretion.
      
      Disk /dev/sdaf: 10.7 GB, 10737418240 bytes, 20971520 sectors
    • after resizing to 20GB, still showing old size:
      # fdisk -lu /dev/sdaf
      
      Disk /dev/sdaf: 10.7 GB, 10737418240 bytes, 20971520 sectors
  • After resizing a disk, fdisk no longer shows the GPT table information:
    • before:
      # fdisk -lu /dev/sdaf
      :
      Disk label type: gpt
    • after resize:
      # fdisk -lu /dev/sdaf
      :
      Disk label type: dos

Environment

  • Red Hat Enterprise Linux (RHEL) 6, 7, 8, 9

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.

Current Customers and Partners

Log in for full access

Log In

New to Red Hat?

Learn more about Red Hat subscriptions

Using a Red Hat product through a public cloud?

How to access this content