Corrupt partition table

Posted on 2009-02-19
Last Modified: 2013-11-30
how can i corrput a partition from a linux OS?
Question by:areyouready344

    Author Comment

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

    Accepted Solution

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

    Expert Comment

    have you tryed with gparted, its worth to give it a try

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

    Expert Comment

    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.

    LVL 23

    Expert Comment

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

    Featured Post

    Highfive Gives IT Their Time Back

    Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

    Join & Write a Comment

    More or less everybody in the IT market understands the basics of Networking, however when we start talking about Storage Networks, things get a bit dizzier, and this is where I would like to help.
    It’s 2016. Password authentication should be dead — or at least close to dying. But, unfortunately, it has not traversed Quagga stage yet. Using password authentication is like laundering hotel guest linens with a washboard — it’s Passé.
    Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
    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…

    754 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

    Need Help in Real-Time?

    Connect with top rated Experts

    26 Experts available now in Live!

    Get 1:1 Help Now