LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Clone OS from one machine to the other machine type (https://www.linuxquestions.org/questions/linux-newbie-8/clone-os-from-one-machine-to-the-other-machine-type-651655/)

ufmale 06-25-2008 03:19 PM

Clone OS from one machine to the other machine type
 
I install a redhat on one machine, recompile the kernel.
Now, i want to have the same setup on other machine (different type of desktop).

Should I reinstall it from CD, or is there a way I can image the OS?

rjlee 06-25-2008 05:17 PM

On the whole, reinstalling from a CD is probably easier.

If you want to copy the kernel image, then I would copy the kernel sources after doing the reinstall, and then just re-install the kernel on the second machine.

Cloning the disks is also possible. This is easiest if the two machines have hard-disks of the exact same size.

First, install sshd on the first machine, so that you can read the disk image across the network from the second machine.

You may run into problems if you don't remount the filesystem on the first machine as read-only at this point. For each filesystem:
Code:

mount /path/to/mountpoint -o remount,ro
For SATA or SCSI disks, you can create a disk image using:
Code:

dd if=/dev/sda of=/tmp/sda.dump
Now boot the second machine from a live (or rescue) CD.

You can then use fuse to mount the /tmp directory from the first machine. See http://www.cyberciti.biz/tips/rhel-c...ing-sshfs.html

The command you will need is as follows; username is your user on the first machine and 192.168.1.1 is its IP address:
Code:

sshfs username@192.168.1.1: /mnt/remote
Code:

dd if=/mnt/remote/sda.dump of=/dev/sda
You should be able to substitute sda with hda for IDE/ATAPI disks. Because hda and sda includes the entire disk, boot sectors, partition tables and all, it should be immediately bootable.

Please note: This is a dangerous procedure, and I haven't tried it myself, although it should work. Please make sure you back up all your data first, including your kernel configuration.

billymayday 06-25-2008 05:41 PM

The initial installation should have created a kickstart file in root's home directory that will make the second installation an effective copy if that helps


All times are GMT -5. The time now is 03:56 PM.