I was writing a program with libparted library and tried to create a new disk partition on a free space. But i believe, i’ve accidentally written to the wrong partition and it somehow corrupted gpt or something like that. Error from libparted is on photo 1. Than i rebooted, like it said, but i went to grub and if i try to boot, it is giving me error (photo 2). Is it a way to safely boot fedora again?
Boot to a live usb image then run lsblk -f
and post the output here so we can identify the existing partitions along with their UUIDs. That is needed as a starting point before moving forward.
I think you overwrote the Header for that device. If you didn’t have anything important on it then it is what it is. . . But if you did you should look into a recovery tool like qphotorec
or testdisk
It doesn’t see my linux partitions, only those, that went before free space, where i tried to create partition
It’s gone. You can attempt recovery using some command tools that I mentioned above. If it is completely lost, it’s harder because you would need to run the tools against the entire storage device.
The 2nd picture basically confirms this no such device: 17981f00-8034XXXXX
this would have been the header block of the partition.
I have to assume that the device in question is nvme0n1.
The comment from hammerhead seems correct, though you may be able to see a tiny bit more info with sudo fdisk -l
This should be a reminder to never do testing on a running and needed system, but use a discrete and separate test bed for those purposes.
Potentially some forensic recovery might be possible, but without knowing the exact sector where each partition began and ended it could become very time consuming and potentially expensive if experts were involved.
I suggest that you consider doing a complete new install on that device.
If you want to do forensic recovery do absolutely nothing else on that device and install on a new replacement SSD.
I’ve downloaded testdisk on live usb, it is able to find the lost part, but still unable to open it. Can i somehow recover my files with it or should i try something else?
Congrats, it’s a powerful tool.
You have tools within testdisk to help you fix this. You’re gonna need to fix the filesystem.
https://www.cgsecurity.org/testdisk_doc/
Pretty much sums it up. testdisk
can do this, and many other things. I believe it can get you a raw image of the drive for safe keeping. You’re gonna need another drive though.
I can’t hang out for much longer today, I’ll be back tomorrow. The Fedora Security Suite has a bunch of tools to use in conjunction with testdisk
and qphotorec
.
I successfully recovered my fedora
However, i somehow managed to kill windows in process…
Thanks for your help
On a more serious note, if you could provide some details here. It will be helpful to others in the future. Cheers
Windows recovery or install media can be downloaded from MS.
Added file-recovery