Simple notes for folks who want to image their OS as it is. Every setting, to save the state of your server in-case things go badly in the future. Other use case is to duplicate your server on another machine.

This technique requires the destination machine has a HDD the same or large in size with respect to the initial imaged machine. Simple commands

To image an entire drive. Determine which drive you want to image. You can find available drives a lot of ways. I'd start by executing:

CODE:
    
df
    

This should give you good clues as to which disk you're interested in. You're looking for /dev/sda or sdb or sd..etc... Another useful command:

CODE:
    
fdisk -l
    

Once you've identified the drive you want to image. Type on the command line:

CODE:
    
dd if=/dev/hda of=/path/to/target/drive/file.image
    

In this case I have a USB HDD that I've mounted which is the target. I name a file which becomes the single-file image of the entire drive I'm backing up. in my example I'm backing up hda but you may be backing up a different drive based on your setup

To restore you're going to want to download something like Fedora onto a bootable USB drive. Boot up into that flash drive and use it to run the above commands to identify which target you want to restore to.

Once you have your target:

Restore:

CODE:
    
dd if=/source/image/from/backup/file.image of=/dev/hda
    

Best of luck. Be careful with dd it is a powerful tool.

Tommy

Navigate


Simple notes for folks who want to image their OS as it is. Every setting, to save the state of your server in-case things go badly in the future. Other use case is to duplicate your server on another machine.

This technique requires the destination machine has a HDD the same or large in size with respect to the initial imaged machine. Simple commands

To image an entire drive. Determine which drive you want to image. You can find available drives a lot of ways. I'd start by executing:

CODE:
    
df
    

This should give you good clues as to which disk you're interested in. You're looking for /dev/sda or sdb or sd..etc... Another useful command:

CODE:
    
fdisk -l
    

Once you've identified the drive you want to image. Type on the command line:

CODE:
    
dd if=/dev/hda of=/path/to/target/drive/file.image
    

In this case I have a USB HDD that I've mounted which is the target. I name a file which becomes the single-file image of the entire drive I'm backing up. in my example I'm backing up hda but you may be backing up a different drive based on your setup

To restore you're going to want to download something like Fedora onto a bootable USB drive. Boot up into that flash drive and use it to run the above commands to identify which target you want to restore to.

Once you have your target:

Restore:

CODE:
    
dd if=/source/image/from/backup/file.image of=/dev/hda
    

Best of luck. Be careful with dd it is a powerful tool.

Tommy