Use A Linux Bootable CDROM to Image Your Hard Drive

 

Use A Linux Bootable CDROM to Image Your Hard Drive

Purpose: The purpose of this document is to instruct the user in several ways you can use a livecd distribution of Linux to create a perfect image of your hard drive. I used the wonderful Knoppixlivecd but these instructions should work for any livecd distribution, or even a floppy distribution if it had drivers for your network card and the software used in the process.

  • Image hard drive to remote ssh server:Requirements:
    1. Access to remote ssh server
    2. Enough space to store the image

    Process: Make changes where necessary to match your system setup.

    1. Boot from the live cdrom distribution.
    2. Switch to root
    3. Make sure NO partitions are mounted from the source hard drive.
    4. Execute the following command, making necessary changes for your system:
      dd if=/dev/hda | ssh user@remotehost /bin/dd of=/tmp/mypc_hda.img
  • Restore hard drive from remote ssh server:Requirements:
    1. Access to remote ssh server
    2. Hard drive with equal or greater capacity than the hard drive image.

    Process: Make changes where necessary to match your system setup.

    1. Boot from the live cdrom distribution.
    2. Switch to root
    3. Make sure NO partitions are mounted from the source hard drive.
    4. Execute the following command, making necessary changes for your system:
      ssh user@remotehost cat /tmp/mypc_hda.img | dd of=/dev/hda
  • Image hard drive to Windows/Samba share:Requirements:
    1. Access to shared Windows/Samba directory
    2. Enough space to store the image

    Process: Make changes where necessary to match your system setup.

    1. Boot from the live cdrom distribution.
    2. Switch to root
    3. Make a mount point directory. Example: mkdir /mnt/remote_share
    4. Mount the Windows/Samba shared directory. Example:
      smbmount //192.168.1.100/shared /mnt/remote_share -o username=jsmith,password=changeme
    5. Make sure NO partitions are mounted from the source hard drive.
    6. Execute the following command, making necessary changes for your system:
      dd if=/dev/hda of=/mnt/remote_share/mypc_hda.img
  • Restore hard drive from Windows/Samba share:Requirements:
    1. Access to shared Windows/Samba directory
    2. Hard drive with equal or greater capacity than the hard drive image.

    Process: Make changes where necessary to match your system setup.

    1. Boot from the live cdrom distribution.
    2. Switch to root
    3. Make a mount point directory. Example: mkdir /mnt/remote_share
    4. Mount the Windows/Samba shared directory. Example:
      smbmount //192.168.1.100/shared /mnt/remote_share -o username=jsmith,password=changeme
    5. Make sure NO partitions are mounted from the source hard drive.
    6. Execute the following command, making necessary changes for your system:
      dd if=/mnt/remote_share/mypc_hda.img of=/dev/hda
  • Clone a hard drive onto another hard drive:Requirements:
    1. Destination drive equal or greater than the source drive.

    Process: Make changes where necessary to match your system setup. In my example here, /dev/hda is the source, /dev/hdb is the destination.

    1. Boot from the live cdrom distribution.
    2. Switch to root
    3. Make sure NO partitions are mounted from either drive.
    4. Execute the following command, making necessary changes for your system:
      dd if=/dev/hda of=/dev/hdb

    Copyright (c) OSSIE J H MOORE <linux@okmoore.com>.
Permission is granted to copy, distribute and/or modify this document
under the terms of the GNU Free Documentation License, Version 1.2
or any later version published by the Free Software Foundation;
with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts.
A copy of the license is included here

Leave a Reply