Click to See Complete Forum and Search --> : Migrating operating systems between different hard disk types


saikee
10-21-2007, 07:49 AM
Introduction

One of the enjoyable experience of Linux is that many seemingly complicated tasks in a proprietary system like a MS Windows can be achieved with a ridiculously simple one line of command in a Linux terminal. Migrating a bunch of operating systems from hard disk to hard disk is one of them. I found this out in my first 4 month in Linux and wrote a howto. (http://www.justlinux.com/forum/showthread.php?s=&threadid=134457)

Migration of operating systems using Linux

I have since consolidated and simplified the cloning procedure in this thread (http://www.justlinux.com/forum/showthread.php?threadid=149328) to show how one can migrate any type and any number of operating systems from a smaller hard disk to a bigger hard disk. A slightly modified version (http://www.justlinux.com/forum/showthread.php?threadid=149328) was posted in another forum to make it more user-friendly to the Windows users. The following is just an example of how one can apply the technique to different disks fixed internally and externally. Additional information is available in the Post #36 of the second link.

The challenges

Although I am convinced Linux is a great tool to copy operating systems around this is not widely known outside Linux. The other challenge is Vista has gone one step more in protecting itself against any movement by keeping a record of its partition table and refuses to boot if it is modified without its knowledge/approval.

Linux method of migrating operating systems from hard disk to hard disk is to transfer only the binary bits of "1" and "0" and has no interest of its content. Thus Linux can clone a mirror image of a original disk and Vista can therefore migrate from disk to disk without any objection. This is the theory. This thread was written to prove the theory by passing it through 4 different hard disks. To make life a little bit more interesting I threw in a XP and 10 Linux to show Linux is "man" enough to tackle such a challenge without a sweat or losing a beat.

I am also interested in the possibility of booting MS Windows systems from an external hard disk. The two alternatives available to me is an eSata and a USB disk. From theory I should be able to do it with the former and not with the latter, so let's find out.

Hard disk used

(1) An internal Sata II hard disk (Western Digital)
(2) An external eSata II hard disk (Seagate)
(3) An internal Pata AT133 hard disk (Western Digital)
(4) An external Pata ATA133 hard disk via USB (Seagate, preassembled by Iomega)

All the hard disks are 500Gb large and have exactly the same capacity, down to the exact number of bytes. Disk (1) is the original withwhich the operating systems were installed.

Explanation of hard disks types

Sata II is the current standard in Sata hard disk capable of 300Mb/s short term transfer speed although sustained speed is much lower. Sata I disk speed is 150Mb/s and has not been used here. Pata ATA133 is the fastest Pata hard disk with 133Mb/s short term transfer speed. Internal hard disks can communicate by a direct link with the CPU to give the best performance. A USB external hard disk is "bootle-necked" by the 480Mbit/s (or 60 Mb/s) transfer rate of the USB2. In practice a USB read/write speed is 3 to 4 times slower than an internal hard disk.

An eSata is a connection port in the motherboard for connecting an external Sata disk which can be either a Sata I or Sata II. The external eSata connector looks similar but is slightly different to internal connector. Its cross section is a "-" shape instead of the "L" shape for a normal Sata. eSata is to run a Sata hard disk externally as though it is still connected internally. Thus one can swap a eSata as easy as a USB hard disk. eSata may be controlled by a controller different from an internal Sata. My motherboard sees it as a SCSI hard disk.

Operating systems in the hard disk

I start with an internal Sata II, Item (1) above, and have a XP, a Vista and 10 Linux in the hard disk with the maximum permitted 15 partitions. One of the partition is for data storage, one for Linux swap and one as an extended partition (no storage inside but to define the boundary of the first and last logical partitions) and so leaving only 12 partitions available for operating systems. All the systems are booted by Grub hosted in a Ubuntu.

In every cloned hard disk I should and did boot to the same boot loader Grub every time.

Both XP and Vista were installed as stand-alone systems. This means after I installed XP I hide it (by Grub or Linux program cfdisk or fdisk) so that Vista is not aware of a fellow MS system. In booting I do the same by unhiding the MS partition that I wish to boot and hide the other to keep it quiet. This is my preferred method as I like to be able to repair indvidual system if anything goes wrong. The normal booting method with two MS system is to place a MS boot loader in the first system when installing the second MS system.

For those new to partition hiding and unhiding this thread (http://www.justlinux.com/forum/showthread.php?t=149828&highlight=hidden) has explains it.

Cloning sequence

Internal Sata --> eSata ---> internal Pata ---> USB Pata

Time recorded (each operation is cloning a 500Gb)

Internal Sata --> eSata = 9134 sec @ 54.8Mb/s
eSata --> internal Pata = 8047 sec @ 62.1Mb/s
internal Pata --> USB Pata = 27452 sec @ 18.2Mb/s

I used dd command from either Slax or Ubuntu and sometimes just in a Live CD. When a USB hard disk was involved the time took about 3.5 times longer. I have Sata II to Sata II cloning speed reaching 70Mb/s previously and the above suggests eSata is slower, possibly due to the unit handled as a SCSI disk.

Although it is possible in Linux to connect all the 4 disks together and clone the 3 disks simultaneously I only had two disks connected at any one time so that I could obtain a like-to-like comparison between cloning different disks.

Results

A word on the legal issue - The cloning is only good for the back up purposes as a clone technically cannot be used on another computer because of the different hardware. Legally it is also against the licensing agreement. The cloned copy is solely used as a substitute if the user accidentally trashes the system and does not want to go through the long process of installation, re-activation and re-loading of the programs.

I always remove the source disk when I boot the clone disk so that there is only one disk at any one time. Thus the Bios sees every disk as the first boot disk. Vista may do something to void itself (and Xp) if its detects there are identical system files in more than one partition.

All transfered operatings sytems booted successfully when were in the eSata (outside the PC) or in the internal Pata disk.

As expected XP and Vista do not support booting from a USB device so each one refused to boot by rebooting the PC every time I tried. I got 3 Linux booted successfully while the remainder reported "kernel panic - not syncing". This is to be expected because a Linux installed into an internal hard disk may require a differenr ram disk (initrd.img) to boot from a USB device.

The interesting point here is when I removed the two screws to open up the USB hard disk enclosure, took the hard disk out, put it into a caddy, inserted it into a mobile rack prefixed in the PC, powered the computer up and XP and Vista (and Linux) were bootable again. In fact I am writing this thread using a Vista that has been passed through three different hard disks.

Conclusion

A 500Gb hard disk with a XP, Vista and 10 Linux was cloned from an internal Sata to an external eSata All systems were verified bootable in the eSata working as the only hard disk outside the PC. The content of the external eSata Disk is then cloned back into an internal Pata which booted successfully when the eSata was removed. Finally the internal Pata was cloned to a USB hard disk. XP, Vista and some Linux refused to boot but all of them booted normally again if the hard disk were removed from the USB enclosure and fixed as an internal hard disk.

Linux dd command proves itself to be a very reliable tool for migrating operating systems, including those known to be resistant to any transfer.