2

I cloned a HDD 320GB in a new SSD 1TB but now I'm not able to create a new partition in the physical empty space of the new support. With gdisk I've tried to create one with n but the available sectors are limited to the old disk size.

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.

Command (? for help): p
Disk /dev/sda: 1953525168 sectors, 931.5 GiB
Logical sector size: 512 bytes
Disk identifier (GUID): CD2076D4-0A3C-4C9D-9E20-269AC17A5A49
Partition table holds up to 128 entries
First usable sector is 34, last usable sector is 625142414
Partitions will be aligned on 2048-sector boundaries
Total free space is 2669 sectors (1.3 MiB)

Number  Start (sector)    End (sector)  Size       Code  Name
   1            2048         1050623   512.0 MiB   EF00  EFI System Partition
   2         1050624       623140863   296.6 GiB   8300
   3       623140864       625141759   977.0 MiB   8200

Command (? for help): n
Partition number (4-128, default 4): 4
First sector (34-625142414, default = 34) or {+-}size{KMGTP}:

how can I create a new partition without lose all the data?

2
  • 1
    How did you clone the disk?
    – harrymc
    Commented Jul 19, 2019 at 16:07
  • With gparted live
    – fireb86
    Commented Jul 20, 2019 at 23:22

1 Answer 1

3

The main GPT partition table is on the 1st sector on the disk; the backup is supposed to be on the last sector; and all partitions must reside between the two. When you clone to a larger disk, the backup partition table ends up being somewhere in the middle – the clone tool doesn't update its position in the main table – but the restriction that all partitions must be between them still applies.

Go to the expert menu (x), then use the command e "relocate backup data structures to the end of the disk". Then do your changes and write the partition table. (You can use p to verify that "Total free space" is now shown correctly.)

Alternatively, use util-linux fdisk – it will automatically relocate the backup GPT during write. So it's enough just to load the partition table and just write it out again, if you don't want to actually use fdisk for partitioning.

2
  • 1
    It works! I used gdisk with x -> e -> w, after that I created a new partition with n
    – fireb86
    Commented Jul 19, 2019 at 21:06
  • This issue and solution is also explained in gdisk when using the verify command
    – gileri
    Commented Dec 5, 2023 at 10:20

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .