Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
And presumably there was some response to that ping, right?
I don't know what your issue might be. I had just downloaded and booted Fedora-Workstation-Live-x86_64-29-1.2.iso in a virtual machine, and that "dnf install testdisk" command worked just fine.
Sorry, I was entering my reply before you discovered that networking was, in fact, not up.
If that's not going to work, then I suggest that you download SystemRescueCd and put it on a CD or USB flash drive. That toolkit does include testdisk. Note: Putting SystemRescueCd on a USB flash drive is not as simple as it should be. The instructions are here.
Last edited by rknichols; 01-29-2019 at 03:18 PM.
Reason: Sorry, ...
OK, so from the root prompt run "testdisk /dev/sda" . It should come up with disk /dev/sda selected. Select (with the arrow keys) "Proceed" and press <Enter>.
On the next screen select "EFI GPT partition map" and press <Enter>.
On the next screen select "Analyze" and press <Enter>.
On the next screen you will see messages that the main and alternate GPT are invalid. No surprise -- you wiped them out. Run "Quick Search" and see if the partitions detected look like what you had before. Post the result if you want to.
looks pretty good to me, I'm just glad windows didn't get wiped...
Code:
TestDisk 7.0, Data Recovery Utility, April 2015
Christophe GRENIER <grenier@cgsecurity.org>
http://www.cgsecurity.org
Disk /dev/sda - 750 GB / 698 GiB - CHS 91201 255 63
Partition Start End Size in sectors
>P MS Data 2048 411647 409600 [SYSTEM]
D MS Data 673792 552939512 552265721
D MS Data 673799 552939519 552265721
D MS Data 552939519 1105205239 552265721
D MS Data 1094012926 1400688637 306675712
D MS Data 1360289793 1412718592 52428800
D Linux Swap 1400688640 1412714479 12025840
D MS Data 1412718592 1465147391 52428800
Structure: Ok. Use Up/Down Arrow keys to select partition.
Use Left/Right Arrow keys to CHANGE partition characteristics:
P=Primary D=Deleted
Keys A: add partition, L: load backup, T: change type, P: list files,
Enter: to continue
FAT32, blocksize=2048, 209 MB / 200 MiB
I see that the 2nd and 3rd entries overlap, so they can't both be correct. That 3rd entry overlaps the 4th by 1 sector, so what I would do is change the characteristic to "P" for all entries except the 3rd one, then press <Enter> to continue. If, on the next screen, testdisk doesn't find anything to complain about, select "Write" and press <Enter>. (It might help to grit your teeth, hold your nose, cover your ears, and cross your fingers when doing that.)
The system might still not boot because of incorrect partition types. We can work on that next.
alright I'm getting a few "structure bad" responses whenever I change the partitions that are still D here:
Code:
TestDisk 7.0, Data Recovery Utility, April 2015
Christophe GRENIER <grenier@cgsecurity.org>
http://www.cgsecurity.org
Disk /dev/sda - 750 GB / 698 GiB - CHS 91201 255 63
Partition Start End Size in sectors
P MS Data 2048 411647 409600 [SYSTEM]
P MS Data 673792 552939512 552265721
D MS Data 673799 552939519 552265721
P MS Data 552939519 1105205239 552265721
D MS Data 1094012926 1400688637 306675712
P MS Data 1360289793 1412718592 52428800
D Linux Swap 1400688640 1412714479 12025840
>D MS Data 1412718592 1465147391 52428800
Structure: Ok. Use Up/Down Arrow keys to select partition.
Use Left/Right Arrow keys to CHANGE partition characteristics:
P=Primary D=Deleted
Keys A: add partition, L: load backup, T: change type, P: list files,
Enter: to continue
NTFS, blocksize=4096, 26 GB / 25 GiB
Indeed there are some other overlaps that I hadn't noticed. It looks like this disk has gone through several cycles of partition changes and filesystems, and testdisk is seeing leftover old filesystem headers. I think the only thing to do is leave things as ther are here, proceed to the next screen, and select "Deeper Search". That's going to take quite a lot of time and produce more output, but with luck it will be possible to find a consistent set of partitions that makes sense.
Alas, that doesn't seem to be showing everything. I have to ask you to do it again, this time running "testdisk /log /dev/sda" and then showing the content of the tesstdisk.log file generated, either inline (wrapped in [CODE] ... [/CODE] tags please) or else attached as a text file.
Now it's showing a ton of partitions, There's gotta be over 100
Code:
TestDisk 7.0, Data Recovery Utility, April 2015
Christophe GRENIER <grenier@cgsecurity.org>
http://www.cgsecurity.org
Disk /dev/sda - 750 GB / 698 GiB - CHS 91201 255 63
Partition Start End Size in sectors
>D MS Data 2048 411647 409600 [SYSTEM]
D MS Data 2054 411653 409600 [NO NAME]
D MS Data 10272 419871 409600 [NO NAME]
D MS Data 673792 552939512 552265721
D MS Data 673792 584783204 584109413
D MS Data 673799 552939519 552265721
D Mac HFS 5024992 5067007 42016
D Mac HFS 5067004 5109019 42016
D MS Data 12296425 13668408 1371984 [GWM-9M-$ث݊M-= b~^dS
D MS Data 12296426 13668409 1371984 [GWM-9M-$ث݊M-= b~^dS
D MS Data 16369632 328939487 312569856
D Mac HFS 122777084 122819099 42016
Structure: Ok. Use Up/Down Arrow keys to select partition.
Use Left/Right Arrow keys to CHANGE partition characteristics:
P=Primary D=Deleted
Keys A: add partition, L: load backup, T: change type, P: list files,
Enter: to continue
FAT32, blocksize=2048, 209 MB / 200 MiB
Sorry for the confusion, I quit out of testdisk and tried to get to where you want me to but I'm getting this result:
Code:
[root@localhost-live ~]# testdisk /log/dev/sda
TestDisk 7.0, Data Recovery Utility, April 2015
Christophe GRENIER <grenier@cgsecurity.org>
http://www.cgsecurity.org
Unable to open file or device /log/dev/sda: No such file or directory
[root@localhost-live ~]#
Sorry for the confusion, I quit out of testdisk and tried to get to where you want me to but I'm getting this result:
Code:
[root@localhost-live ~]# testdisk /log/dev/sda
TestDisk 7.0, Data Recovery Utility, April 2015
Christophe GRENIER <grenier@cgsecurity.org>
http://www.cgsecurity.org
Unable to open file or device /log/dev/sda: No such file or directory
[root@localhost-live ~]#
There should be a space after "/log" .
If the log file is large, consider using https://pastebin.com rather than posting or attaching it here.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.