Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

Corrupt partition table

Posted on 2009-02-19
7
Medium Priority
?
317 Views
Last Modified: 2013-11-30
how can i corrput a partition from a linux OS?
0
Comment
Question by:areyouready344
5 Comments
 

Author Comment

by:areyouready344
ID: 23682904
I'm trying to test the recovery of corrupt partition if there is a way to do it with the "dd" command on the linux operating system
0
 
LVL 23

Accepted Solution

by:
Maciej S earned 2000 total points
ID: 23840496
Assuming you have your disk on /dev/sda. Remember, that below command will write random data to your partition table - do it on your own risk!

dd if=/dev/urandom of=/dev/sda bs=1 skip=446 count=64
0
 
LVL 29

Expert Comment

by:fosiul01
ID: 23840697
HI
have you tryed with gparted, its worth to give it a try
http://ubuntuforums.org/showthread.php?t=370121

but is there any way to explain little bit actualy, whats the problem, what error you seeing ??
0
 
LVL 23

Expert Comment

by:Mysidia
ID: 23843241
An easy way to corrupt the partition table (and the boot block)
is to blow away sector 0.

for example, if your hard drive device is 'hda'

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


It would be extroardinarily unlikely for just the last 64 bytes of sector 0 to get corrupted,  most likely all 512 bytes would.

To recover, you should be prepared to restore not only your partition table from backup,  but your boot code (i.e. Grub, LILO, etc) as well.

0
 
LVL 23

Expert Comment

by:Maciej S
ID: 23844451
Overwriting 512 bytes will corrupt entire MBR, not only partition table.
0

Featured Post

Free Backup Tool for VMware and Hyper-V

Restore full virtual machine or individual guest files from 19 common file systems directly from the backup file. Schedule VM backups with PowerShell scripts. Set desired time, lean back and let the script to notify you via email upon completion.  

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

We look at whether swapping a controller board on a failed hard drive is likely to solve the problem.
How much do you know about the future of data centers? If you're like 50% of organizations, then it's probably not enough. Read on to get up to speed on this emerging field.
Learn how to get help with Linux/Unix bash shell commands. Use help to read help documents for built in bash shell commands.: Use man to interface with the online reference manuals for shell commands.: Use man to search man pages for unknown command…
Learn how to navigate the file tree with the shell. Use pwd to print the current working directory: Use ls to list a directory's contents: Use cd to change to a new directory: Use wildcards instead of typing out long directory names: Use ../ to move…
Suggested Courses
Course of the Month20 days, 19 hours left to enroll

810 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question