On my Debian 8 server HDD /dev/sda crashed. mdadm informed me via email and I had the disk replaced.
After the server was back up I copied over my GPT from using sgdisk -R /dev/sdb /dev/sda. The second I hit "Enter" on my keyboard I realized my mistake.
So now I have an empty GPT on both disks.
My question is if it is possible to re-create the GPT on /dev/sdb as the server is still running as I did not reboot since copying the wrong GPT?
I did a backup with sfdisk -d /dev/sdb > sdb.partition.table before the faulty HDD was replaced. But as I did not do a backup with sgdisk the backup is completely useless, if I am correct?
Additionally I have this output from fdisk -l from before copying the GPT:
Disk /dev/sdb: 2.7 TiB, 3000592982016 bytes, 5860533168 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 Disklabel type: gpt Disk identifier: 454774BD-960F-45C6-8C82-AE5C156444E0 Device Start End Sectors Size Type /dev/sdb1 4096 33558527 33554432 16G Linux RAID /dev/sdb2 33558528 34607103 1048576 512M Linux RAID /dev/sdb3 34607104 5860533134 5825926031 2.7T Linux RAID /dev/sdb4 2048 4095 2048 1M BIOS boot Partition table entries are not in disk order. Disk /dev/md0: 16 GiB, 17171349504 bytes, 33537792 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 /dev/md1: 511.7 MiB, 536543232 bytes, 1047936 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 /dev/md2: 2.7 TiB, 2982739705856 bytes, 5825663488 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