Archive

Posts Tagged ‘cloning’

Using dd to create disk images

September 9th, 2008

 Powered by Max Banner Ads 
Create a hard disk image:
 
 dd if=/dev/hda1 of=/home/hda1.bin
 
Create a compressed disk image
 
dd if=/dev/hda1 | gzip  > /home/hda1.bin.gz
 
Back up the MBR
 
 dd if=/dev/hda of=/home/hda.boot.mbr bs=512 count=1
 
Restore MBR (from a Live CD)
 
dd if=/mnt/hda1/home/hda.boot.mbr of=/dev/hda bs=512 count=1
 
Backup a drive to another drive
 
 dd if=/dev/hda of=/dev/hdb conv=noerror,sync bs=4k

Fabio Laganà Debian, Linux, cloning , ,

Another trick for cloning

July 10th, 2008
   For a beowulf of full fledged Debian systems (local disk, no shared /usr
or anything like that) you'd need to use

prototype-node:
 dselect  (install and configure everything you want)
 dpkg --get-selections > selection.file

second node:

  dpkg --set-selections < selection.file
  apt-get install dselect-upgrade
  [log any questions and answers]
  [create an expect script with your responses to any questions]

rest-of-nodes:

   dpkg --set-selections < selection.file
  expect -c "apt-get install dselect-upgrade" -f expect-script

Fabio Laganà Debian, Linux, Shell, bash

cloning disk using dd

May 29th, 2008

from your machine to external usb disk:

dd if=/dev/&lt;your machine disk&gt; | gzip &gt; /path/nameofyourimg.gz

from your img saved to external usb disk:

zcat /path/nameofyourimg.gz | dd of=/dev/&lt;your machine disk&gt;

Fabio Laganà Debian, Linux, Shell , , , ,