I was trying to create a GTP partition table in an SD card using the following command:
sudo sgdisk --clear --new=1:2048:67583 --new=2 --typecode=1:3000 --typecode=2:8300 /dev/sdb
My problem is that the device I wanted to partition was the /dev/sdf
instead of the /dev/sdb
which I used in the command, which also happens to be the partition into which I am currently booted, running on Ubuntu 20.04.
Once the command finished executing it printed a message that the changes would take hold after a reboot or after running partprobe which I did. I am currently backing up my data in case I can not log in after reboot but I would also like to know if there is any chance of reverting back to the old partition table.
I run an fdisk
both before and after running the sgdisk
command and here is the partitions of the disk:
BEFORE
Disk /dev/sdb: 465,78 GiB, 500107862016 bytes, 976773168 sectors
Disk model: WDC WD5000AAKX-0
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: dos
Disk identifier: 0xcd8fe8f7
Device |
Boot |
Start |
End |
Sectors |
Size |
Id |
Type |
/dev/sdb1 |
* |
2048 |
1050623 |
1048576 |
512M |
ef |
EFI (FAT-12/16/32) |
/dev/sdb2 |
|
1052671 |
976771071 |
975718401 |
465,3G |
f |
W95 Ext'd (LBA) |
/dev/sdb5 |
|
1052672 |
976771071 |
975718400 |
465,3G |
83 |
Linux |
AFTER
Disk /dev/sdb: 465,78 GiB, 500107862016 bytes, 976773168 sectors
Disk model: WDC WD5000AAKX-0
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: dos
Disk identifier: 0xcd8fe8f7
Device |
Boot |
Start |
End |
Sectors |
Size |
Id |
Type |
/sdb1 |
* |
2048 |
1050623 |
1048576 |
512M |
ef |
EFI (FAT-12/16/32) |
/dev/sdb2 |
|
1052670 |
976771071 |
975718402 |
465,3G |
5 |
Extended |
/dev/sdb5 |
|
1052672 |
976771071 |
975718400 |
465,3G |
83 |
Linux |
Any ideas? Thank you in advance.