Share your knowledge at the LQ Wiki.
Go Back > Forums > Linux Forums > Linux - Software
User Name
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.


  Search this Thread
Old 09-27-2010, 10:46 PM   #1
Registered: Jun 2005
Posts: 53

Rep: Reputation: 15
Help! Accidentally erased the partition table on one of my Hard Disks


I was trying to wipe the MBR on a disk on my machine but didn't realise I was in an SSH session on a server and wiped the partiton table from that disk instead.

I did:

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

Now one of the disks on that server no longer has a partition table. This disk is part of an array of LVM disks, from what I can remember the disk only had 1 partition on it.

The server is still running correctly but I guess at the next reboot I'm in trouble....

What can I do to save myself? And do I have to do anything different because it's LVM?

Last edited by xnomad; 09-28-2010 at 12:55 AM.
Old 09-27-2010, 11:11 PM   #2
LQ Veteran
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 15,869

Rep: Reputation: 2189Reputation: 2189Reputation: 2189Reputation: 2189Reputation: 2189Reputation: 2189Reputation: 2189Reputation: 2189Reputation: 2189Reputation: 2189Reputation: 2189
One of those d'oh moments ...
testdisk is the answers for this. LVM doesn't matter - at this point; so long as the PV was in fact a partition, and not the entire disk.
You could also simply fix it from fdisk if the partition covered the entire disk.
Have a look at /proc/partitions.

One also assumes this didn't contain your stage1 boot code - else you'd better rectify that too before re-booting.

Last edited by syg00; 09-27-2010 at 11:34 PM. Reason: Final comment
Old 09-28-2010, 12:53 AM   #3
Registered: Jun 2005
Posts: 53

Original Poster
Rep: Reputation: 15
Yep it's bad how I can't think at all when I get into a panic!
Second d'oh moment in 2 weeks, and I don't usually make such massive mistakes, I think I need a holiday!

I tried to run a gpart scan on the drive but it's 500GB and still running.

/proc/partitions seems to agree that it was only one big partition so I just ran fdisk and created it again with type LVM.

I think I dodged a bullet. Yeah the MBR is on an entirely different disk.



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
Oops! Erased mbr, no more partition table. Any way to reconstruct? kinematic Linux - General 14 08-16-2010 05:17 PM
kernel unable re-read partition table on disks when i start gparted penduleum Fedora 6 04-20-2010 06:56 AM
Accidentally Deleted Partition Table jani_fedora Linux - Hardware 3 03-27-2008 05:24 PM
Gnome: accidentally erased open program buttons from panel airezulian Linux - Desktop 1 09-27-2006 08:52 PM
How to disable partition table detection for disks? Erik_FL Linux - Kernel 1 08-30-2006 10:11 PM > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 03:55 AM.

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