Filenames of files in lost+found folder disappeared after using GParted

After using GParted my files are still there, but the filenames disappeared. My files are not deleted, the problem is my file names changed and the files are still there in the lost+found folder, and I can't install grub because I can't mount /dev/sda6.

  1. no grub
  2. no data

enter image description here

enter image description here

enter image description here

Output of gparted:

Parted 0.19.0 --enable-libparted-dmraid --enable-online-resize

Libparted 3.2
Check and repair file system (ext4) on /dev/sda6  10:20:41    ( SUCCESS )

calibrate /dev/sda6  00:00:00    ( SUCCESS )

path: /dev/sda6
start: 571932672
end: 958765055
size: 386832384 (184.46 GiB)
check file system on /dev/sda6 for errors and (if possible) fix them  10:20:34    ( SUCCESS )

e2fsck -f -y -v -C 0 /dev/sda6

How can I recover the missing filenames?


Solution 1:

You can't find the original name and location of a file in /lost+found because that's what lost+found is about: it's where fsck puts fragments of files that it hasn't been able to attach anywhere in the directory tree. If the location was known, fsck would have left the file where it was meant to be.

It's theoretically possible that fsck could have only partial information, such as the file name but not the directory location, but that doesn't happen with typical filesystems.

You may be able to find clues in the file itself. The file command will at least tell you what kind of file it is (if it recognizes it). For more information about the file command, open the terminal and type man file Some files carry additional information inside; for example JPEG and TIFF images may contain exif data, MP3 files may contain id3 tags, etc.source

Even though you can see the files from lost+found, the filenames are lost and some of the files may be fragments of files or damaged files, interacting with the lost+found folder directly is not the best way to recover them. It's better to restore whatever missing files that you have backed up from their backups or else treat the files in lost+found as deleted files and try to recover them all together with their filenames using a recovery tool.

Try to recover the lost files with testdisk from the default Ubuntu repositories, and maybe you will be able get back the lost files and the original names of the files and folders too. First make a note of the partitions on your hard drive, so that you know which partition contains the missing files. Attach an external drive for storing the recovered data if you don't have another free partition to work with, and start testdisk from the terminal by typing testdisk . You will be presented with a series of menus that guide you step-by-step through the recovery process. Some of the menus have a Return to disk selection to return back to the first step if you think you may have made a mistake.

Credit goes to Gilles for the quoted text block.