I Accidentally deleted EFI partition /dev/sda1

New to Debian (Or Linux in general)? Ask your questions here!

I Accidentally deleted EFI partition /dev/sda1

Postby MemoryChannel » 2018-11-08 17:54

Hello everyone

I'm trying to recover from accidentally deleting the first (probably /dev/sda1) 500Mb partition in Debian 9

I know, the question might sound silly and trust me I was wandering for a fix for hours, but no solution I found really fit what I see on my screen and I would like to avoid making things worse.

I wanted to manually delete a partition from an SD card but I was on the wrong tab. Instead I deleted the partition on the far left of the system SSD that weight around 500 meg

So now I have the following :

Code: Select all
fdisk -l
/dev/sda2 Linux filesystem
/dev/sda3 Linux swap


and I do have 537 meg of free space at te beginning of the SSD, I'm using graphic rescue mode on debian9 dvd, trying to partiton that free space EFI partition or anything else doest go through and I got "not root filesystem is defined", that is implying I should create a root partition which I already have at /dev/sda2 right?

I would be great if someone can hand me here a fix for this or any link that explain a fix for this problem, aiming to avoid making things worse

Thanks a lot !
MemoryChannel
 
Posts: 2
Joined: 2018-11-08 17:28

Re: I Accidentally deleted EFI partition /dev/sda1

Postby Segfault » 2018-11-08 18:00

Deleting an entry from partition table won't delete the partition. Re-create the partition table entry and everything will be back as nothing ever happened. There is a cool tool which is good at guessing in case you are not sure where your partition was exactly, it is called testdisk. With first partition there is no guessing, though.
Segfault
 
Posts: 762
Joined: 2005-09-24 12:24

Re: I Accidentally deleted EFI partition /dev/sda1

Postby bw123 » 2018-11-08 18:34

...I'm using graphic rescue mode on debian9 dvd, trying to partiton that free space EFI partition or anything else doest go through and I got "not root filesystem is defined", that is implying I should create a root partition which I already have at /dev/sda2 right?


I don't think you can use the "partition disks" menu in installer that way. Select the "rescue shell" on the linux partition and use fdisk, or maybe cfdisk.
User avatar
bw123
 
Posts: 3528
Joined: 2011-05-09 06:02
Location: TN_USA

Re: I Accidentally deleted EFI partition /dev/sda1

Postby Segfault » 2018-11-08 18:38

In any case the tool you are using must be GPT aware. Older versions of fdisk cannot handle GPT.
Segfault
 
Posts: 762
Joined: 2005-09-24 12:24

Re: I Accidentally deleted EFI partition /dev/sda1

Postby MemoryChannel » 2018-11-08 18:47

bw123 wrote:
...I'm using graphic rescue mode on debian9 dvd, trying to partiton that free space EFI partition or anything else doest go through and I got "not root filesystem is defined", that is implying I should create a root partition which I already have at /dev/sda2 right?


I don't think you can use the "partition disks" menu in installer that way. Select the "rescue shell" on the linux partition and use fdisk, or maybe cfdisk.


yep will try doing that, thanks
MemoryChannel
 
Posts: 2
Joined: 2018-11-08 17:28

Re: I Accidentally deleted EFI partition /dev/sda1

Postby Segfault » 2018-11-08 19:50

Hmh, if getting shell is an issue for you then I suggest you better get some computer savvy friend to fix it.
Segfault
 
Posts: 762
Joined: 2005-09-24 12:24


Return to Beginners Questions

Who is online

Users browsing this forum: No registered users and 5 guests

fashionable