0

I was trying to format a USB key and accidentally deleted a 157MB partition that I suspect it was the booting partition from Ubuntu. But I have actually no idea of what I deleted, could have been the EFI system partition.

I was convinced that I selected the USB to be formatted and skipped all the alerts as I was getting messages of the USB being in use until then.

My Dell XPS 17" laptop has a 1T hd with Windows and Ubuntu Desktop 20.04.3 LTS installed. here is a picture of the current situation, key is the partition I have formatted: enter image description here enter image description here

running from a Live USB Ubuntu:

$ sudo fdisk -l
Disk /dev/loop0: 2.1 GiB, 2160009216 bytes, 4218768 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes

Disk /dev/loop1: 55.45 MiB, 58130432 bytes, 113536 sectors Units: sectors of 1 * 512 = 512 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes

Disk /dev/loop2: 65.1 MiB, 68259840 bytes, 133320 sectors Units: sectors of 1 * 512 = 512 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes

Disk /dev/loop3: 219 MiB, 229638144 bytes, 448512 sectors Units: sectors of 1 * 512 = 512 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes

Disk /dev/loop4: 50.98 MiB, 53432320 bytes, 104360 sectors Units: sectors of 1 * 512 = 512 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes

Disk /dev/loop5: 32.3 MiB, 33865728 bytes, 66144 sectors Units: sectors of 1 * 512 = 512 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes

Disk /dev/nvme0n1: 953.89 GiB, 1024209543168 bytes, 2000409264 sectors Disk model: Micron 2300 NVMe 1024GB
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: gpt Disk identifier: 9799531D-8078-41B9-9BFA-4D8E5889A40D

Device Start End Sectors Size Type /dev/nvme0n1p1 2048 309247 307200 150M Linux filesystem /dev/nvme0n1p2 309248 571391 262144 128M Microsoft reserved /dev/nvme0n1p3 571392 1176300355 1175728964 560.6G Microsoft basic data /dev/nvme0n1p4 1957793792 1959821311 2027520 990M Windows recovery environment /dev/nvme0n1p5 1959821312 1997438975 37617664 18G Windows recovery environment /dev/nvme0n1p6 1997441024 2000377855 2936832 1.4G Windows recovery environment /dev/nvme0n1p7 1176301568 1957793791 781492224 372.7G Linux filesystem

Partition table entries are not in disk order.

Disk /dev/sda: 29.12 GiB, 31260704768 bytes, 61056064 sectors Disk model: Cruzer Fit
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: 0x2cf4ba3a

Device Boot Start End Sectors Size Id Type /dev/sda1 * 0 5999871 5999872 2.9G 0 Empty /dev/sda2 5271500 5279499 8000 3.9M ef EFI (FAT-12/16/32) /dev/sda3 6000640 61056063 55055424 26.3G 83 Linux

$ 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: not present


Found invalid GPT and valid MBR; converting MBR to GPT format in memory.


Warning! Secondary partition table overlaps the last partition by 33 blocks! You will need to delete this partition or resize it in another utility. Disk /dev/sda: 61056064 sectors, 29.1 GiB Model: Cruzer Fit
Sector size (logical/physical): 512/512 bytes Disk identifier (GUID): 8CF0A28E-AAD6-4288-B195-4CF693FFA61F 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 61056030 Partitions will be aligned on 4-sector boundaries Total free space is 5992606 sectors (2.9 GiB)

Number Start (sector) End (sector) Size Code Name 2 5271500 5279499 3.9 MiB EF00 EFI system partition 3 6000640 61056063 26.3 GiB 8300 Linux filesystem

The machine doesn't start anymore, it goes into some scanning tool from DELL every time I start.

If I press F12 I can see the booting dialog with Ubuntu and Windows Boot Manager, but if I select them I am told "No Boot Device Found". I am currently writing from a Live Ubuntu USB, with "Try Ubuntu".

I wonder, what have I deleted looking at the picture? the second 134MB partition says to be a Microsoft Reserved partition, so I suppose the key partition I formatted was the Ubuntu boot?

Do you think that if I install the Ubuntu boot in the key partition I will be fine to start the Win/Ubuntu partitions again?

Could you some up the steps I should take to make sure I don't make any further mess? I need a little guidance for confidence.

Is it the EFI partition that I deleted or something else? Maybe I shall just install GRUB in the key partition?

  • You didn't provide release specifics; but Ubuntu does not by default have a boot partition (it's just a directory on the / partition). Are you sure you're not meaning the ESP or EFI system partition – guiverc Jan 25 '22 at 07:46
  • could well possibly be, I am not sure of what I deleted. is Ubuntu Desktop 20.04.3 LTS – user3755529 Jan 25 '22 at 07:49
  • If you search on here with “deleted EFI” there are several accepted answers – PonJar Jan 25 '22 at 08:19
  • I can get to my BIOS, and I am not sure of what I have deleted, so I am a bit scared to follow a solution from a different situation. I guess I will just reinstall windows hoping for the best – user3755529 Jan 25 '22 at 12:08
  • Your p1 is now shown as a Linux partition. Windows will not see Linux partitions. IF p1 is empty it then was probably the ESP as FAT32 formatted with boot,esp flags if using gparted. If you reformat p1 to ESP, then you still need full reinstall of grub2-efi-amd64, the UEFI version of grub and reinstall of Windows boot loader To create the files & folders in ESP and UEFI boot entry using new ESP. – oldfred Jan 25 '22 at 17:33
  • I solved by reinstalling windows from USB. I would like to salvage the prvious Ubuntu install, but now no boot takes me to it, how can I install a boot that takes me to the existing Ubuntu partition without reinstalling Ubuntu? – user3755529 Jan 25 '22 at 19:13
  • 2
    with Boot Repair!! all is sorted https://help.ubuntu.com/community/Boot-Repair – user3755529 Jan 25 '22 at 19:40

0 Answers0