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.
I have recently corrupted my hard drive somehow, and I am wondering how to fix it. I was installing some graphics drivers, as well as installing windows alongside Ubuntu that day, then Ubuntu suddenly would not boot, BIOS would not open(frozen boot screen for a minute) and then would enter grub recovery. I tried to boot from my hard drive through grub recovery but a weird message would pop up saying File system is unknown(NOT unknown file system).
This was happening with each partition on the drive. So I booted from a live usb and used fsck to fix the drive. After it was done everything was gone. I used TestDisk to recover the files, but i would never be able to sort the thousands of files without their paths. I looked through GParted at the hard drive that was supposedly empty, and I found one partition with 14 GB used(about the amount that I had on my computer beforehand). I re-checked the hard drive for any files, but I couldn't find any(I checked for hidden ones) lost+found was empty and there was no trash. I have no idea why this is and I need help!
UPDATE: In disk usage manager, it shows that their is no space used up.
Distribution: Debian testing/sid; OpenSuSE; Fedora; Mint
Posts: 5,521
Rep:
OK, that drive has no MBR partition table. Try using testdisk to recover the partition table.
Otherwise, you're just going to have to sift through the recovered files to find what you want to save.
There are a couple of tools to make this task easier.
Code:
$ file * > type.txt
will give you all the file types. You can sort that by type with
Code:
$ sort -k 2,2 type.txt > type1.txt
You'll need to make the two text files with touch.
Alternately, you can open the recovery directory using nautilus and sort by type.Then you can organize the files by type.
Once you know the file types you can use various programs to open, say jpegs, in batch mode, i.e. with gwenview. It's a tedious process. But if the files are worth anything, it's worth the time.
Let's have some data:
- the failed disk is /dev/sdc and was partitioned ?
- you ran testdisk and nominated /dev/sdd as the target ?.
- /dev/sdd, the device node, unpartitioned ? (just checking).
- let's see a "lsblk -f -o +SIZE" listing. Uneditted.
Testdisk doews what it can - there are scripts that attempt to give the files useful names using grep/exiftool that sort of thing. Even on the testdisk site IIRC. Its manual, and specific to your data. And takes some time.
Haven't used gparted for recovery but I suspect you'll get similar to testdisk.
If fsck removed them, then, I am sorry to tell you, they were already gone.
They are not gone, and I am not quite sure what removed them, because photorec was able to recover the files, but it will take eternity to sort through the vary similar file types.
I do think fsck did do something to it though.
fsck ensures the integrity of the filesystem - not necessarily the files within.
Recreating the partition table does no damage to your data that may still be there, but anything after that (creating a filesystem, adding files) will almost certainly lead to over-writing of (at least) some of the residual data.
At some point you will have to accept that the data on the corrupt disk, is lost.
I have found a very interesting thing that happened with gparted when I tried to resize the partition, take a look in the screenshot.
Screenshot: http://imgur.com/a/y6ipr
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.