Score:0

Can't see some files after running " fsck -y /dev/sda3 "

ga flag

While using GParted live usb to create some free space on my disk (only ubuntu 22.04 is installed on that entire disk), I mistakely stopped the resizing operation in between, and later when I tried to reboot (After removing the usb) into ubuntu, I could not boot and got error (which I didn't take picture of but it asked me to run fsck manually on /dev/sda3 my main storage partition in ubuntu). After running fsck once and pressing yes everytime, it took around >2 hrs for fsck to complete, but still it showed some errors (something like file system still has errors)- The image of error it gave Basically it was asking to run fsck again, I so I ran fsck again on /dev/sda3 but this time as- fsck -y /dev/sda3

Image of running the above command

It completed in ~30 seconds only, and it showed

"FILE SYSTEM IS MODIFIED"-

After running the fsck command second time

Then when I gave the command "reboot", again some errors popped (see image 3), something saying "Freezing execution":

I still can't boot into my ubuntu...

After all this, what I did- I made a live usb of ubuntu 22.04 and tried to run it in "try without installing" mode and from there copy my files (from unbootable ubuntu) into a external seagate hard drive.

Now.... I can't see some of my important files (which were there in my downloads folder in my now unbootable ubuntu)

How can I recover such files.. is there a way?

...After some wait and frustration and hurry..

I copied whatever I could get from the non-bootable ubuntu to a big external storage drive(using a live USB). And then I lost hope on getting them back) and tried to do a fresh install of ubuntu 22.04 my damaged harddrive. The process of ubuntu installation ran for ~5 minutes, then throwed error, " [error 5] input/output error ...... blah blah blah ...maybe Faulty hard drive".error picture here My question is now will I not even be able to do a fresh install of ubuntu/ any other os ??

David avatar
cn flag
This is from your question. I mistakely stopped the resizing operation in between You have corrupted the file system. It deleted some files in repairing it. The files are gone you disrupted a file operation about the worse thing you can do.
mchid avatar
bo flag
Using the live USB session, install testdisk: `sudo apt update; sudo apt install testdisk` and then use the `photorec` and/or `testdisk` commands to possibly recover your deleted or partially corrupted files. It's very likely only the index (the name of the files) is missing but the actual data may still be on the disk. Google how to use photorec to recover files. It's kind of complicated but actually pretty basic once you learn to use it after the first time. It helps to know the file type or extension you're looking (to limit your search) and I think(?) you can limit to certain directories.
mchid avatar
bo flag
You will need an extra storage device to dump everything on like an extra USB drive with a lot of space because it may recover a lot of data. Also, the erased files will most likely not have their original file names so they will just be named random number and stuff so you'll have to go through the files to find what you want. Lastly, some of the files may be corrupted and it's not all that unusual to recover partial files like partial videos, etc. Most importantly it's advised that you do this from a live session because the more you use that disk, the more likely the data will be overwriten
mchid avatar
bo flag
I almost forgot: does this answer your question? [How to recover deleted files?](https://askubuntu.com/a/3901/167115)
mchid avatar
bo flag
The other option is [foremost](https://askubuntu.com/a/3903/167115) although I've never used it. Again, you would need an extra device like a spare USB with lots of room to store the recovered data on.
Yugal  avatar
ga flag
Thanks @mchid for such informative help.But before seeing your anwers here, I copied whatever I could get from the non-bootable ubuntu to a big external hard drive(using a live USB). And then I lost hope on getting them back) and tried to do a fresh install of ubuntu 22.04 onto my potentially damaged (as you said - david) harddrive. The process of ubuntu installation ran for ~5 minutes, then throwed error, " [error 5] input/output error ...... blah blah blah ...maybe Faulty hard drive". My question is now will I not even be able to do a fresh install of ubuntu/ any other os.
I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.