You are not logged in.

#1 2011-03-26 23:05:49

silentz0r
Member
Registered: 2010-10-31
Posts: 20

[SOLVED] Deleted partition table on drive, how to rescue?

Hello,

I accidentally dd'd the first 512 bytes using:

dd if=/dev/zero of=/dev/sdb bs=512 count=1

and the partition table is now gone. Is there ANY way to re-create the partition table and rescue the still existing partition? I read up on parted's manual, and found the following commands:

mklabel - to create a new label on the disk (but does it also create a new partition table?)
rescue - to try and rescue the partition around the given START and END

My hard drive is 500GB and has only 1 partition on it, in NTFS file format.

Any help would be much appreciated.

Silentz0r

Last edited by silentz0r (2011-03-27 16:17:36)

Offline

#2 2011-03-26 23:09:26

graysky
Member
From: /usr/share/zoneinfo/US/Eastern
Registered: 2008-12-01
Posts: 9,215
Website

Re: [SOLVED] Deleted partition table on drive, how to rescue?

Hmmm.. with GTP rather than MBR you could recover it with its redundant backup using gdisk.  I'm guessing you used an MBR though.... maybe someone else can help.  Have you tried googling?


CPU-optimized Linux-ck packages @ Repo-ck  • AUR packagesZsh and other configs

Offline

#3 2011-03-26 23:13:49

silentz0r
Member
Registered: 2010-10-31
Posts: 20

Re: [SOLVED] Deleted partition table on drive, how to rescue?

I did google a lot but didn't come across anything like my situation. Most people had deleted the partition from the partition table. I don't know what GTP is, and I didn't have a backup of the partition table hmm

Offline

#4 2011-03-26 23:15:08

tavianator
Member
From: Waterloo, ON, Canada
Registered: 2007-08-21
Posts: 858
Website

Re: [SOLVED] Deleted partition table on drive, how to rescue?

testdisk can scan for filesystems and generate a partition table based on where it finds them.

Last edited by tavianator (2011-03-26 23:15:31)

Offline

#5 2011-03-26 23:17:02

tomk
Forum Fellow
From: Ireland
Registered: 2004-07-21
Posts: 9,839

Re: [SOLVED] Deleted partition table on drive, how to rescue?

Try gpart.

Offline

#6 2011-03-26 23:17:39

silentz0r
Member
Registered: 2010-10-31
Posts: 20

Re: [SOLVED] Deleted partition table on drive, how to rescue?

I tried using testdisk but it didn't recognise any partitions. Also tried photosomething which was similar to testdisk, and wasn't able to do anything useful.

Offline

#7 2011-03-26 23:33:23

silentz0r
Member
Registered: 2010-10-31
Posts: 20

Re: [SOLVED] Deleted partition table on drive, how to rescue?

Also tried gpart, gives a fatal error.

*** Fatal error: dev(/dev/sdb): seek failure.

Last edited by silentz0r (2011-03-26 23:46:13)

Offline

#8 2011-03-27 11:27:58

stqn
Member
Registered: 2010-03-19
Posts: 1,189
Website

Re: [SOLVED] Deleted partition table on drive, how to rescue?

Well, if you had only one partition, it should be doable to recreate it... It will probably start either from sector 63 or sector 2048, and end at the end of the disk.

I've never done that, but I think if you launch the same tool you used to create the partition the first time, and use it to create an NTFS partition spanning the whole disk, but *don't* format it, then you might be able to access your partition as before.

It would be best if you could first backup your whole disk with dd to another disk, of course. And then mount the new partition as read-only to avoid destroying your files if something is not right...

I'll just repeat here that I've never done that, so there's no guaranty smile.

Offline

#9 2011-03-27 13:40:40

hauzer
Member
From: Belgrade, Serbia
Registered: 2010-11-17
Posts: 279
Website

Re: [SOLVED] Deleted partition table on drive, how to rescue?

I know it's Windows, but try Partition Wizard (Home Edition). It saved my disk once, although it had NTFS partitions. Anyway, you could try it out.


Vanity of vanities, saith the Preacher, vanity of vanities; all is vanity.
What profit hath a man of all his labour which he taketh under the sun?
All the rivers run into the sea; yet the sea is not full; unto the place from whence the rivers come, thither they return again.
For in much wisdom is much grief: and he that increaseth knowledge increaseth sorrow.

Offline

#10 2011-03-27 16:17:19

silentz0r
Member
Registered: 2010-10-31
Posts: 20

Re: [SOLVED] Deleted partition table on drive, how to rescue?

Thanks everyone for your help, I have managed to solve this. Here's what I did:

(I had no backup of the MBR)

I used:

parted /dev/sdb

sdb was my broken drive, and did the following:

(parted) print                                                            
Error: /dev/sdb: unrecognised disk label                                  
(parted) mklabel 
(parted) mklabel msdos
(parted) rescue                                                           
Start? 0                                                                  
End? 976773168                                                            // This was just a random guess.
Information: A ntfs primary partition was found at 32.3kB -> 500GB.  Do you want to add it to the partition table?
Yes/No/Cancel? yes                                                        
(parted) quit                                                             
Information: You may need to update /etc/fstab.

And everything works now.

For the record, I am making MBR backups for all my drives while I'm typing this.

Hope this helps someone in the future! Marked as solved.

Offline

#11 2011-03-27 16:35:37

skodabenz
Banned
From: Tamilnadu, India
Registered: 2010-04-11
Posts: 382

Re: [SOLVED] Deleted partition table on drive, how to rescue?

One suggestion: If it is only a data disk (wrt Windows), use http://wiki.archlinux.org/index.php/GUI … tion_Table to recover from these problems. GPT stores a backup partition table at the end of disk. To boot windows from a GPT disk you need UEFI firmware, but you dont need UEFI to use GPT disk as a data disk alone.


My new forum user/nick name is "the.ridikulus.rat" .

Offline

#12 2011-03-27 17:50:15

graysky
Member
From: /usr/share/zoneinfo/US/Eastern
Registered: 2008-12-01
Posts: 9,215
Website

Re: [SOLVED] Deleted partition table on drive, how to rescue?

+1 for GPT.


CPU-optimized Linux-ck packages @ Repo-ck  • AUR packagesZsh and other configs

Offline

Board footer

Powered by FluxBB