I use Ubuntu 20.04. I have overwritten my EFI partition system. Then I deleted it. After I deleted it, the space became unallocated. (I opened and finalized another question for this issue question link) I have recovered it with Testdisk.
Now, I have formatted the unallocated 513 MB (which was the EFI partition system). I am trying to reinstall what was missing. Unfortunately I couldn't quite catch the idea behind what should I install and how to mount them.
My questions are:
- Before deleting the EFI partition, the file system was UDF. Now I can't format udf with gparted. What is the difference from fat32. Should I use fat32?
sudo fdisk -l /dev/sda
output says: "Partition table entries are not in disk order." What should I do?
- How should I proceed?
Partitions: after overwriting the EFI System Partition
EFI System Partition details, utf
After I deleted the EFI System Partition
After I recoverd it with testdisk
EFI System Partition details, fat32
Updates:
It turned out I recovered the MBR partition table. I search for the GPT partition table on Testdisk and I wrote that partition table. Then boot partition became sda1 and ubuntu os partition became sda2.
GPT partition table version. Testdisk recovered it as msftdata
Output of sudo fdisk -l /dev/sda
:
Disk /dev/sda: 465.78 GiB, 500107862016 bytes, 976773168 sectors
Disk model: Samsung SSD 860
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: 0xdfa258ef
Device Boot Start End Sectors Size Id Type
/dev/sda1 1050624 976771071 975720448 465.3G 83 Linux
/dev/sda2 * 2048 1050623 1048576 512M ef EFI (FAT-12/16/32)
Partition table entries are not in disk order.
Output of sudo gdisk -l /dev/sda
:
GPT fdisk (gdisk) version 1.0.5
Partition table scan:
MBR: MBR only
BSD: not present
APM: not present
GPT: present
Found valid MBR and GPT. Which do you want to use?
1 - MBR
2 - GPT
3 - Create blank GPT
Your answer: 1
Disk /dev/sda: 976773168 sectors, 465.8 GiB
Model: Samsung SSD 860
Sector size (logical/physical): 512/512 bytes
Partition table holds up to 128 entries
Main partition table begins at sector 2 and ends at sector 33
First usable sector is 34, last usable sector is 976773134
Partitions will be aligned on 2048-sector boundaries
Total free space is 4077 sectors (2.0 MiB)
Number Start (sector) End (sector) Size Code Name
1 1050624 976771071 465.3 GiB 8300 Linux filesystem
2 2048 1050623 512.0 MiB EF00 EFI system partition
After changing the partition table from MBR to GPT with Testdisk:
GPT fdisk (gdisk) version 1.0.5
Partition table scan:
MBR: protective
BSD: not present
APM: not present
GPT: present
Found valid GPT with protective MBR; using GPT.
Disk /dev/sda: 976773168 sectors, 465.8 GiB
Model: Samsung SSD 860
Sector size (logical/physical): 512/512 bytes
Partition table holds up to 128 entries
Main partition table begins at sector 2 and ends at sector 33
First usable sector is 34, last usable sector is 976773134
Partitions will be aligned on 2048-sector boundaries
Total free space is 4077 sectors (2.0 MiB)
Number Start (sector) End (sector) Size Code Name
1 2048 1050623 512.0 MiB EF00
2 1050624 976771071 465.3 GiB 8300
I seek your help and your experience.
Thank you,