LinuxQuestions.org
Register a domain and help support LQ
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
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.

Notices

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

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


Hi,

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
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 12,269

Rep: Reputation: 1028Reputation: 1028Reputation: 1028Reputation: 1028Reputation: 1028Reputation: 1028Reputation: 1028Reputation: 1028
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
xnomad
Member
 
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.

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 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


All times are GMT -5. The time now is 09:07 PM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration