dd cloning of whole disk


 
Thread Tools Search this Thread
Operating Systems Linux Ubuntu dd cloning of whole disk
# 15  
Old 08-23-2012
ddrescue unsuccessful

OK so I have now tried ddrescue.

The following was the syntax that I used in the Ubuntu Remix version of live CD Ububtu 12.04 (my present OS is 11.10):

From the command line on the live CD 'sudo lshw -short -c Disk' to determine the input and outputs: source '/dev/sdb output /dev/sda'

Then 'sudo ddrescue -f -g /dev/sdb /dev/sda 23-08-2012.log'

After about ten minutes(and whilst I was on the telephone) the screen suddenly went blank followed by 'no signal'. Up to then it had been reporting progress. From then the red light remained on for more than an hour. I left it to carry on. After three hours the light had dimmed and it was possible to get the screen back. The results reported that it was finished and a lot of bytes processed. I am currently searching for the log file.

The result was that the input disk was unchanged as I would hope, but so was the target disk. So nothing was achieved.

The target disk had previously been cloned with 'dd'. I bowed to the weight of the recommendations received here, to try ddrescue. SO WHAT HAVE I DONE WRONG PLEASE!!
Smilie
# 16  
Old 08-23-2012
Quote:
Originally Posted by Royalist
After about ten minutes(and whilst I was on the telephone) the screen suddenly went blank followed by 'no signal'.
That sounds like the console screen-saver. Hitting the ctrl-key (or any other dead-key) should have brought it back.
Quote:
The result was that the input disk was unchanged as I would hope, but so was the target disk. So nothing was achieved.
I can't see anything obviously wrong with what you did.

But I can't see your computer from here, I don't know what you truly did, or even the circumstances. I don't even know what folder you were in for instance -- that may have had something to do with where the logfile went. Don't know how you booted the system -- hopefully sdb wasn't the disk you'd booted from? I don't know what way the program terminated -- there is a vast, important difference between 'lots of bytes' and 'all the bytes'... and such and forth.
# 17  
Old 08-24-2012
Quote:
Originally Posted by Corona688
That sounds like the console screen-saver.
Yes, having gained a little more experience of ddrecue, I now think that was the case.

Quote:
Originally Posted by Corona688
Don't know how you booted the system --
Booted from the Remix live CD which includes ddrescue.

Quote:
Originally Posted by Corona688
I don't know what way the program terminated --
I have since run it again and tried to change the '-f' option, but it wasn't having that as there was data already on the target.

Here is the returned result:

Initial Status (read from logfile)
rescued 0B, generated 0B,
Current Status
rescued: 264104MB, generated 1TB current rate:96206KB/s
Oppos: 1TB, average rate: 107MB/s
Finished

My intention now is to become more familiar with the Remix console and ddrescue. In particular to explore the path system for storing the log file in an umounted drive. I expect it just becomes part of the output file and is then written to the target as a whole. Also, I will re-examine the remaining options-perhaps I missed something obvious.
I do appreciate your help.
Regards Roy


---------- Post updated at 17:18 ---------- Previous update was at 08:36 ----------

I have come to the conclusion that ddrescue, or the Remix version if such, is incapable of writing an output to anything other than a completely fresh i.e. empty disk. Having put considerable effort and time into this. The -f option will not overwrite the data onto a healthy diskcontaining dataeven after a satisfactory completion.
I hope that it makes a better job of what is stated as it's primary purpose, but for simple disk cloning it is a no - no.
SmilieSmilieSmilie


Moderator's Comments:
Mod Comment Please edit you post to use the default Font Size

Last edited by Royalist; 08-25-2012 at 11:35 AM.. Reason: Moderato's request
# 18  
Old 08-24-2012
Quote:
In particular to explore the path system for storing the log file in an umounted drive.
What? Please...

Quote:
I have come to the conclusion that ddrescue, or the Remix version if such, is incapable of writing an output to anything other than a completely fresh i.e. empty disk.
I'm sorry, but this makes no sense. There's no difference between a completely fresh empty disk and a disk full of data, when you look at them as block devices as ddrescue does. And ddrescue works flawlessly.

You simply didn't get what's "-g" (or "--generate-logfile") for. True that the man didn't help you with too many words, I must admit. But please read here carefully:
GNU ddrescue Manual

With this "-g" option, ddrescue doesn't even try to copy: it tries to generate a logfile from a source and an already made (partial) copy.

Don't use the option "-g", and ddrescue will work for you. Smilie
HTH.
--
Bye
# 19  
Old 08-25-2012
Remix version of ddrescue

Thanks Lem - most interesting.

The Remix 'info ddrescue' is clearly very truncated and so I found your link most enlightening.

The one I previously read emphasises the need for a logfile and neither seem to tell how, or where to find the logfile. Nowhere, after numerous re-reads, is there any mention that using the '-g' option does not complete the job, but with the previously mentioned emphasis, it seems necessary to include the '-g' option. You seem to be telling me to make numerous passes to obtain these logfiles (just by appending <logfile*?> and to exclude the '-g' ??

dd does it all in only one pass.

I do hope that this makes sense to you. Your advice is much appreciated. Please note only 2 now -----> SmilieSmilie
# 20  
Old 08-25-2012
Ok, let's start from the beginning. Smilie

Quote:
SYNOPSIS
ddrescue [options] infile outfile [logfile]
To have a logfile, just use the optional [logfile] field.

For example (I think it's pretty self-explanatory):

Code:
# ddrescue -f /dev/sdx /dev/sdy /var/log/ddrescuelog

Just one pass. You're done.

About the "-f" option: ddrescue doesn't copy only from disk to disk: it copies from a standard file, a partition or a disk to a standard file, a partition or a disk. It can copy from a file to a partition, or from a disk to a file, or whatever you like. Now: if the destination is a device or a partition, so if it isn't a regular file, ddrescue will refuse to overwrite it without "-f" option: "it's for your own protection"(R). Smilie So you're right using it.

About the logfile: ddrescue is thought for situations where the origin is tipically a disk with some bad unreadable sectors. ddrescue task is to copy as much as possible, as quick as possible, with the least possible stress. But something won't be copied, usually. It won't be possible to read some sectors on the origin, and the corresponding sectors on the destination will be zero-filled. That's why a logfile is so relevant: to know what has been copied and what hasn't.
But you're using ddrescue just to clone a healthy disk, so your logfile (yes, have it, it won't harm) will be really tiny and not interesting.

About "-g" option: let's say someone used ddrescue to recover data from a failing disk and without a logfile (shame on him!). Now he has the origin, he has the (partial) copy, he hasn't got the logfile. Thanks God (well, thanks ddrescue) he can generate the logfile (well, an approximate logfile) even "ex post", with "-g" option: ddrescue -g origin alreadymadecopy /var/log/ddrescuelog. Of course this is not your case, so you're not interested at all in "-g" option, which makes ddrescue just compare an origin with a copy, and create a log about what has probably been done.

I hope we can get rid of those walls, now. Smilie
--
Bye
# 21  
Old 08-26-2012
MySQL ddrescue explained

Lem my sincere thanks. It had occurred to me last night, that dropping the -g would probably solve my particular problem, having read your earlier post.
It must be difficult writing a manual to suit all levels of users, but I have re-read again, some of it and can see no way that it explains all that I needed to know and that you have explained so well. By a process of trial and error, if prepared to spend copious amounts of time, I would probably have made it do what I needed, but I also need to understand all the implications of the use and the full capabilities of ddrescue.
In the manual for example there are several example command lines or functions having multiple lines. I still don't understand whether these are supposed to called individually (i.e. one at a time), or may be called simultaneously by the use of shift + return keys at each line end and executed with a final return key?
Nowhere, is there an explanation of how to state the path for the log file and surely only advanced users would know where it should be filed?
I haven't been using Ubuntu for a full year yet and at the age of 75, maybe I don't pick things up as readily as youngsters, but I am putting a lot of effort into mastering it all.
Your comments have been most helpful, you have clearly devoted considerable time to helping out.
If you find the time to answer my final queries, it will be great. Many thanks. ---> look no wall!
Roy Smilie
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