LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This 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


Reply
  Search this Thread
Old 08-03-2017, 02:06 PM   #1
ConnM
LQ Newbie
 
Registered: Aug 2017
Posts: 7

Rep: Reputation: Disabled
Unhappy Files gone after FSCK!


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.

Screenshot of Disk Manager: httphttps://i.stack.imgur.com/IOQbA.png
Screenshot of GParted: http://https://i.stack.imgur.com/FAhDW.png
 
Old 08-03-2017, 03:11 PM   #2
AwesomeMachine
LQ Guru
 
Registered: Jan 2005
Location: USA and Italy
Distribution: Debian testing/sid; OpenSuSE; Fedora; Mint
Posts: 5,513

Rep: Reputation: 1009Reputation: 1009Reputation: 1009Reputation: 1009Reputation: 1009Reputation: 1009Reputation: 1009Reputation: 1009
Could you give us the output of
Code:
$ fdisk -l /dev/sda
where sda is the corrupted drive.
 
Old 08-03-2017, 03:16 PM   #3
ConnM
LQ Newbie
 
Registered: Aug 2017
Posts: 7

Original Poster
Rep: Reputation: Disabled
Yes, the output is:
ubuntu@ubuntu:~$ sudo fdisk -l /dev/sdc
Disk /dev/sdc: 931.5 GiB, 1000204886016 bytes, 1953525168 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 byte
 
Old 08-03-2017, 03:29 PM   #4
jefro
Moderator
 
Registered: Mar 2008
Posts: 20,860

Rep: Reputation: 3386Reputation: 3386Reputation: 3386Reputation: 3386Reputation: 3386Reputation: 3386Reputation: 3386Reputation: 3386Reputation: 3386Reputation: 3386Reputation: 3386
Might look as S.M.A.R.T info as well as run memtest. I like to think that drives don't go data bad like that.
 
Old 08-03-2017, 04:31 PM   #5
ConnM
LQ Newbie
 
Registered: Aug 2017
Posts: 7

Original Poster
Rep: Reputation: Disabled
Gparted has a data recovery feature should i try that? or will that not save the paths as well.

Last edited by ConnM; 08-03-2017 at 04:35 PM.
 
Old 08-03-2017, 07:34 PM   #6
AwesomeMachine
LQ Guru
 
Registered: Jan 2005
Location: USA and Italy
Distribution: Debian testing/sid; OpenSuSE; Fedora; Mint
Posts: 5,513

Rep: Reputation: 1009Reputation: 1009Reputation: 1009Reputation: 1009Reputation: 1009Reputation: 1009Reputation: 1009Reputation: 1009
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.
 
Old 08-03-2017, 07:37 PM   #7
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 19,719

Rep: Reputation: 3550Reputation: 3550Reputation: 3550Reputation: 3550Reputation: 3550Reputation: 3550Reputation: 3550Reputation: 3550Reputation: 3550Reputation: 3550Reputation: 3550
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.
 
Old 08-04-2017, 08:43 AM   #8
ConnM
LQ Newbie
 
Registered: Aug 2017
Posts: 7

Original Poster
Rep: Reputation: Disabled
Ok which option in TestDisk will recover the partition table, do I have to analyse It first?
 
Old 08-04-2017, 08:45 AM   #9
sundialsvcs
LQ Guru
 
Registered: Feb 2004
Location: SE Tennessee, USA
Distribution: Gentoo, LFS
Posts: 9,159
Blog Entries: 4

Rep: Reputation: 3233Reputation: 3233Reputation: 3233Reputation: 3233Reputation: 3233Reputation: 3233Reputation: 3233Reputation: 3233Reputation: 3233Reputation: 3233Reputation: 3233
If fsck removed them, then, I am sorry to tell you, they were already gone.
 
Old 08-04-2017, 11:05 AM   #10
scasey
LQ Veteran
 
Registered: Feb 2013
Location: Tucson, AZ, USA
Distribution: CentOS 7.8.2003
Posts: 5,426

Rep: Reputation: 2054Reputation: 2054Reputation: 2054Reputation: 2054Reputation: 2054Reputation: 2054Reputation: 2054Reputation: 2054Reputation: 2054Reputation: 2054Reputation: 2054
Off-topic, but...

Quote:
Originally Posted by AwesomeMachine View Post
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.
In my experience, redirection to a non-existent file will create the file. Why do you say they need to be "[made] with touch"?

Just wanting to understand...

Thanks!
 
Old 08-04-2017, 11:41 AM   #11
ConnM
LQ Newbie
 
Registered: Aug 2017
Posts: 7

Original Poster
Rep: Reputation: Disabled
Could I manually fix the partition table with fdisk?
 
Old 08-04-2017, 12:07 PM   #12
ConnM
LQ Newbie
 
Registered: Aug 2017
Posts: 7

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by sundialsvcs View Post
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.

Last edited by ConnM; 08-04-2017 at 12:08 PM.
 
Old 08-04-2017, 12:47 PM   #13
sundialsvcs
LQ Guru
 
Registered: Feb 2004
Location: SE Tennessee, USA
Distribution: Gentoo, LFS
Posts: 9,159
Blog Entries: 4

Rep: Reputation: 3233Reputation: 3233Reputation: 3233Reputation: 3233Reputation: 3233Reputation: 3233Reputation: 3233Reputation: 3233Reputation: 3233Reputation: 3233Reputation: 3233
What I meant to say was, the directory structure was gone.

You might find the notion of lost+found worth trolling through ... I don't.
 
Old 08-04-2017, 06:07 PM   #14
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 19,719

Rep: Reputation: 3550Reputation: 3550Reputation: 3550Reputation: 3550Reputation: 3550Reputation: 3550Reputation: 3550Reputation: 3550Reputation: 3550Reputation: 3550Reputation: 3550
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.
 
Old 08-05-2017, 10:40 AM   #15
ConnM
LQ Newbie
 
Registered: Aug 2017
Posts: 7

Original Poster
Rep: Reputation: Disabled
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
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
fsck: entire filesystem allocation or just files? jadeddog Linux - Newbie 1 01-24-2011 10:43 AM
Ran FSCK on ext3 filesystem, and now i'm missing many files xmrkite Linux - Software 16 12-29-2009 05:13 PM
fsck error: files work fine, but can't resize? jmite Linux - Newbie 1 07-08-2009 03:49 AM
how do I find names of files affected by fsck ? jtmoon Linux - Software 3 03-08-2009 05:44 AM
how to recover lost files after fsck? edenCC Linux - Server 3 12-26-2007 01:31 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 04:31 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration