LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 05-31-2012, 05:36 AM   #1
psyphy
LQ Newbie
 
Registered: May 2012
Posts: 6

Rep: Reputation: Disabled
Restore old partition table


Hi!

I was trying to clone my system drive with clonezilla, which I've accomplished without error many times; however, this time I mistakenly chose a different option which ended up destroying my external hard-drive.

Previously, I had a large 450GB parttition and 2 smaller partitions on my 500GB external hard drive. Now, I have 5 2-3GB invalid partitions. The data I need is in the first 450GB, is it possible to recover this data? I do not care about the smaller partitions. Would a new partition table and a format to full 500GB NTFS help?

Any ideas? I'll provide all the info you need.
 
Old 05-31-2012, 07:49 AM   #2
pan64
LQ Guru
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 12,705

Rep: Reputation: 3982Reputation: 3982Reputation: 3982Reputation: 3982Reputation: 3982Reputation: 3982Reputation: 3982Reputation: 3982Reputation: 3982Reputation: 3982Reputation: 3982
have you tried this: http://www.cgsecurity.org/wiki/TestDisk ?
 
Old 05-31-2012, 10:07 AM   #3
psyphy
LQ Newbie
 
Registered: May 2012
Posts: 6

Original Poster
Rep: Reputation: Disabled
Yup. However, it's only showing the new invalid partitions after a 7hr scan!
 
Old 05-31-2012, 11:09 AM   #4
pan64
LQ Guru
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 12,705

Rep: Reputation: 3982Reputation: 3982Reputation: 3982Reputation: 3982Reputation: 3982Reputation: 3982Reputation: 3982Reputation: 3982Reputation: 3982Reputation: 3982Reputation: 3982
I would suggest you to write a partition table similar to the original and ask testdisk to repair that one.
here are some additional tips and hints:
http://tldp.org/HOWTO/Partition/recovering.html
http://sysblogd.wordpress.com/2008/0...-roms-or-dvds/
 
Old 05-31-2012, 12:10 PM   #5
psyphy
LQ Newbie
 
Registered: May 2012
Posts: 6

Original Poster
Rep: Reputation: Disabled
Hi!

Thanks for replying!

Now, the first link says that the creation of new partitions is a bad idea; now I didn't do this purposely, however, this will only render that first few GB of data inaccessible right, and not the rest? I'd be content to have at least 300/500GB recovered.

Do I need to make a similar partition scheme, or would making the whole drive one partition still work, since I don't really care about the lat two smaller partitions - only the large first partition.

Any ideas?

Thanks so much!
 
Old 05-31-2012, 12:23 PM   #6
pan64
LQ Guru
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 12,705

Rep: Reputation: 3982Reputation: 3982Reputation: 3982Reputation: 3982Reputation: 3982Reputation: 3982Reputation: 3982Reputation: 3982Reputation: 3982Reputation: 3982Reputation: 3982
you do not need (you must not) create filesystems, just a partition table. It will describe the location and size of the filesystem. If you were lucky you should find your old filesystem without problems, just you need to configure a partition to cover it. So you will only need to write a partition table again. Probably you can set only one partition and it will contain the whole disk. Also you can try to set the filesystem type. Finally you can try TestDisk again.
 
Old 05-31-2012, 12:34 PM   #7
psyphy
LQ Newbie
 
Registered: May 2012
Posts: 6

Original Poster
Rep: Reputation: Disabled
What I meant is that clonezilla has already created empty NTFS and for the love of god, ext4 partitions on the external hard tube, totaling 25~GB, which I specified as invalid partitions, since test disk said the same thing, and I can't access them. How much data, if any have they destroyed?

Though I consider my myself an intermediate computer sure, I'm not able to understand the procedure in the links you sent me; any help?

Thanks!
 
Old 05-31-2012, 01:21 PM   #8
pan64
LQ Guru
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 12,705

Rep: Reputation: 3982Reputation: 3982Reputation: 3982Reputation: 3982Reputation: 3982Reputation: 3982Reputation: 3982Reputation: 3982Reputation: 3982Reputation: 3982Reputation: 3982
I'm afraid it wont be an easy task. If you had already destroyed a part of that old filesystem there will be no chance (or just a minimal) to recover anything. The ext* filesystems can be recovered if you have a root/base dir to start with. Now you need to scan the drive and find a block containing something like a directory.

About the first link I gave:
step 1: configure disk as one partition with fdisk
step 2: dumpe2fs will try to find the real occupied size of the filesystem on that partition
step 3: clean partition table
step 4: calculate the real parameters of the partition based on the result of dumpe2fs and set it with fdisk
step 5: fsck will check if it is usable

But again, if you did really overwrite the first few gigs you are almost lost.
 
Old 05-31-2012, 01:37 PM   #9
psyphy
LQ Newbie
 
Registered: May 2012
Posts: 6

Original Poster
Rep: Reputation: Disabled
I'm not sure if creating a new NTFS partition counts as overwriting data?
The new partitions are all empty - confirmed via PCman file manager off my Parted Magic Live Disc.
Will the procedure you have specified, have the potential to cause any more data loss, i.e data that could be recovered using commercial software?
Any ideas?
Thanks!
 
Old 05-31-2012, 01:51 PM   #10
pixellany
LQ Veteran
 
Registered: Nov 2005
Location: Annapolis, MD
Distribution: Arch/XFCE
Posts: 17,802

Rep: Reputation: 740Reputation: 740Reputation: 740Reputation: 740Reputation: 740Reputation: 740Reputation: 740
psy:

If you are serious about that data, consider cloning that drive before you do anything else.

To address some of the other questions, there are many operations that --for the normal user-- effectively delete data. But the actual data is typically NOT overwritten. two scenarios are relevant:
1. Under the control of the filesystem, you erase a file. Nothing is overwritten---you just lose the link to the data.

2. You create a new filesystem. In this case, data structures are written to the disk---thus some data might get overwritten, but not necessarily all.
 
Old 06-01-2012, 12:44 AM   #11
pan64
LQ Guru
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 12,705

Rep: Reputation: 3982Reputation: 3982Reputation: 3982Reputation: 3982Reputation: 3982Reputation: 3982Reputation: 3982Reputation: 3982Reputation: 3982Reputation: 3982Reputation: 3982
Quote:
Originally Posted by psyphy View Post
I'm not sure if creating a new NTFS partition counts as overwriting data?
You do not need to create a filesystem, you will modify only the partition table itself. It means you will not overwrite any files on the disk.
There is a possibility to define the filesystem type in the partition table, but it does not mean you create that filesystem, it is just an information.
 
Old 06-01-2012, 01:12 AM   #12
zhjim
Senior Member
 
Registered: Oct 2004
Distribution: Debian Squeeze x86_64
Posts: 1,748
Blog Entries: 11

Rep: Reputation: 233Reputation: 233Reputation: 233
When it comes to lost data I always use R.I.P. Linux. As well it comes with testdisk which really did some good stuff on me. At first I had trouble understanding the usage and the ouput but when thinking about it carefully it started to make sense. You always have the choice to just have testdisk read and not do anything. Knowing that it takes time yes, but in my opinion it takes less time to re create the lost data if even possible.

On your side I would just get myself another 500GB harddrive and use photorec (included with rip) and see what it can recover.

Your question if there is the chance to further destroy data here are some thoughts.
Code:
==physical HD==
Master boot sector 512K with partition table
partition 1 start
virtual boot sector ?512K?
filesystem header (??k)
file space (??M)
backup filesystem header (??k)
file space(??M)
partition 1 end
another partition start
filesystem header (??k)
....
...
another partition end
So creating another partition table does not destroy real data cause it just gets written inside the 512K of the partition table. But as you create a filesystem you start overwriting data at the point where the partition you put the filesystem on starts. When creating a filesystem you also overwrite data depending on how big the filesystem header is. You overwrite data when the new fs header is bigger than the old one. You as well overwrite data due to the backup fs header. But the backup fs header is also usefull to see how big the whole file system was as it contains the starting and end point of the filesystem as well.
 
Old 06-01-2012, 07:09 AM   #13
psyphy
LQ Newbie
 
Registered: May 2012
Posts: 6

Original Poster
Rep: Reputation: Disabled
Thanks for all your replies.

I'll clone/image my disc and try out those methods.

I'll get back to you with the results.

Might take a week, since we're having some tests & exams.

Thanks!
 
  


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 On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
partition table restore mkzet Linux - Newbie 3 01-16-2011 06:24 PM
restore partition table from the cache? drkstr Slackware 10 09-08-2006 03:05 AM
How to restore partition table without a CDROM? welson_sun Fedora - Installation 2 10-11-2005 03:30 PM
ext3 partition table restore pats Linux - General 1 07-22-2005 10:44 PM
Why can't I restore a partition table backup containing a reiser partition? oldweasel Linux - Software 2 05-23-2004 12:11 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 02:21 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