Find the answer to your Linux question:
Results 1 to 3 of 3
I just recently made the fatal mistake of typing "mkfs.vfat /dev/hda1" and deleting the wrong FAT32 partition on my computer. Right now, I am attempting to recover it but do ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Sep 2005
    Posts
    5

    How to copy exact hard drive partition bit by bit


    I just recently made the fatal mistake of typing "mkfs.vfat /dev/hda1" and deleting the wrong FAT32 partition on my computer. Right now, I am attempting to recover it but do not know how. The first thing I want to do is transfer the corrupted partition to another computer. Based on suggestions, I am using the program called "dd." However, I do not know how to do this over a network. Basically, I want to copy /dev/hda1 on my one computer to /dev/hdb8 on another computer called COMP, let's say. I am trying


    dd if=/dev/hda1 of=COMP:/dev/hdb8

    but that is not working. Anyone know what I am doing wrong?

  2. #2
    Linux Guru anomie's Avatar
    Join Date
    Mar 2005
    Location
    Texas
    Posts
    1,692
    Easiest thing would be if you could create the image on the local machine and then transfer it over the network. For example:
    Code:
    dd if=/dev/hda1 of=/mnt/bkup/hda1.img
    This command would create an image of the first partition on the first physical drive, and save it to a mount point /mnt/bkup (which you would need to create first). There will need to be sufficient room there for the image. Also, /dev/hda1 should be mounted read-only before you attempt to do this.

    Then you can copy hda1.img to another machine via scp or whatever.

  3. #3
    scm
    scm is offline
    Linux Engineer
    Join Date
    Feb 2005
    Posts
    1,044
    If you don't mind a bit of insecurity you could enable rsh and do
    Code:
    dd if=/dev/hda1 | rsh otherhost dd of=/dev/hdb8
    You could put a bit of compression in the pipeline to reduce network traffic.

  4. $spacer_open
    $spacer_close

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •