#[FIXED] Accidentally corrupt GPT partition table, but already reinstalled but not boot..?

129 messages · Page 1 of 1 (latest)

steady wave
#
mount /dev/sda4 /mnt
mount /dev/sda1 /mnt/boot/efi
#
grub-install --target=x86_64-efi --efi-directory=/mnt/boot/efi --bootloader-id=debian --removable
azure geode
#

Done

#

but not boot

steady wave
#

@ember grove

azure geode
steady wave
#
mv /boot/efi/EFI/debian/grubx64.efi /boot/efi/EFI/boot/bootx64.efi
efibootmgr -c -l \\EFI\\debian\\shimx64.efi -L "Linux Boot"
#

¿Por qué estás usando el editor de archivos Dolphin y no una terminal para editar grub?

azure geode
#

And I don't mind showing the debian grub configuration because it's a test system, but I'm worried because it's my main disk :/

steady wave
#

¿Por qué no estás usando una terminal? En primer lugar, debe regenerar la configuración de grub para su disco principal y posiblemente reinstalar grub en esa partición EFI en su disco principal.

#

tu eres estupido si?

steady wave
#

and what happened?

azure geode
azure geode
steady wave
#

it's not funny when I don't understand you, it's more annoying than funny

steady wave
steady wave
#

can you show me what happens to your main drive?

#

like it fails to boot?

azure geode
# steady wave be more specific

In the boot menu there is no entry to start grub on my main disk. Despite having reinstalled the efi, grub (including configuration), kernels etc.

azure geode
steady wave
#

entonces tienes dos opciones, puedes montar tanto la partición de arranque como la partición raíz y hacer grub-install y grub-mkconfig o puedes reformatear la partición efi por completo y reinstalar grub, así como reconstruir la imagen del kernel y tu initramfs. si eso no funciona

azure geode
steady wave
#

Ellos se burlan de ti solo queriendo hacerte saber

azure geode
steady wave
#

explicame como lo hiciste? Quiero decir, ¿podrías borrar tus entradas de EFI por completo y luego hacerlo de esa manera? Quiero decir que también debes especificar la ruta del directorio EFI al realizar la instalación de grub.

azure geode
#

I explained it here, I guess it's clear, right?

steady wave
#

um

#

ejecutó dd, su disco está preparado, es mejor que use e2fsck para intentar reparar el disco en sí, pero ¿se puede montar su partición raíz?

azure geode
#

I don't usually ask anything because I fix my things myself, unless I definitely can't/know how to fix it. Like right now.

azure geode
steady wave
#

así que ingrese a un liveCD y haga una copia de seguridad de sus datos o borre la partición de inicio por completo, formatee la partición y luego reinstale grub a través de una imagen ISO como la arch iso y monte correctamente. Parece que no sabes lo que estás haciendo porque lo que te estoy explicando funcionará al 100%.

azure geode
azure geode
#

but it can't start WTF

steady wave
#

your partition table is corrupted

#

you need to move your data

#

either you can do e2fsck

#

like I said

#

if your root is saved than that's great

#

but

#

you need to reinstall

#

also why are you using debian

#

debian is ass

azure geode
steady wave
#

oh it's a server

azure geode
#

Yes, arch is very good, in fact I'm using it right now to write here XD

steady wave
#

you need to make a copy of the root data and move it over, your partition table would need to be detected and rewritten with a software but you messed it up

#
e2fsck``` might be able to fix it like I said
#

but

#

what you need to do is make a .img of the data you can save

#

using dd

#

and make a new install of debian and transfer that data over

#

comprendo

azure geode
#

Likewise, I already have the most important thing backed up (servers), but it would be great for me to avoid reinstalling and back up more than 250GB._.

steady wave
#

Usando TestDisk
TestDisk es una potente herramienta de código abierto para recuperar tablas de particiones4
. Aquí se explica cómo usarlo:

Descargue y ejecute TestDisk.
Cree un nuevo archivo de registro.
Seleccione la unidad afectada.
Elija "Analizar" para examinar la estructura de partición actual.
Seleccione "Búsqueda rápida" para comenzar a escanear.
Una vez que TestDisk enumere las particiones reconocidas, revíselas detenidamente.
Si la estructura de la partición parece correcta, seleccione "Escribir" para recuperarla.
Confirme los cambios cuando se le solicite.
#

I can't help you as you don't want to take my advice

azure geode
#

In GPT there is no MBR as such.

azure geode
steady wave
#

format the boot partition, reinstall your kernel and initramfs and do grub-install and grub-mkconfig

steady wave
#

well

#

I can't help you

#

lo siento

#

you're doing it wrong

#

clearly

azure geode
steady wave
#

Since only 40MB of data was overwritten, primarily affecting the boot sector and partition table, your data is likely intact. To repair the partition table, you can follow these steps:

Using TestDisk

TestDisk is a powerful open-source tool for recovering partition tables. Here's how to use it:

  1. Download and run TestDisk.
  2. Create a new log file.
  3. Select the affected drive.
  4. Choose "Analyze" to examine the current partition structure.
  5. Select "Quick Search" to begin scanning.
  6. Once TestDisk lists the recognized partitions, review them carefully.
  7. If the partition structure looks correct, select "Write" to recover it.
  8. Confirm the changes when prompted.

Using DMDE

DMDE is another effective tool for partition recovery:

  1. Download and run DMDE.
  2. Select the affected drive.
  3. Right-click the partition and select "Advanced Mode".
  4. Use the partition recovery features to restore the partition table.

Manual GPT Recovery

If you're dealing with a GPT partition table, you can try this method:

  1. Boot from a live Linux distribution.
  2. Use a tool like gdisk to read the backup GPT at the end of the disk.
  3. Restore the primary GPT using the backup data.

Important Considerations

  • Avoid writing new data to the drive before attempting recovery.
  • If possible, work on a copy of the drive to prevent further data loss.
  • After recovering the partition table, you may need to rebuild the boot sector and reinstall the bootloader (e.g., GRUB).

Remember, while these methods can often recover the partition table, it's crucial to have backups of important data to prevent loss in such situations.

steady wave
#

but you don't want to

#

because you're lazy

#

I'm done helping lo siento

#

you can backup and fix it

#

it's a server

#

you should do it the right way

azure geode
steady wave
#

that server is already not healthy

#

the partition table is damaged

#

and DD doesn't work from byte to byte

azure geode
steady wave
#

that's rude, go try e2fsk

#

por favor

azure geode
steady wave
#
sudo e2fsk /dev/sda```
azure geode
#

My problem here is that it is corrupted more than I thought, it is not enough to simply reinstall efi, grub, .....

azure geode
azure geode
#

And I can think of 3 solutions

azure geode
azure geode
#

@sonic wedge

sonic wedge
#

hoi.. i am a @azure geode friend and long story short, i think it was a very big mis-understandig from all parts, @steady wave you were nice and tried to be friendly but in the way you expressed yourself was very rough towards maj, and i think the situation escalated from there, i dont know who else was involved but, yeah, there are better ways to express, without being disrespectful, and it is important to understand that there is a level of understanding and confidence to talk that way with an unknown person,
thank you for helping and, wish that something like this dont happen in the future,
and a little reminder that. this is a big community, and you have to understand that you should be welcoming of newbs, and that everyone work in a different way, if you want to recommend a different way to do something, you are "RECOMMENDING" and not forcing, you can explain why it might be a better way, but never dumb down another for not seeing things like you do,
have a nice day you all

regal relicBOT
#

majhrs16, and coleonwii received a thank you cookie!

steady wave
# sonic wedge hoi.. i am a <@776315577638715392> friend and long story short, i think it was a...

I expressed that I was fine, but I got agitated when I gave him a form of resolution and wasn't taking it. I told him I had given him a resolution and waited, but he didn't listen. I've been in this community 5x as long as you, and again, if you all got offended by me saying a way to solve a problem and him not wanting to do so, then that's on you. I've dealt with this before, this particular issue, and they were egotistical at first, assuming that they knew of a better solution when especially that server was already unhealthy because of what he did with dd and his best course of action as an admin would either roll back to a backup (if he has any) or backup the preservable root partition and then transfer the data over to a clean installation once again. The way he was trying to do things was not how server architecture should be managed, and not having a backup, at least for the central node in his cluster, would be catastrophic like it was in this instance. If someone is to come in asking for help and yet not take a persons advice, why ask for help?

#

There were multiple people in vc that were being offensive and I was the only one listening for your information but where I drew the line is where I wasn't going to help because I gave a resolution

#

Then he realizes that's the only way to fix it after 2 hours of me saying it over and over and over

sonic wedge
#

Nana i am nof offended. He and everything is good now, and the last part was ment for the other people involved. Ans again. Thank you so much bro

#

And yeah, it sometimes happens to me that i have the answer in my face and i domt see that, but if after frustration

#

He was fighting with that topic for days

#

And also, nice to meet you

steady wave
#

It’s better off long term having backups

#

🙂

#

I had this same thing happen to me years ago

#

But the whole drive instead

sonic wedge
sonic wedge
steady wave
sonic wedge
#

I will try to back up my drive soon

sonic wedge
#

True

steady wave
#

He should be grateful

sonic wedge
#

And he is

steady wave
#

It could have been a lot worse

#

And I mean that

#

Especially that being his main system

#

Without a backup

sonic wedge
#

True, (that is knocking my door too)

steady wave
steady wave
#

🙂

sonic wedge
azure geode
# steady wave Then he realizes that's the only way to fix it after 2 hours of me saying it ove...

English: Sorry but... Just because I'm new to this Discord and asking a technical question, and you don't know me yet, doesn't necessarily mean I'm completely wrong just because I said: I already tried 5 other times!.

Español: Lo siento pero... Solo porque soy nuevo en este Discord y haga una pregunta técnica, y aún no me conozcas, no necesariamente implica que esté completamente equivocado solo porque dije: ¡Ya lo intenté otras 5 veces!!

#

[FIXED] Accidentally corrupt GPT partition table, but already reinstalled but not boot..?