lunes, 10 de diciembre de 2012

Make a full hard disk image in Linux


To make a full hard disk image in linux we will use several small programs and a livecd.
Next to this we need a place to store the image (external hard disk?). Which livecd you use is not that important. Just make sure that you access the place where you want to store the image and that you have access to gzip, dd and swapoff (if there is a swap partition).
So let us see the steps to take:
  1. Boot into the livecd
  2. Make sure you can access the place where you want to store the image
  3. (1) Disable the swap partition on the hard disk you want to image
  4. (2) Start the image-making process
  5. Check if the image is stored on the requested locations without errors
So let us see which commands we have to use to perform actions (1) and (2):
(1)# sudo swapoff -a
(2)# sudo dd if=/dev/hd_ | gzip > /mnt/hd__/image_name.dd.gz
Restoring the image is as easy as making it. Let us see these steps as well
  1. Boot into the livecd
  2. Make sure you can access the place where your image is stored
  3. (3) Disable the swap partition on the hard disk you want to image
  4. (4) Start the image-restoring process
  5. Check if the image is restored on the requested location without errors
So let us see which commands we have to use to perform actions (3) and (4):
(3)# sudo swapoff -a
(4)# sudo gzip -dc /mnt/hd__/image_name.dd.gz | dd of=/dev/hd_
That is it. I hope it is/was helpful.

domingo, 9 de diciembre de 2012