LinuxQuestions.org
Visit Jeremy's Blog.
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 01-22-2012, 02:25 PM   #16
Clarence-Adams
Member
 
Registered: Nov 2011
Distribution: Archlinux
Posts: 31

Original Poster
Rep: Reputation: Disabled

I ran testdisk on my rescue remix cd and this is the output that I got:

TestDisk 6.11, Data Recovery Utility, April 2009
Christophe GRENIER <grenier@cgsecurity.org>
http://www.cgsecurity.org

Disk /dev/sda - 160 GB / 149 GiB - CHS 19458 255 63
Partition Start End Size in sectors
D Linux 0 64 63 63 253 1024000
D Linux 0 65 2 63 253 1024000
D Linux LVM 63 253 63 19457 53 311552000
D Linux Swap 64 31 32 317 11 4063216
D Linux 317 12 16 12926 142 202571776
D Linux 6599 190 56 19209 65 202571776
D Linux 6605 26 14 19214 156 202571776
D Linux 6605 253 49 19215 128 202571776
D Linux 6613 34 14 19222 164 202571776
D Linux 6615 76 54 19224 206 202571776
D Linux 12926 142 17 19453 163 104857600 [_Fedora-16-x86_6]










Structure: Ok. Use Up/Down Arrow keys to select partition.
Use Left/Right Arrow keys to select partition characteristics:
*=Primary bootable P=Primary L=Logical E=Extended D=Deleted
Keys A: add partition, L: load backup, T: change type, P: List files,
Enter: to continue
EXT4 Large file Sparse Superblock, 53 GB / 50 GiB

What do I do from here?

Last edited by Clarence-Adams; 01-22-2012 at 02:26 PM. Reason: Removed Quote tags
 
Old 01-22-2012, 02:29 PM   #17
impert
Member
 
Registered: Feb 2009
Posts: 282

Rep: Reputation: 54
@Clarence-Adams

I've just noticed Distribution: Ubuntu/Fedora
Is the Ubuntu on the same machine? Can you boot into it? That would save a bit of time.
 
Old 01-22-2012, 02:42 PM   #18
Clarence-Adams
Member
 
Registered: Nov 2011
Distribution: Archlinux
Posts: 31

Original Poster
Rep: Reputation: Disabled
No, this is only a full Fedora 16 Hard drive.
 
Old 01-22-2012, 03:05 PM   #19
pingu
Senior Member
 
Registered: Jul 2004
Location: Skuttunge SWEDEN
Distribution: Debian preferably
Posts: 1,350

Rep: Reputation: 127Reputation: 127
Quote:
Originally Posted by Clarence-Adams View Post
"I think I MAY have deleted a partition using fdisk" was referring to what caused the problem, but after I messed the partitions up I haven't altered it. Sorry about the misleading information.
After messing the partitions up - but I'm asking you to write down the exact steps that led to the unfortunate deletion, as well as the partition layout before this accident!
It is extremely important to know this!

Also, now to your latest post:
"D Linux LVM" - are you using LVM?
This is also VERY important to know!

PLEASE try to sit back, think about situation before trouble started.
Then write down everything you can remember, every command every step you took.
Without full knowledge we can all just guess, we have to have knowledge to be able to truly assist you.

One thing is partition table: traditional "DOS" can be handled by fdisk & grub (all versions)
GPT partition table can not be handled by fdisk, and only by Grub2.
LVM is a a bit similar to raid0, can be used with both DOS and GPT, but if LVM was used we have to know. It is more tricky to recover and more important it can't be done with "normal" disk tools.
 
Old 01-22-2012, 03:17 PM   #20
Clarence-Adams
Member
 
Registered: Nov 2011
Distribution: Archlinux
Posts: 31

Original Poster
Rep: Reputation: Disabled
To be honest I have no idea what LVM is. I can tell you all the steps that led to the incident though.

I was testing IDE 2.5 hard drives on my main machine using a USB adapter and before I issued the smartctl -t short command I used fdisk to delete all of the partitions first. I was not used to testing hard drives on my main system, I usually used a separate bench machine to test hard drives and muscle memory tells me to "fdisk /dev/sda" but on my main system the IDE 2.5 hard drive is /dev/sdc and MY hard drive is /dev/sda. I think my muscle memory typed fdisk /dev/sda instead of fdisk /dev/sdc and I removed all of MY partitions instead of the laptops partitions. It gave me a strange error saying that the new partition table will be used the next time I booted the machine rebooted. So I turned off my machine right before I left the shop and when I booted it up this morning I think it used the "new" partition table I created/destroyed.
 
Old 01-22-2012, 03:19 PM   #21
impert
Member
 
Registered: Feb 2009
Posts: 282

Rep: Reputation: 54
I'm not familiar with testdisk.
I think there may be a bit of premature panicking going on here.
Going back to your first post:
Quote:
I can mount the hard drive but no files are popping up in the home directory, it's just blank. And it's not just showing a "160GB Hard drive" as it should, it's two "_Fedora-16-x86_6" one that I can mount and one that I cannot mount, and "16mb filesystem" which after I try to mount dissapears, and a "8.2 KB Filesystem" that I can mount and it has a file named "OSMIN" inside of it.
If you can mount these things, they should show up in /etc/mtab
I suspect that you're looking in the wrong place for them.
I'd suggest that you mount them, then run
Code:
cat /etc/mtab
With a bit of luck amongst the guff you should have something like:
Code:
/dev/sda5 /mnt ext4 rw 0 0
Then run
Code:
ls -al /mnt
Again with luck, you may see all the top level directories, /bin /boot and so forth. Then
ls -al /mnt/home/<username> should let you see the contents of your home directory.
 
Old 01-22-2012, 03:23 PM   #22
impert
Member
 
Registered: Feb 2009
Posts: 282

Rep: Reputation: 54
Quote:
I think my muscle memory typed fdisk /dev/sda instead of fdisk /dev/sdc and I removed all of MY partitions instead of the laptops partitions.
Well, if that's what happened you can forget my laast post.
 
Old 01-22-2012, 03:24 PM   #23
pingu
Senior Member
 
Registered: Jul 2004
Location: Skuttunge SWEDEN
Distribution: Debian preferably
Posts: 1,350

Rep: Reputation: 127Reputation: 127
Quote:
Originally Posted by Clarence-Adams View Post
It gave me a strange error saying that the new partition table will be used the next time I booted the machine rebooted.
That message says it all: you deleted partitions that were mounted by your system.
What did you do after deleting the partitions?
Did you choose to create a new partition table - in fdisk or any other program?
Do you remember how the disk was partitioned from the beginning?
One thing you could try - on a copy, then! - is to simply create a new primary partition containing all disk.
If you did add a GPT partition table you could try - again, on a copy - to run fdisk on that disk-image and add a new DOS table.
I'm guessing here, never ever used GPT don't know anything about it.

Last edited by pingu; 01-22-2012 at 03:25 PM. Reason: Spelling
 
Old 01-22-2012, 03:32 PM   #24
pingu
Senior Member
 
Registered: Jul 2004
Location: Skuttunge SWEDEN
Distribution: Debian preferably
Posts: 1,350

Rep: Reputation: 127Reputation: 127
Anybody out there who knows how Fedora partitions a disk by default?
The disk is 160GB and according to OP "full Fedora 16 Hard drive".
 
Old 01-22-2012, 03:50 PM   #25
pingu
Senior Member
 
Registered: Jul 2004
Location: Skuttunge SWEDEN
Distribution: Debian preferably
Posts: 1,350

Rep: Reputation: 127Reputation: 127
And here is a very wild guess:
Maybe that partition layout reported by testdisk actually is a "normal" DOS label.
But I do find it a bit hard to understand, because if so then there are a whole bunch of partitions that really shouldn't be there.
It also means that LVM definitely was used, meaning you have to recreate partitions and then try to mount something like /dev/md0 /dev/md1 etc instead of /dev/sda1 etc (sorry don't remember, it's been a year since I used LVM).

You could try using testdisk again, notice the tips on the bottom of screen:
"Keys A: add partition, L: load backup, T: change type, P: List files"
So, "D" means a deleted partition. Try hitting "A" and add partition back.

D Linux 0 64 63 63 253 1024000
D Linux 0 65 2 63 253 1024000
D Linux LVM 63 253 63 19457 53 311552000
D Linux Swap 64 31 32 317 11 4063216
D Linux 317 12 16 12926 142 202571776
D Linux 6599 190 56 19209 65 202571776
D Linux 6605 26 14 19214 156 202571776
D Linux 6605 253 49 19215 128 202571776
D Linux 6613 34 14 19222 164 202571776
D Linux 6615 76 54 19224 206 202571776
D Linux 12926 142 17 19453 163 104857600 [_Fedora-16-x86_6]
 
Old 01-22-2012, 04:28 PM   #26
Clarence-Adams
Member
 
Registered: Nov 2011
Distribution: Archlinux
Posts: 31

Original Poster
Rep: Reputation: Disabled
I'm cloning the hard drive right now using dd. I installed ddrescue and tried to use it but it kept giving me errors so I just used dd. I'll update you all when the cloning is done and I'll try to implement some of these solutions on the cloned hard drives and see where that takes me.

I cannot thank you all enough, I'll update you all as soon as I can, once again, THANK YOU.

Edit: By the way, I did use the default Fedora 16 partition when I installed.

Last edited by Clarence-Adams; 01-22-2012 at 04:35 PM. Reason: Additional information
 
Old 01-22-2012, 05:45 PM   #27
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,353
Blog Entries: 55

Rep: Reputation: 3541Reputation: 3541Reputation: 3541Reputation: 3541Reputation: 3541Reputation: 3541Reputation: 3541Reputation: 3541Reputation: 3541Reputation: 3541Reputation: 3541
In addition to what's been written if the disk has an EFI GPT then simply select it after you selected the disk, see http://www.cgsecurity.org/wiki/Menu_Analyse . Here's a run-through of partition recovery with pictures: http://www.cgsecurity.org/wiki/TestDisk_Step_By_Step and note from the previous link that if you select a partition and change the type from "D" to "L" or "P" testdisk will indicate if it checks out OK (partition overlap, gaps, etc) or not. As for selecting the right partitions I'd first target the ones named "LVM", "Swap" and "_Fedora-16-x86_6" and see if that gets the OK from testdisk. Any other partition you just select and press "p" to see if it contains any files. Finally note partition information is located right after the MBR in the Partition Table so even if you got it wrong an wrote the PT this still doesn't change partition boundaries or file system data. Just try again, you've got a backup.
 
Old 01-22-2012, 11:45 PM   #28
Clarence-Adams
Member
 
Registered: Nov 2011
Distribution: Archlinux
Posts: 31

Original Poster
Rep: Reputation: Disabled
I've successfully cloned the hard drive and now I'm messing around with testdisk to try and get my partitions back. Hopefully all goes well. I did a [quick search] and tried to write those partitions to the disk but I only ended up with:

GRUB error: Unkown filesystem

So now I'm in the process of doing a [deeper search] to find more appropriate partitions (The ones I found in the first place)
 
Old 01-23-2012, 01:16 AM   #29
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,353
Blog Entries: 55

Rep: Reputation: 3541Reputation: 3541Reputation: 3541Reputation: 3541Reputation: 3541Reputation: 3541Reputation: 3541Reputation: 3541Reputation: 3541Reputation: 3541Reputation: 3541
* Note you should run testdisk with the "/debug /log" switches so you'll have a log you could paste, attach or pastebin.
 
Old 01-25-2012, 10:57 AM   #30
Clarence-Adams
Member
 
Registered: Nov 2011
Distribution: Archlinux
Posts: 31

Original Poster
Rep: Reputation: Disabled
I gave up and considered it a loss (and a lesson). I re-installed Fedora, luckily all my important business information was backed up onto my flash drive. Now that I re-installed I can see the partition layout. The fdisk -p output is this:


WARNING: GPT (GUID Partition Table) detected on '/dev/sda'! The util fdisk doesn't support GPT. Use GNU Parted.


Command (m for help): p

Disk /dev/sda: 160.0 GB, 160041885696 bytes
255 heads, 63 sectors/track, 19457 cylinders, total 312581808 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000

Device Boot Start End Blocks Id System
/dev/sda1 1 312581807 156290903+ ee GPT

I re-installed Fedora onto a laptop, but the hard drive is the same size and I used the same default partitioning layout. What is the GUID Partition table?
 
  


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
Grub Error 22 after deleting Fedora Partition on Vista Machine CSMajor2012 Fedora 4 03-21-2010 07:12 PM
Help deleting linux partition, GRUB ERROR, 'no such partition' TocketTmars Linux - Newbie 3 03-18-2010 08:46 AM
grub problem error 15 booting to another partition for fedora mehdiee Linux - Newbie 1 02-22-2008 01:11 AM
Grub Error 17: Cannot mount selected partition and other Grub problems Sebastian Naitsabes Linux - General 1 07-05-2005 08:33 AM
GRUB Section2 load error, partition error. Ryle Linux - General 1 06-27-2004 02:55 PM


All times are GMT -5. The time now is 04:13 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration