Cannot boot after running parted mklabel on LUKS partition

Hey,

I need your help, I’m afraid I lost all my data by following a guide without understanding what I was doing…

I wanted to create a new partition on my disk, and I followed this guide : Making sure you're not a bot!

I ran the command mklabel gpt on my encrypted root partition like a fool, and typed “yes” without reading the warning message that tells that all the data will be lost…

Now when I boot there’s the following message :

Warning: /dev/disk/by-uuid/8f19..... does not exist
Warning: crypto LUKS UUID 656..... not found

Generating "/run/initramfs/rdsosreport.txt"


Entering emergency mode. Exit the shell to continue.
Type "journalctl" to view system logs.
You might want to save "/run/initramfs/desperately.txt" to a USB stick or /boot after mounting them and attach it to a bug report.




Cannot open access console, the root account is locked.
See sulogin(8) man page for more details.

Press Enter to continue.

[  214.450674] dracut-initqueue[488]: Warning: not all disks have been found.
[  214.450790] dracut-initqueue[488]: Warning: You might want to regenerate your initramfs.

I’m on Fedora 43 btw.

Thank you for your help, and have a good Sunday :slight_smile:

I think you have only the option to reinstall and restore data from your backups.

If the Header or Partition table is gone (usually the first thing it works on. . . ) Then all is lost. You “could“ do some work to attempt a retrieval, but you would need a backup of your LUKS encrypted partition header ( 99% of users do not do this. . . ) in an attempt to write it back and attempt to save it.

If you know what your doing, there are other ways using testdisk a live environment, and attempting repair. . .

mklabel gpt creates a new partition table on a disk, not a partition. The partitions are probably just fine. You could try to recover the LUKS partition, see https://nagimov.me/post/simple-recovery-of-luks-encrypted-partitions/

It’s still pretty involved to do, and would take some time. . . a lot of time

I searched the whole drive for LUKS header, but couldn’t find it. It think it’s over. Thank you all for your help, and have a great easter weekend!