Clone Ubuntu Linux to Different Hardware config PC - Tips4ever

Latest

Hi this is Mahesh, Tips4ever is my IT Journey to technology, computers, software, Internet and much more....

BANNER 728X90

Jan 24, 2011

Clone Ubuntu Linux to Different Hardware config PC




On Master or Source PC:

Method One:
1.Boot a PC with Livecd.
2.Create "clone" and "source" folders on /mnt

sudo mkdir /mnt/{clone,source}

3.Mount the empty Local Partition or Flash drive to the mount point /mnt/clone

sudo mount /dev/<removal-disk> /mnt/clone

4. Mount root "/" partition of source-PC to /mnt/source mount point.

sudo mount /dev/<root-partation*> /mnt/source

5.Backup the root folder "/" via tar Command

tar -cvzf /mnt/clone/clone.tgz /mnt/source/{etc,home,opt,tmp,usr,var}

tar -- The command is used to compress the files and directories
-cvzf -- Is the options of the Tar command -c means create file, -v means verbose, -z means compress the file in gzip format, -f means force.
/mnt/clone/clone.tgz -- Indicates that path to create clone.tgz .
/mnt/source/{etc,home,opt,tmp,usr,var} -- This are all the directories and sub-directories which we want to clone.

Method Two:
1.Boot a PC Normally.
2.Create "clone" folder on /mnt

sudo mkdir /mnt/clone

3.Mount the empty Partition or Flash drive to the mount point /mnt/clone

sudo mount /dev/< removal-disk> /mnt/clone

4.Backup the root folder "/" via tar Command

tar -cvzf /mnt/clone/clone.tgz /{etc,home,opt,tmp,usr,var}

tar -- The command is used to compress the files and directories
-cvzf -- Is the options of the Tar command -c means create file, -v means verbose, -z means compress the file in gzip format, -f means force.
/mnt/clone/clone.tgz -- Indicates that path to create clone.tgz .
/mnt/source/{etc,home,opt,tmp,usr,var} -- This are all the directories and sub-directories which we want to clone.

On the Destination PC:

Method One (Individual single PC):
1. Install Ubuntu Desktop on target or Destination PC.
2. Restart the PC with livecd.

3. Copy clone.tgz to a removal media like flash drive and mount to /media mount point.

sudo mount /dev/< removal-disk> /media

4. Create "Ubuntu" directory on /mnt.

sudo mkdir /mnt/ubuntu

5. Mount root partition which Ubuntu desktop installed on step-2 to /mnt/Ubuntu.

sudo mount /dev/ /mnt/ubuntu

6. Install or extract the clone.tgz file to target mount point.

tar -xvpzf /media/clone.tgz -C /mnt/ubuntu

-xvpzf -- x means Extract.
C -- change directory to the one indicated next before extracting the file.
/mnt/ubuntu -- the root directory.

7. Change The Hostname (PC name):

sudo gedit /mnt/ubuntu/etc/hostname

Enter and save the Hostname as you like.
Restart the PC and Finish!.

Method Two (Individual and Workgroup PC):
1. Create share-folder via the share Folder menu.
2. Copy clone.tgz to the share-folder.
3. Install or extract the clone.tgz to the root "/" directory

tar -xvpzf //clone.tgz -C /
           (OR)
tar -xvpzf /media/clone.tgz -C /

3. Change The Hostname (PC name):

sudo gedit /etc/hostname

Enter and save the Hostname as you like.
Restart the PC and Finish!.

Note: It is safe to follow the steps of Livecd cloning in source and destination side PC

Source: http://ubuntuforums.org/showthread.php?t=525660rel="lightbox" title="Your image Caption"