-
02-15-2011, 10:18 PM
#166
Originally Posted by saikee
Your cloning with dd has failed in both cases.
Your source is 13Gb large and the target is 41.1Gb so a standard cloning will stop once the source is exhausted in reading.
However dd reported only
6190552+0 records in
6190552+0 records out
were processed. As the block was not specified so the default of 1 record= 512 byte would be used. 512 bytes times 6190552 is 3.17Gb. Therefore only part of the source was successfully cloned and the rest was missing.
Although the partition table is identical in both disks that is only because it came out from the first 512 bytes of sda and sdb.
My guess is you are using only partly cloned disk with the remaining 13-3.17=9.83Gb same as before. Thus that explains the funny behaviour of the Xp.
That never occurred to me, and it certainly make sense.
[snip]
Your sda hard disk has deteriorated to the extent that dd cannot read the entire disk in each attempt.
Although I still don't see any evidence that the source disk is going downhill (because Windows still runs Ok), I will take your word for it and have reinstalled Windows on a different HDD.
Thank you so much for taking the time to help me get a better grasp on what was going on. I still don't completely understand it and may someday tinker with dd again in order to gain a better understanding.
-
02-16-2011, 05:10 AM
#167
the command dd is actually very simple as it works with the hard disk directly by doing a sector by sector reading from a source and writing on a target disk.
It repeatedly claimed read/write error with sda after executing 3.1Gb and "stopped". Thus dd was unable to read the sda after this point.
Your Xp is likely to have been installed at the front end of the disk and could possibly work up to a certain point with only 3.1Gb.
You could mount the Xp in a Linux and try to extract as much information out as possible. It is likely the files beyond the first 3.1Gb area may report difficulties if they are accessed. Remember the problem here lies with the hard disk and Linux has a better ability in getting defective information out of it. The problem with Xp is that it only take one corrupted system file to stop it from booting up.
-
05-27-2011, 05:36 AM
#168
HD read/clone serial too
The whole cloning process with dd works well, But what can i do in case i need to read/write/clone the old hard disk serial of every partition ( cause from what i know with every new format the partition gets a new serial ) to the new hard-disk ? what is the process for that ?
-
05-27-2011, 09:22 AM
#169
biomecanoid,
Welcome to Justlinux!
Yes nowadays each partition is given a unique idenfication. I believe the protocol is an agreement between all the major operating systems and for the Linux it is call UUID whereas for the MS system it is called GUID. The same number is used in both systems except it is called by a different name. It is up to the operating system to generate it.
This number is used by some boot loaders and so it is cruisal that the boot loader can locate the correct partition to boot.
As dd duplicates faithfully each hard disk so you will end up with two hard disks having two set of identical UUID or GUID. This does not cause confusion as the system has already been booted and the boot loader is not in charge. Only if you reboot the system then the confusion would materialise.
In a correct procedure after cloning either the target or the source should be removed as there is no need to have both disks to confuse the operating system.
If by mistake both disks are present then the boot loader would simply boot up the first one it finds and this seems to be the case for both Linux and MS systems. The disk order dictates which disk get booted first.
However a MS Windows system, like Xp, is more interfering and it could de-activate the activation code resulting both copies of the MS Windows unable to run in a belief the system has been attacked. MS Windows do not know how to handle such a situation and so they may change the system files as a way to protect themselves. Linux doesn't bother the duplication.
In conclusion you don't need to do anything. Just remove one of the disk.
Remember the target is a 100% clone and works exactly as the source disk. I often put away the source for safe keeping as the backup and start using the clone immediately.
Last edited by saikee; 05-27-2011 at 09:26 AM.
-
06-06-2011, 11:30 AM
#170
Migrating Win XP to a different computer...
First, let me express my profound thanks to Saikee for his expertise and tireless dedication to helping fellow Linuxians! I'm a pro computer tech, and have used Puppy Linux and other distros for years to help deal with balky Window$ computers. But I work more through the GUI, and am less skilled with the commandline.
This description is for my attempt to migrate my (very complex) Win XP computer setup from an older machine to a newer one.
The old computer is a Dell Dimension 4400 and the newer one is a Dell Optiplex 745. The problem is that the old 'puter has a gazillion programs and special features installed. It would take weeks of work to reload everything.
While I have a good backup, (Acronis disk image), I want to clone the entire Windows setup to a new(er) computer, both for safety, and because the older hardware is getting a bit tired.
The older 'puter has only PATA drive capability, and the new one only handles SATA drives.
Luckily, I have an IDE/SATA to USB adaptor that I can use to hook up the new drive to the older computer.
I've already tested the new drive and its cables by doing a basic install of Window$ to it
from CD. The test install booted and worked fine, but whe I used Acronis True Image to
restore an image from the old computer to the new drive, it would not boot up, even though I could see the files under a Linux live CD boot, and checked to make sure the boot flag was set to 'on' on the new drive, using Gparted from the Puppy live CD. Windows starts to boot, and falls back to the all-too-familiar prompt that "Windows failed to start properly, do you want to boot in safe mode, safe mode w/networking..."
I also tried booting from an XP CD, using the recovery console, and trying 'fixmbr' and 'fixboot' commands - all with no joy.
Since Acronis wants $80-some dollars for the latest version, and the 'plus-pack' to allow
restores to dissimilar hardware, I want to try using the 'dd' command to make the drive clone.
My first question is - can I use Puppy Linux 5.25 to do this, or is there some difference in the Gparted packages included with it that would make it better to use the Gparted live CD?
I've successfully used the Puppy-included version of Gparted for other operations. Puppy 5.25 is based on a recent Linux kernel - I'm having a little difficulty finding which version, but I think it's in the neighborhood of 2.6.38.x.
My old hard drive has 3 partitions on it - Puppy sees them as sda, rather then hda, so they are sda1, sda2, and sda3. I also have a storage drive in the old computer that Puppy sees as sdb1. When I hook up the drive I want to clone onto, Puppy will see it as sdc1.
So, if I understand correctly, the 'dd' clone process should be very simple. The steps would be as follows:
1 - Hook up the new (SATA) drive to my old computer, using my IDE/SATA to USB adaptor.
2 - Boot the old computer from a Puppy Linux 5.25 CD. Likely any modern distro would work, but Puppy is my fave!
3 - Open a console window and type: dd if=/dev/sda of=/dev/sdc bs=32256.
4 - Allow the copy process to complete.
5 - Close the console window.
6 - Open Gparted and use it to resize the partitions. My old hard drive is 80 GB, and the new
one is 500 GB. If I erase all the partitions on the new (SATA) dive before copyng, I should
have a lot of (unformatted) space after the three copied partitions. If I understand
correctly, Gparted can 'slide' the three partions around and resize them, so I wind up with a bootable drive that has three partitions of (roughly) 160 GB each - which is my goal. Is there any advantage to formatting the new drive first? All the partitions I want to copy are NTFS. I doubt it would make any difference, but wanted to check.
7 - Reinstall the new (SATA) drive in the new computer, and (God willing) boot up happily.
Do I have it right? Thanks in advance for your help! And may I recommend Puppy Linux to all the users here? It's a GREAT distro - blindingly fast, tons of apps available, and great support from the Puppy forums. I would normally have posted my query there, but I was so blown away by Saikee's commandline skill that I wanted to pick his brains (grin).
In return, I'm an ex-audio engineer/studio builder,so if Saikee (or any of you) have audio
questions, feel free to email me at jhecht@ix.netcom.com. And please check out my book on audio wiring at http://www.amazon.com/Audio-Wiring-G.../dp/0240520068
More info about me on my home website - http://www.zenarrow.com.
-
06-06-2011, 08:37 PM
#171
jhecht,
Welcome to Justlinux!
Yes you got it right.
Here are a few pointers which may of interest to you.
There is no need to format or partition the clone. When the dd operation starts the sector cloned will be the MBR and therefore your target disk will immediately has the exact partition table as the 80Gb source disk. Thus all previous formatting and partitioning work bring no benefit. I often start with a raw disk immediately after the purchase.
You can use Puppy as it has dd command and allow you log in as root.
As I mentioned earlier your 500Gb disk will have only the first 80Gb filled and the rest is unallocated space.
You can move a data partition, one without a bootable operating system, freely to the left or to the right but not one with a system inside like sda1 which is a traditional place for a MS Windows Xp.
For a partition with Xp you can only expand the right hand side boundary. The left hand side has the boot sector its address is hard coded into the boot loader. Thus sda1 should not be moved but can be expanded unilaterally to the right if unllocated space has been created. If you do need to move a bootable partition you need to repair the boot loader and that is not a big deal.
The first time you boot the 500Gb clone you should have the 80Gb source disk disconnected so that the clone will take over the hardware position of the source disk.
Also when the clone is booted for the first time Xp will immediately knows the hard disk serial number no longer matches the record. It will demand an immediate reboot. After the reboot it will work normally forever. There is no need to reactivate.
The cloning should work perfectly but if it doesn't you can do it again. The most important bit of the whole process to is known sda is the disk to be read as this is the disk that will not get changed. If you are not sure do a
before the dd command. The sda1, sda2 and sda3 should have type 7 ID for NTFS filing system and the number of cylinders of the 80Gb disk is about 1/6 of the 500Gb disk which should be sdc as you have identified.
Gparted does Live CD which is a software specialised in partitioning. You will find its programs like fdisk, cfdisk etc most up to date. Other than that you can do everything with the Puppy Linux.
Lastly there is indicator for the progress of dd so you have to estimate the time it take. For internal hard disk dd does between 20 to 70Mb/s depending on the disk type and CPU. If one of the disk is via a USB2 then the transfer rate can drop to 10Mb/s.
I think I have done IDE to Sata disk before and so your 500Gb Sata should boot first time if the IDE disk is absent. Never put two exact copies of Xp together as it can confuse the MS operating system which can cancel the activation. The only time you can check them together is booting into a Linux.
One more point: I am not familiar with Dell's various models but my tutorial is for migrating the operating system from hard disk to hard disk and not to a different computer. Xp is hard ware dependent, as it needs different drivers for a different machine, and cannot be migrated from PC to PC unless the hardware are identical (same CPU, memory, Graphic card, network card etc). Migrating an operating system from PC to PC in general never work for the M$ systems (it is also illegal) but possible with desktop-based Linux and not server-based Linux. If you want to use the Xp license on the new PC you can do so by claiming the old PC no longer serviceable, removing from in the old PC and doing a new installation in the new PC.
Last edited by saikee; 06-06-2011 at 08:56 PM.
-
06-08-2011, 05:07 PM
#172
Saikee> Yes you got it right. Here are a few pointers which may of interest to you.
JH> High praise from a Grandmaster of the Linux commandline (grin).
_______
Saikee> There is no need to format or partition the clone...
JH> I had thought not from your earlier writing.
_______
Saikee> You can use Puppy as it has dd command and allow you log in as root.
JH> That's one of the things I like about Puppy - you ARE root by default. Saves time.
_______
Saikee> As I mentioned earlier your 500Gb disk will have only the first 80Gb filled and the rest is unallocated space.
JH> No problem - I've tested Gparted, and think I can do what I want - to slide the two NON-boot paartitions to the 'right' (in Gparted) then resize them to leave blank space after sda1. Since sda1 is the XP boot partition, I have to leave its start point anchored, but can expand it, if I have blank space on the 'right' in Gparted. Is that correct?
_______
Saikee> You can move a data partition, one without a bootable operating system, freely to the left or to the right but not one with a system inside like sda1 which is a traditional place for a MS Windows Xp.
JH> Let me try a little ASCII artwork here:
what the clone will start out like
|<:::::sda1:::::>|<:::::sda2:::::>|<:::::sda3::::: >|<::::unformatted::::>|
what I want to do
|<:::::::::sda1:::::::::>|<::::::::::sda2::::::::: :>|<:::::::::sda3::::::::>|
It seems like this should work - is that true?
_______
Saikee> For a partition with Xp you can only expand the right hand side boundary. The left hand side has the boot sector its address is hard coded into the boot loader. Thus sda1 should not be moved but can be expanded unilaterally to the right if unllocated space has been created.
JH> I think you're saying I can do what I want to do.
_______
Saikee> The first time you boot the 500Gb clone you should have the 80Gb source disk disconnected so that the clone will take over the hardware position of the source disk.
JH> But I will never boot the clone on the older (parent) computer. I can't, as the new drive is SATA, and the old computer is PATA (IDE) only. Instead, I'll disconnect the IDE/SATA to USB adapter, and re-install the SATA drive in the newer computer where I want to use it.
_______
Saikee> The most important bit of the whole process to is known sda is the disk to be read as this is the disk that will not get changed. If you are not sure do a
Code:
fdisk -l
before the dd command. The sda1, sda2 and sda3 should have type 7 ID for NTFS filing system and the number of cylinders of the 80Gb disk is about 1/6 of the 500Gb disk which should be sdc as you have identified.
JH> Um, yes - since the 'dd' commmand has NO safety precautions, one could wipe the wrong drive in a heartbeat if you got the syntax wrong! Powerful tools are frequently dangerous... With Puppy, any active drives are displayed at bootup with their Linux drive designations. The only oddity is that hda drives display as sda even though they are not SCSI drives. So a newbie could click on a drive to mount/open it, and see what files are there. Your commandline code gives other info. Good to know both and enjoy options.
_______
Saikee> Gparted does Live CD which is a software specialised in partitioning. You will find its programs like fdisk, cfdisk etc most up to date. Other than that you can do everything with the Puppy Linux.
JH> Interesting - I know Gparted as a proggie but was not aware of the live CD option. Does it have any disk tools that are not included in modern Linux distros?
_______
Saikee> Lastly there is indicator for the progress of dd so you have to estimate the time it take...
JH> Here I think you meant "...there is NO indicator for the progress..." from your other postings in this thread. Might it be possible to create an option for the 'dd' command to 'show progress'? That's a question all for you 'nix programmers.
_______
Saikee> I think I have done IDE to Sata disk before and so your 500Gb Sata should boot first time if the IDE disk is absent. Never put two exact copies of Xp together as it can confuse the MS operating system which can cancel the activation. The only time you can check them together is booting into a Linux.
JH> Understood - but I never expect to have both drives hooked up at once, except under Linux.
_______
Saikee> One more point: I am not familiar with Dell's various models but my tutorial is for migrating the operating system from hard disk to hard disk and not to a different computer.
JH> TRUE - but I think MANY people will want to do what I want; to keep an existing XP install, and migrate it, along with ALL the installed programs and features, over to newer hardware. Yes, there will be some drivers to replace/add - but that part's easy - see the next section.
_______
Saikee> Xp is hard ware dependent, as it needs different drivers for a different machine, and cannot be migrated from PC to PC unless the hardware are identical (same CPU, memory, Graphic card, network card etc).
JH> Totally true - but very easy to fix. Dell has all the drivers I need for the newer computer hardware online. I have already downloaded them and have them ready to install. In fact, I already tried installing them, when I set up a generic XP boot on the new computer to test all the hardware. They went in fine - so drivers? No problemo!
_______
Saikee> Migrating an operating system from PC to PC in general never work for the M$ systems (it is also illegal) but possible with desktop-based Linux and not server-based Linux.
JH> Acronis True Image BackUp runs on IsoLinux - a distro I don't know. But Acronis can multi-cast from a server, AFAIK. You just have to tell it where the new drivers are located and Acronis TIB will 'slipstream the drivers into the multicast. Ghost 4 Linux (another live CD) can also multi-cast. Legal? I want to take one (1) complete XP install and clone it to newer hardware.
Once I am confident that the new setup is OK, I'll pull the drive from the old computer, and make it into a happy Puppy Linux computer. I own both computers, the COA stickers, and one set of Dell install CDs. If Bill Gates and the Piracy Police don't like my moving 1 'seat' from computer A to computer B, they can kiss my Linux-lovin' drainpipe!
_______
If you want to use the Xp license on the new PC you can do so by claiming the old PC no longer serviceable, removing from in the old PC and doing a new installation in the new PC.
JH> I'm more than happy to $#@! at M$ $upport, but let's wait and see if I have to. However, in my vocabulary, a Windows 'install' would typically be a 'clean' install - which is exactly the thing I'm trying to avoid by using the 'dd' command. I don't just want to copy Windows - I want to copy a very complex setup with dozens of installed programs, macros & hotkeys up the wazoo!
Thanks again for your help Saikee! Maybe you should split off this thread and re-title it - "Migrating from old to new computer" or some such title? That way people who want to do this particular process will know where to look.
-
06-08-2011, 06:56 PM
#173
jhecht,
From my experience you should end up with a brick wall unless the two PC are so much similar. Xp protects itself by recording each hardware by a point system. If the changes are significant and breach the pre-set threshold the XP will lock itself up. Let us know how you get on.
Yes I meant dd gives no indicator.
hda to hde were assigned to IDE hard disks but later kernels now call all SCSI/IDE/Sata/USB flash drives sda, sdb, sdc etc. The changeover was done with kernel 2.6.20 since Sep 07. Only older kernel or servers distros would hang on the hda/hdb/hdc/hde device names for compatibility reasons.
I confirm your expansions of sda1, sda2 and sda3 would be acceptable as sda1 is anchored at the left side.
Gparted and Parted Magic do Live CD. They are just like a normal Linux distro but have the best or more complete collection of partitioning tools.
Lastly if you are not already aware M$ has a back door installed in Xp so that whenever you log into the Internet your Xp will report to M$ with all your registries in the PC. If your Xp locks you out you can call M$ and they can unlock it via the Internet. Therefore you should never run the same license on more than one computer. If it works initially it can still suddenly drop dead one day leaving you to think it is a cyber attack. It is possible that M$ do not honour the correct updates if they know the copies are illegitimate making them vulnerable to attacks. If you run only one license you are protected by M$ with all its updates. Without the correct updates Xp is as good as death!
Last edited by saikee; 06-08-2011 at 07:01 PM.
-
08-13-2013, 08:25 AM
#174
wow thanks this is awesome !!!
-
01-16-2017, 10:53 AM
#175
(1) Best way is to use a Linux Live CD, any one would do.
(2) Boot up the Linux Live CD and mount sdc1 which will become a different device if the original sdb is withdrawn. Edit it /etc/fstab to reflect the new partition referece of the swap and the root partition of the Linux. Forget about the UUID as you can survive without it.
Last edited by essay; 01-05-2018 at 03:42 AM.
-
04-13-2017, 04:11 AM
#176
Will the Linux LiveCD DD function recognise this hidden partition? I'm assuming so thus far, as you have stated that the process is simply cloning '1's and '0's, but need to be sure.
-
11-09-2017, 11:01 AM
#177
Hi! Saikee and every one else, Saikee i have used the dd command as you showed us a few years ago to clone a few hard drives, one was windows Millenium and the other was Linux.
I would like to clone a windows 8 and was wondering if the command has to be modified since this a 64x system, newer, etc.
Thank you for your time
nuttron
3 Slackware12.1 and 1 Debian Squeeze (3 puters), purring
-
11-10-2017, 10:40 AM
#178
well,well, i think i should have posted in the technical section-forum, will do
3 Slackware12.1 and 1 Debian Squeeze (3 puters), purring
-
02-15-2018, 08:03 PM
#179
nuttron,
dd reads and writes binary bits and doesn't care what operating system. 32 or 64 bits operating systems still binary-coded to "1" or "0" in the end.
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
|
|