dd cloning of whole disk


 
Thread Tools Search this Thread
Operating Systems Linux Ubuntu dd cloning of whole disk
# 1  
Old 07-26-2012
Data [solved] dd cloning of whole disk

I am using 'dd' to clone an entire hard drive which only has Ubuntu 11.10 and some data with no special options. The disks are both 1Tb, However, I did re-partition the target disk with gparted successfully. The new partions are not the same size as the source disk. When starting 'dd' no partitions were specified in the target. e.g.
Code:
sudo dd if=/dev/sdc of=/dev/sda

Normally this would take no more than an hour using WD Acronis software, but this does not produce a bootable disk.
'dd' has now been running for seven hours without any apparent progress. When should I stop it please?

Last edited by methyl; 08-03-2012 at 09:36 PM.. Reason: please use code tags. Removed English punctuation from command line.
# 2  
Old 07-26-2012
The default block size of dd is 512 bytes. Try using bs=1M for example. The optimum value differs per system
# 3  
Old 07-26-2012
dd doesn't print progress output while running unless asked. If your disk light's flashing, it's not done.

If you're running Linux, you have gnu dd, which will print progress statistics when you give it SIGUSR1.

Code:
kill -USR1 pid

A terabyte disk could take a good number of hours, easily. I never did manage to get a 1.5T RAID mirroring done the same workday I started it. Don't give up yet. Sleep on it, and it'll probably be done in the morning.

Last edited by Corona688; 07-26-2012 at 02:32 PM..
These 2 Users Gave Thanks to Corona688 For This Post:
# 4  
Old 07-26-2012
Some implementations of dd will print progress information when they receive SIGINFO (a non-standard signal not supported on all platforms). Check your documentation and/or run a test with another dd (perhaps reading from a neverending file to an unfillable sink):
Code:
dd if=/dev/zero of=/dev/null bs=1

From another terminal, grab the pid (make sure it's the correct instance of dd), and send the signal.
Code:
kill -INFO pid

If dd prints progress info without dying, then you can use it safely on your long-running dd.

Or, if you're the daring sort, just kill your long-running dd with kill -INT pid. Before exiting, it will print the number of bytes written. You can then resume with the larger blocksize suggested by Scrutinizer, using the skip and seek operands (you'll have to do a little arithmetic to figure out how many complete new-size blocks were written and need to be skipped in both the source and target).

If the blocksize uses a suffix (in 1M, that would be the letter M), be very careful to use the correct multiplier. M is usually 2^20 bytes (1,048,576), not 10^6 (1,000,000). Similar traps await at other magnitudes (kilo, giga).

Are you feelin' lucky? Smilie

Regards,
Alister

---------- Post updated at 02:00 PM ---------- Previous update was at 01:51 PM ----------

Quote:
Originally Posted by Corona688
If you're running Linux, you have gnu dd, which will print progress statistics when you give it SIGUSR1.
I don't use Linux much, but that's good to know. Thanks. If the system supports it, it responds to SIGINFO as well (which is the signal used by *BSD dd).

Quote:
Originally Posted by Corona688
Don't give up yet. Sleep on it, and it'll probably be done in the morning.
Probably the wisest choice for now.

Regards,
Alister
This User Gave Thanks to alister For This Post:
# 5  
Old 07-27-2012
Data Update init missing

Thank you all for your various and helpful suggestions. Eventually I decided to terminate late yesterday. I used GUI sys monitor and found all processes were sleeping. I entered 'kill -9' in terminal and tried to boot from the clone, unsuccessfully. Since then the disk has been declared healthy and without errors several ways and times.
I find the partition structure is the same as the original disk. Un-importantly, all my pre- partitioning has been lost. So, trying to boot with only the clone connected and going to recovery mode the following prints:-
Code:
Target filesystem doesn't have requested /sbin/init
No init found Try passing 'init= bootarg'

(bootarg does not appear in the list of commands in the provided help option and did not succeed).

This follows
Code:
'BusyBox v.1.18.4 (Ubuntu 1:1.18.4-2ubuntu2) built-in shell (ash)
Enter 'help' for a list of builtin commands'.

initramfs[prompt]

I feel that I am close to succeeding in producing a bootable disk, but why does 'dd' not return a prompt, or any message when finished. What please did I omit from the original syntax and also please what actions are necessary now to proceed to recover?? Smilie

Last edited by methyl; 08-03-2012 at 09:34 PM..
# 6  
Old 07-27-2012
dd does return to a prompt -- you got impatient and killed it before it could finish.

It also prints statistics when it finishes, at least the GNU linux version should.

Next time, at least try the kill -USR1 trick so you can measure how much progress it's made?

You can also try the dd_rescue command if you have it, which does print progress information, and defaults to a sane block size.

Code:
dd_rescue input_device output_device


Last edited by Corona688; 07-27-2012 at 12:51 PM..
# 7  
Old 07-27-2012
Thanks for your opinion. The 'dd' results were returned although I didn't record the number of bytes copied, but it was vast. Today I have re-read 'usr1 kill recommendation and have made a definite note to use it next time. Thanks again. However, the process was clearly marked as 'sleeping' and I took that to mean that it was complete.
By the way - this not a GNU version so far as I can tell. It is Ubuntu 11.10.
'man dd_rescue' produces 'no manual entry'.
I really am very grateful for the trouble that you have taken. RoySmilie

Last edited by methyl; 08-03-2012 at 09:39 PM..
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. Linux

Disk cloning ?

Dear All I needed to clone my disk to another hard drive . I did it as the following : #dd if=/dev/sdb of=/dev/sdc But after a while, the procedure ended with the "writing to /dev/sdc input/output error" message. Can you please let me know how can I overcome this as the fdisk now returns as "... (1 Reply)
Discussion started by: hadimotamedi
1 Replies

2. HP-UX

HP-UX server cloning

Hello Friends, Am in requirement to clone a Live HP-UX server here's details OS: HpUX B-11.11 with mirrored LVM disks . S/ws: Remedy, XML engine, Annoysystem, Oracle All Oracle, XMl and Remedy data is on SAM LUN which is used for clustering . My requirement to create a clone server and... (10 Replies)
Discussion started by: Shirishlnx
10 Replies

3. Shell Programming and Scripting

Cloning

Hi, Is there disadvantages if we do AIX Serevr cloning to the new AIX server. Thanks in advance (0 Replies)
Discussion started by: kmsekhar
0 Replies

4. Filesystems, Disks and Memory

Automated disk cloning

Hi, I'm running Ubuntu on my laptop. To keep my data safe and easy disaster recovery as well I bought similar HDD to one installed in my laptop with higher capacity and using USB box I'm doing disk clone to it. So at any time I can replace disk and carry on with my work as before. I'm trying... (2 Replies)
Discussion started by: uvaio
2 Replies

5. Solaris

Problem by cloning boot disk.

Hello guys! I use the Solaris 10 x86 machine. I need to clone the boot disk. Why, when I copy slice 1 - there is a following: # ufsdump 0f - /dev/rdsk/c0d0s1 | (cd /mnt && ufsrestore rf - ) DUMP: Warning - super-block on device `/dev/rdsk/c0d01` is corrupt - run fsck Dump: The Entire... (6 Replies)
Discussion started by: wolfgang
6 Replies

6. Red Hat

cloning a server

I wish to clone a RedHat EL5 server. What's the easiest way to do this? Thanks :) (4 Replies)
Discussion started by: wazzu62
4 Replies

7. Solaris

Disk cloning using ufsrestore

I am using ufsdump and ufsrestore to clone the root disk on one of my servers. I would like to automate this as much as possible, but have run into a problem where it prompts for changing the owner/mode when it is complete. Any ideas for running this in the background and not being prompted? ... (4 Replies)
Discussion started by: patricko0317
4 Replies

8. HP-UX

Hpux Disk Cloning

hello, Anybody that has already running script or command that can disk clone the hpux machine thanks (2 Replies)
Discussion started by: eykyn17
2 Replies

9. SCO

Disk cloning

Hello everybody, :confused: I have to change the system disk on an old PC running SCO 5.0.5. The disk is up and running, this is a preventive action. My experience on UNIX is very limited and I look for the easyest solution to clone this unit. Is it possible with commands or through a clone... (2 Replies)
Discussion started by: mhachez
2 Replies
Login or Register to Ask a Question