Deleting accidental GPT partition and writing restored Intel partition table
Posted: 25 Sep 2019, 13:19
I'm using Debian Stable.
I was using the root account to wipe some drives and was using sgdisk to copy over the GPT partition table from to .
The command was
and then
. My primary hard disk is sda and I have another hard disk, sdb. sgdisk told me that I should probably do something something because kernel something and then that i should look into partprobe and kpartx. So I in my blind stupor just entered partprobe and pressed enter and it showed that I had something like 9xxxxxxxx ish space and that it should be done something to and then I just C-c'ed it because I was spooked. And then the entire system just exited X and threw me back on the tty and then I turned it off from the UPS and then turned it on again, and there's nothing there, just an oversized underline cursor on the left of my screen.
It turns out that the partition that was to be written to /dev/sdd is now written on /dev/sda.
I found my old partition (Intel-type) through testdisk and wrote it to the disk and after a reboot, testdisk still identifies it as gpt, and not intel. I tried writing it again, and it gave me the same result.
gpt table, still on the disk:
the required table, from the Intel submenu:
Any ideas? There's no delete option on the gpt submenu, but there is one on the intel submenu. I would like to make my disk bootable again. A cursory inspection shows that no data is lost.
I also tried flashing the testdisk MBR, but no dice, it gave me no result on any of the four numbers.
I was using the root account to wipe some drives and was using sgdisk to copy over the GPT partition table from
Code: Select all
/dev/sdc
Code: Select all
/dev/sdd
The command was
Code: Select all
sgdisk -R /dev/sdd /dev/sdc
Code: Select all
sgdisk -G /dev/sdd
It turns out that the partition that was to be written to /dev/sdd is now written on /dev/sda.
I found my old partition (Intel-type) through testdisk and wrote it to the disk and after a reboot, testdisk still identifies it as gpt, and not intel. I tried writing it again, and it gave me the same result.
gpt table, still on the disk:
Code: Select all
https://i.imgur.com/cw8DZn3.jpg
Code: Select all
https://i.imgur.com/6ZajNbG.jpg
I also tried flashing the testdisk MBR, but no dice, it gave me no result on any of the four numbers.