I have a VM with a virtual disk (visible as /dev/sdb) with a size of 10G
The admin increased the size of the virtualdisk to 60G.
I rebooted the machine and see now, that the disk is bigger.
root@DMZMHLX3:~# lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
...
sdb 8:16 0 60G 0 disk
└─sdb1 8:17 0 10G 0 part /app
...
Now I'd like to add another partition:
gdisk tells me that the disk as a size of 60G, but that the last usable sector is a sector corresponding to the old 10G disk image size:
root@DMZMHLX3:~# gdisk -l /dev/sdb
GPT fdisk (gdisk) version 1.0.1
Partition table scan:
MBR: protective
BSD: not present
APM: not present
GPT: present
Found valid GPT with protective MBR; using GPT.
Disk /dev/sdb: 125829120 sectors, 60.0 GiB
Logical sector size: 512 bytes
Disk identifier (GUID): FCE659D1-3690-4C3C-93EC-79B51EE8556D
Partition table holds up to 128 entries
First usable sector is 34, last usable sector is 20971486
Partitions will be aligned on 2048-sector boundaries
Total free space is 4029 sectors (2.0 MiB)
Number Start (sector) End (sector) Size Code Name
1 2048 20969471 10.0 GiB 8300
last usable sector should be something like 125829120 and not 20971486.
So though the disk image size has increased and the VM sees the change I don't know how to use the newly available space.
fdisk shows me:
root@DMZMHLX3:~# fdisk -l /dev/sdb
GPT PMBR size mismatch (20971519 != 125829119) will be corrected by w(rite).
Disk /dev/sdb: 60 GiB, 64424509440 bytes, 125829120 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: gpt
Disk identifier: FCE659D1-3690-4C3C-93EC-79B51EE8556D
Device Start End Sectors Size Type
/dev/sdb1 2048 20969471 20967424 10G Linux filesystem
It recognizes a mismatch:
GPT PMBR size mismatch (20971519 != 125829119) will be corrected by w(rite). But when trying to write fdisk fails:
Command (m for help): w
GPT PMBR size mismatch (20971519 != 125829119) will be corrected by w(rite).
fdisk: failed to write disklabel: Invalid argument
root@xxx:~#
How can I fix this issue?
The ultimate goal is to increase the size of the existing partition, but even if I can just add new partitions I would already be happy