How to Copy your OS in a Easy Way
Sign up for the Best Launches
It is always a pain to reconstruct your perfectly configures system from scratch. But pushing demands of new technologies always prompt you to get new and better hard drives or the electronics of the old computer fails, prompting you to get another. Either way the problem you are facing is to copy the contents of your hard disk to another. By the contents, I mean everything, from the Operating System to the device files.
There are different methods available for different operating systems. The process differs from *nix to Windows. *nix doesn’t have to have special tools to do the job, since what is required is usually installed with the base system. Moreover, *nix can do the complete copy of Windows without much trouble. Since Windows uses a radically different approach to bootloaders, if you are copying over your Windows files with *nix, you will have to make sure that all the device files are in place, or you will risk jeopardizing your system.
Let us first talk of copying the system using *nix. The first step is to adding the new physical disk. Most *nix systems emulate ATA drives using SCSI. So most probably, your drive will be cropping up as /dev/sdX. For the sake of simplicity, let me take my original drive as /dev/sda and the newly plugged drive as /dev/sdb. It is always a good idea to run *nix at run level 1 (better known as Single User Mode) while doing the copy. Switch to Single User mode using the telinit command or changing the grub boot entry. Either cases aren’t difficult and a simple search on changing runlevel will return you thousands if not millions of results.
The next step is to format the new drive(/dev/sdb) properly. There are numerous utilities available for use. You can use fdisk, cfdisk or even the mkfs.xxx command to do it old school. I like using mkfs command if what I want is a single partition. fdisk is more command driven and is suitable for beginners. But as is the case with any *nix system, it is just a matter of reading up the manuals properly. Following my suit, if you are using the mkfs.xxx command and you want to partition your new drive as ext4, use the command: mkfs.ext4 /dev/sdb
With a brand new hard disk and a faster file system ready, it is now time to copy over the files. The utility copy is a wonderful utility that can be used to transfer the files faithfully; but copying a archive is better, as it saves time. The archiver tar already installed in *nix systems is a great utility to do the job nice and clean. tar also preserves all the file attributes while copying. So you don’t have to worry about security risks or breaches on your new hard drive. IT is always a good idea to check manually as Murphy’s law holds true everywhere.
Before you copy, you have to mount the new hard disk. Suppose you are mounting in /mnt. The command mount -t ext4 /dev/sdb /mnt mounts the ext4 partitioned hard disk at /mnt. Now, you are all set to copy the files. If you are using the tar utility,
tar -cf – bin boot etc home lib lost+found media lib opt proc [...]|(cd /mnt; tar xvf -)
will archive, copy and unarchive all the files to your new hard disk. You have to list everything in your root directory to tar, excluding /mnt. If you include /mnt, it will begin a recursive copying which will fill up your hard disk.
In the newly copied system, you may to wipe out /proc and /sys, as they are created automatically by the kernel once it boots. However, you may have to include empty directories of the same name. Now your new hard drive is copied and read, you will have to install the bootloader into it. Depending on your bootloader(it can be lilo or grub), issue the command to install the bootloader into the new drive.
And you have a spanking new system at hand.
In the case of Windows, free utilities are not readily installed and you will have to use some sort of disk imaging software like Norton Ghost or Acronis TrueImage. Ghost is a utility that should be familiar to most computer users, since it has been around from the days of IBM PC. Another feature of Norton Ghost is the ability to copy files from an older, smaller hard disk to a bigger one. The unallocated space in the new hard drive is automatically converted by Ghost into a new partition. Norton Ghost does not need you to use a bootable medium as it automatically boots up into its DOS environment and clones once you have configured the source/destination partitions to copy.
An excellent freeware utility doing the same operation is Miray’s Hdclone. The freeware utility is limited by the fact that it can copy files from only a smaller partition to a bigger partition. It cannot copy between same same partition sizes. Hdclone creates a bootable disk or CD with which one can boot and initiate the copying operations. Another limitation of using Hdclone is that the new hard disk will be converted into a single partition of the same size. You will have to convert the unused partition into a new partition by yourselves.
One limitation of copying in Windows is that the bootloader will have to be changed if you are intending to use both the disks at the same time. Else, you can unplug your old hard drive and use the new hard drive as the primary master. This will not change any things and you will be able to boot up into a new and improved hard disk, with the same OS as your older one.
There are numerous methods for achieving the same end result. I included two commonly used methods. The other uses are forks or deviations from these methods and I do not feel the need to mention them. The astute reader will be quick to experiment with other options available and develop a method suitable for them, ultimately making the migration a breeze.



















No Comments Yet
>> You could be the first to comment!!! <<
Leave a Comment