|
-
An example of cloning
Here is an Ubuntu 7.10 Live CD screen message of cloning from a 500Gb eSata disk sda (Seagate), which is physically outside the PC to an internal raw 500Gb Pata disk sdb (Western Digital)
Code:
ubuntu@ubuntu:~$ sudo su
root@ubuntu:/home/ubuntu# fdisk -l
Disk /dev/sda: 500.1 GB, 500107862016 bytes
255 heads, 63 sectors/track, 60801 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot Start End Blocks Id System
/dev/sda1 1 12158 97659103+ 17 Hidden HPFS/NTFS
/dev/sda2 * 12159 24316 97659135 7 HPFS/NTFS
/dev/sda3 24317 36598 98655165 5 Extended
/dev/sda4 36599 60801 194410597+ 83 Linux
/dev/sda5 24317 24438 979933+ 82 Linux swap / Solaris
/dev/sda6 24439 25654 9767488+ 83 Linux
/dev/sda7 25655 26870 9767488+ 83 Linux
/dev/sda8 26871 28086 9767488+ 83 Linux
/dev/sda9 28087 29302 9767488+ 83 Linux
/dev/sda10 29303 30518 9767488+ 83 Linux
/dev/sda11 30519 31734 9767488+ 83 Linux
/dev/sda12 31735 32950 9767488+ 83 Linux
/dev/sda13 32951 34166 9767488+ 83 Linux
/dev/sda14 34167 35382 9767488+ 83 Linux
/dev/sda15 35383 36598 9767488+ 83 Linux
Disk /dev/sdb: 500.1 GB, 500107862016 bytes
255 heads, 63 sectors/track, 60801 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk /dev/sdb doesn't contain a valid partition table
root@ubuntu:/home/ubuntu# dd if=/dev/sda of=/dev/sdb bs=32768
15262080+1 records in
15262080+1 records out
500107862016 bytes (500 GB) copied, 8047.02 seconds, 62.1 MB/s
root@ubuntu:/home/ubuntu#
The above show the raw disk sdb has no partition to start with and took 8047.02 seconds, at a rate of 62.1 MB/s transfer rate, to copy 500Gb. The first command "sudo su" is to become a super user, having the root privilege, in a Live CD. The command "fdisk -l" is for checking the disks' partitions. The whole cloning process is done by one line command of " dd if=/dev/sda of=/dev/sdb bs=32768".
Both disks have an identical size of 500107862016 bytes. Since I specified each block size of 32768 bytes in each transfer (by the bs=32768) I therefore should have 15262080.75 records to be shifted. This matches exactly the number of records read and written by dd, which reported 15262080+1 records as the last one was not a complete record.
The partition table after the cloning is
Code:
root@ubuntu:/home/ubuntu# fdisk -l
Disk /dev/sda: 500.1 GB, 500107862016 bytes
255 heads, 63 sectors/track, 60801 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot Start End Blocks Id System
/dev/sda1 1 12158 97659103+ 17 Hidden HPFS/NTFS
/dev/sda2 * 12159 24316 97659135 7 HPFS/NTFS
/dev/sda3 24317 36598 98655165 5 Extended
/dev/sda4 36599 60801 194410597+ 83 Linux
/dev/sda5 24317 24438 979933+ 82 Linux swap / Solaris
/dev/sda6 24439 25654 9767488+ 83 Linux
/dev/sda7 25655 26870 9767488+ 83 Linux
/dev/sda8 26871 28086 9767488+ 83 Linux
/dev/sda9 28087 29302 9767488+ 83 Linux
/dev/sda10 29303 30518 9767488+ 83 Linux
/dev/sda11 30519 31734 9767488+ 83 Linux
/dev/sda12 31735 32950 9767488+ 83 Linux
/dev/sda13 32951 34166 9767488+ 83 Linux
/dev/sda14 34167 35382 9767488+ 83 Linux
/dev/sda15 35383 36598 9767488+ 83 Linux
Disk /dev/sdb: 500.1 GB, 500107862016 bytes
255 heads, 63 sectors/track, 60801 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot Start End Blocks Id System
/dev/sdb1 1 12158 97659103+ 17 Hidden HPFS/NTFS
/dev/sdb2 * 12159 24316 97659135 7 HPFS/NTFS
/dev/sdb3 24317 36598 98655165 5 Extended
/dev/sdb4 36599 60801 194410597+ 83 Linux
/dev/sdb5 24317 24438 979933+ 82 Linux swap / Solaris
/dev/sdb6 24439 25654 9767488+ 83 Linux
/dev/sdb7 25655 26870 9767488+ 83 Linux
/dev/sdb8 26871 28086 9767488+ 83 Linux
/dev/sdb9 28087 29302 9767488+ 83 Linux
/dev/sdb10 29303 30518 9767488+ 83 Linux
/dev/sdb11 30519 31734 9767488+ 83 Linux
/dev/sdb12 31735 32950 9767488+ 83 Linux
/dev/sdb13 32951 34166 9767488+ 83 Linux
/dev/sdb14 34167 35382 9767488+ 83 Linux
/dev/sdb15 35383 36598 9767488+ 83 Linux
root@ubuntu:/home/ubuntu#
I have a XP at sda1, Vista in sda2, sda5 a swap and sda6 to sda15 each has a Linux inside.
The terminal commands are marked in red. The last partition table of disk sdb shows a mirror image of the former disk sda.
For some reason all 500Gb disk of Seagate, Western Digital and Samsung all have the same number of sectors, making cloning a trouble free operation.
I also enclose the buffered read speed of sda (a Sata II) and sdb (a Pata ATA133)
Code:
root@ubuntu:/home/ubuntu# hdparm -tT /dev/sda
/dev/sda:
Timing cached reads: 8712 MB in 2.00 seconds = 4360.12 MB/sec
Timing buffered disk reads: 198 MB in 3.02 seconds = 65.60 MB/sec
root@ubuntu:/home/ubuntu# hdparm -tT /dev/sdb
/dev/sdb:
Timing cached reads: 8658 MB in 2.00 seconds = 4333.50 MB/sec
Timing buffered disk reads: 214 MB in 3.00 seconds = 71.22 MB/sec
root@ubuntu:/home/ubuntu#
My motherboard see the eSata as a SCSI disk and has it detected first and the Pata disk second.
-------------------------------------------
Edited 20/10/07
I am editing this thread with the Vista in the Pata disk. This Vista is the third clone. I originally installed it, same as XP and 10 Linux in an internal 500Gb (Western Digital) Sata II disk.
I first clone the internal 500 Gb Sata to an external eSata disk (a Seagate Sata II disk physically outside the PC and connected to the eSata port of the mobo). That operation took 9134 seconds at 54.8MB/s. I use Slax a Linux inside the internal disk for cloning.
I then powered down, remove the internal Sata and boot up the eSata as the only disk in the system. The Bios had to select the eSata to boot as it is the only hard disk in the system. All the OSes work as expected.
I then powered downed, add a raw Pata disk (as described at the beginning of this thread) as an internal disk, boot up a Ubuntu Live CD and to clone all the OSes from the eSata back into the internal Pata disk.
I always use mobile racks for my hard disks so pulling one out and insert another in take only a few second.
As I reported in the thread Vista on rebooting first time in the new enviroment immediately discovered its recorded hard disk serial number and details no longer match the newly found hard disk. It reported the new hardware found and demanded an immediate reboot to effect the change. After the reboot everything is back to normal. The activated copies of Vista and XP have been preserved through the two successive cloning processes and in different disk types.
The disk-to-disk cloning by Linux dd command has not produced a single failure in my experience, regardless the number and the type of operating systems I have in the source disk. It works like a clockwork.
----------------------------
Edited 21/10/07
The effect of cloning XP & Vista from
Internal Sata II --> External eSata II --> Internal Pata --> External USB Pata
As a demonstration how easy cloning in Linux dd I cloned the 3rd copy from the internal Pata, as mentioned in the above, to an external USB Pata disk which is a 500Gb Seagate Barracuda (exact size as the others 500Gb disk).
The operation took 27,452 seconds at 18.2MB/s. This is 7.625 hours and took 3.41 times longer. The reason is because from the 2nd to 3rd copies the cloning was done between two internal disks. Between the 3rd and 4th copies one disk is an external hard disk bottlenecked by the USB2.
The Vista and XP did not boot and reboot every time if I try. The 10 Linux only 3 boot successfully while the others report "kernel panic - not syncing". This is expected because Linux installed originally installed in an internal hard disk may not be suitable for booting from a USB port.
So what I gain from wasting 7.625 hours of computer time (during which time I took the wife to watch a movie and had dinner)-----> I removed the hard disk from the USB enclosure, put it into a caddy, inserted it into the mobile rack, powered up the PC and found XP and Vista bootable again.
Last edited by saikee; 10-21-2007 at 05:19 AM.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
|