Sunday, May 5, 2024
 Popular · Latest · Hot · Upcoming
0
rated 0 times [  0] [ 0]  / answers: 1 / hits: 692  / 3 Years ago, thu, november 11, 2021, 11:03:53

I have an MSI GL73-8RD with an SSD and an HDD. I installed windows on the SSD with some files stored in the HDD, then partitioned the HDD and installed Ubuntu 18.04 there.


Later on, Ubuntu was upgraded to 20.04. I just had to click a prompt. Apparently this resulted in 20.04 being installed alongside 18.04, but for some reason I can't use my password on the 18.04 installation anymore.


Moreover, after a windows update, 20.04 would only launch in emergency mode. I checked several gotchas and then found in the logs that there was an issue with the partition /dev/sda7. I ran fsck on this partition, and now 20.04 won't boot even in recovery mode. Windows 10 and 18.04 still start fine however.


There are important files I need to recover from the failed Ubuntu install. I think the hardware is fine, so the files should still be there. HOw do I go about this ?


Do I first copy the content of the HDD as a safety precaution and then try to recover the files with a live usb stick ?


Are there specific tools dedicated to this problem ? I know there are tools dedicated to data recovery, but I don't know which would be the right one.


EDIT


Following the recommendations from @vanadium, I booted on a live USB stick and tried to mount the partitions. Because my installation is very dirty, there are two windows related partitions which work fine, a location named "Computer" and three unnamed volumes, /dev/sda4-5-7.


I tried to mount them, unfortunately the one that seems to contain my data is /dev/sda7 and it cannot be mounted.


@vanadium pointed to Testdisc and Photorec as potential alternatives. I'm looking for specific guidance on these tools.


More From » boot

 Answers
3

So, after trying the solution proposed by @vanadium to no avail, I reasoned that in the absence of shock to the drive or creaky noises, and given the fact that I had interrupted a windows update, this was probably a logical failure caused by an I/O error.


I burned a live USB stick with SystemRescueCD, a special purpose linux distribution which comes with utilities useful when trying to fix an installation.


I first used ddrescue with the option -n to copy the damaged partition to an external hard drive which I call the clean copy. -n allows for a first quick pass and minimizes damage to the reading head. As I conjectured, I was able to read 100% of the bytes in the partition.


I then used dd to copy the clean copy on a second external hard drive, the working copy. This ensures that if any work I do on the working copy is destructive, I can go back to the clean copy without having to copy from a potentially failing drive.


I then ran TestDisk on the partition located on the working copy. Following the menu, I selected the partition, and TestDisk provided me with a list of the superbloxks in the failed filesystem.


Superblocks are the blocks in memory containing the metadata about the structure of the filesystem. TestDisk detected that the file system was an ext4 filesystem and proposed a command to fix the filesystem :
fsck.ext4 -p -b <start of superblock> -B <size of superblock> /path/to/working/copy


The arguments <start of superblock> and <size of superblock> were taken from the output of TestDisk.


After running this command, the first superblock which had been corrupted was fixed, and the files were accessible in their entirety. I then backed them up on a third hard drive which I usually used for Windows backups.


Total cost : roughly 200$ to acquire the external hard drives. A data recovery company had quoted me 800$ to do this job.


[#1197] Saturday, November 13, 2021, 3 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
serveeel

Total Points: 347
Total Questions: 106
Total Answers: 117

Location: American Samoa
Member since Fri, Aug 26, 2022
2 Years ago
serveeel questions
Tue, Nov 23, 21, 11:26, 3 Years ago
Thu, Jan 13, 22, 12:38, 2 Years ago
Sat, Oct 9, 21, 04:32, 3 Years ago
;