LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 05-02-2009, 10:09 AM   #1
dw85745
LQ Newbie
 
Registered: May 2009
Posts: 6

Rep: Reputation: 0
Clone Win XP and monitor progress -- Knoppix


Just tried cloning Win XP, SP3 to drive of same size and cloned drive failed to boot. Used:

Code:
dd if=/dev/hda bs=10k of=/dev/hdb bs=10k

===================

Questions:

1) Does the boot size (bs) have to be anything special for XP
(e.g. 512, 1024, etc.)?

2) Any way to monitor the cloning process (e.g. progress bar or counter)?
How should my "dd" string be modified?

3) Can't believe "dd" didn't work. Am I missing something?

Thanks
David
 
Old 05-02-2009, 11:09 AM   #2
tmerriam
Member
 
Registered: Dec 2008
Distribution: slackware
Posts: 50

Rep: Reputation: 16
I'm not too sure that bs field is correct. For 512 bytes, it would just be 512. You don't need to have it twice either.
 
Old 05-02-2009, 11:47 AM   #3
malekmustaq
Senior Member
 
Registered: Dec 2008
Location: root
Distribution: Slackware & BSD
Posts: 1,614

Rep: Reputation: 440Reputation: 440Reputation: 440Reputation: 440Reputation: 440
dw85745:

"dd if=/dev/hda bs=10k of=/dev/hdb bs=10k"

You don't need to specify the block size twice, you may specify it only as the last argument in the code to make thing simple. Also, if you want to be sure at getting your MBR chunk at one time shot you may reduce your blocksize to 512. Try this code:

dd if=/dev/hda of=/dev/hdb bs=512

Before redoing your dd, to check if your boot record works under the new drive you may try copy it only and test the drive if it boots. Do this:

dd if=/dev/hda of=/dev/hdb bs=512 count=1

this will copy only the booting sector into the image. Test boot it after doing that.

========
1) Does the boot size (bs) have to be anything special for XP
(e.g. 512, 1024, etc.)?

Ans: No nothing special.

========
2) Any way to monitor the cloning process (e.g. progress bar or counter)?

Ans: I have not known yet with "dd" command, but certainly it will return the number of blocks copied in and out in the end, so there's nothing to worry about.

There was a chance that in the previous cloning process you might have inadvertently interrupted the process thus the program may have accidentally responded too committing error in the copying. So to make sure, dd it again this time with a smaller bs=512, anyway, you won't be charged for anything doing that.

========
How should my "dd" string be modified?

Ans: Try omitting the "bs" block size before the "of" line, to eliminate suspicion.

========
3) Can't believe "dd" didn't work. Am I missing something?

Ans: Try and retry, this is the spirit of learning.

Hope this helps.

Malek Mustaqiim

Last edited by malekmustaq; 05-02-2009 at 12:34 PM.
 
Old 05-02-2009, 12:36 PM   #4
johnsfine
LQ Guru
 
Registered: Dec 2007
Distribution: Centos
Posts: 5,286

Rep: Reputation: 1181Reputation: 1181Reputation: 1181Reputation: 1181Reputation: 1181Reputation: 1181Reputation: 1181Reputation: 1181Reputation: 1181
I recently tried to clone a hard drive. I used

dd if=/dev/sda of=/dev/sdb bs=4096 conv=notrunc,noerror

I got my information from this post, which is clearer than the dd man pages
http://www.linuxquestions.org/questi...06#post1848006

From that documentation, I got the idea "notrunc" was required for cloning drives or partitions. No one in this thread today mentioned that. Did I misunderstand, or is it required?

I used noerror, because my source drive had two unreadable sectors and I want to just display warnings and go on, rather than abort on those failures.

The process failed. It didn't copy the mbr. I think it copied everything else. I still don't understand why. Could it be some hardware anti virus kludge in the Dell motherboard? It's not my machine. The coworker I was helping decided to give up on the whole cloning idea and do something else, so I wasn't able to investigate the issue further.

For the OP here, I'm pretty sure any multiple of 512 bs will work about the same. A big size is an important performance factor when cloning partition to partition on one disk, but it shouldn't matter much for disk to disk.
 
Old 05-02-2009, 06:19 PM   #5
dw85745
LQ Newbie
 
Registered: May 2009
Posts: 6

Original Poster
Rep: Reputation: 0
Thanks all for input.

johnsfine.

Code:
dd if=/dev/sda of=/dev/sdb bs=4096 conv=notrunc,noerror
Had read the post you linked to and was going to give it a try.
Based on your note -- The process failed. It didn't copy the mbr -- helps somewhat. I noticed your bs=4096.

My understanding of dd is that "bs=" may be critical as have seen some post where performance can increase / decrease significantly based on block size. Larger not always better.

Copy XP MBR seems to be the BIG problem. My understanding dd is a byte for byte copy, but maybe XP requires MBR to being at certain point and this varies by disk (just a thought, not a solution).

If I find one (solution) will post this thread.

Last edited by dw85745; 05-02-2009 at 06:20 PM.
 
Old 05-02-2009, 08:08 PM   #6
johnsfine
LQ Guru
 
Registered: Dec 2007
Distribution: Centos
Posts: 5,286

Rep: Reputation: 1181Reputation: 1181Reputation: 1181Reputation: 1181Reputation: 1181Reputation: 1181Reputation: 1181Reputation: 1181Reputation: 1181
Quote:
Originally Posted by dw85745 View Post
Had read the post you linked to and was going to give it a try.
Based on your note -- The process failed.
I hope you tried it anyway. What happened to me may be very specific to the system I was on. In fact I've done this before, getting instructions from the same source and got it to work. That just wasn't recent enough for me to be sure the command was the same as the one that failed on my one recent attempt. I think it was the same.

Quote:
Copy XP MBR seems to be the BIG problem. My understanding dd is a byte for byte copy, but maybe XP requires MBR to being at certain point and this varies by disk (just a thought, not a solution).
The MBR is in the same sector with the beginning of the partitioning data. XP does not put it in a different place.

There are lots of possible reasons for a boot failure. Don't assume that was the MBR. I used gparted to see.

After changing the partition table outside gparted, I'm not sure what it takes to get gparted to see the new partition table. I tried rebooting the whole liveCD, because I wasn't sure I didn't need that. But I don't believe I needed that. Anyway, gparted never saw the partition table on sdb that dd should have copied from sda. That's why I thought the MBR sector had not been copied.

Last edited by johnsfine; 05-02-2009 at 08:11 PM.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Wine and InDesign - can I clone the install from a Win workstation? utahnix Linux - Software 6 02-15-2008 05:19 PM
TV and Monitor clone display tungaw2001 Linux - Software 4 07-10-2006 10:40 PM
dual boot Linux/Win HD clone rdrs Linux - Software 2 08-22-2005 10:50 PM
clone X session into a second monitor rbirmann Linux - Hardware 0 08-06-2004 01:27 AM
Tv out, clone the monitor to the TV ludeKing Linux - Hardware 1 05-26-2004 05:26 AM


All times are GMT -5. The time now is 04:25 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration