Scheduled Maintenance: We are aware of an issue with Google, AOL, and Yahoo services as email providers which are blocking new registrations. We are trying to fix the issue and we have several internal and external support tickets in process to resolve the issue. Please see: viewtopic.php?t=158230

 

 

 

I Accidentally deleted EFI partition /dev/sda1

New to Debian (Or Linux in general)? Ask your questions here!
Post Reply
Message
Author
MemoryChannel
Posts: 2
Joined: 2018-11-08 17:28

I Accidentally deleted EFI partition /dev/sda1

#1 Post by MemoryChannel »

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 !

Segfault
Posts: 993
Joined: 2005-09-24 12:24
Has thanked: 5 times
Been thanked: 17 times

Re: I Accidentally deleted EFI partition /dev/sda1

#2 Post by Segfault »

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.

User avatar
bw123
Posts: 4015
Joined: 2011-05-09 06:02
Has thanked: 1 time
Been thanked: 28 times

Re: I Accidentally deleted EFI partition /dev/sda1

#3 Post by bw123 »

...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.
resigned by AI ChatGPT

Segfault
Posts: 993
Joined: 2005-09-24 12:24
Has thanked: 5 times
Been thanked: 17 times

Re: I Accidentally deleted EFI partition /dev/sda1

#4 Post by Segfault »

In any case the tool you are using must be GPT aware. Older versions of fdisk cannot handle GPT.

MemoryChannel
Posts: 2
Joined: 2018-11-08 17:28

Re: I Accidentally deleted EFI partition /dev/sda1

#5 Post by MemoryChannel »

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

Segfault
Posts: 993
Joined: 2005-09-24 12:24
Has thanked: 5 times
Been thanked: 17 times

Re: I Accidentally deleted EFI partition /dev/sda1

#6 Post by Segfault »

Hmh, if getting shell is an issue for you then I suggest you better get some computer savvy friend to fix it.

Post Reply