You are not logged in.
Hello,
When copying the disk with the OS on it to another equally sized disk with:
dd if=/dev/sda of=/dev/sdc bs=4096 conv=notrunc,noerror
Then a problem is that, possibly, during the 3 hours that this copy takes (for 1TB at 100MB/s), the disk sda may change due to other activity you're doing during the copy. So you end up with sdc having some combination of older and newer things, or maybe even a file that is half changed because it changed exactly during the time it was being copied.
So I should do this at night instead while not using the computer. But, the question is: could Linux still do activity that alters the disk while not using the computer?
Would KDE do stuff? When instead booting to terminal and no graphical desktop, are there then still potential things that might change the disk? What's the most reliable way of making an identical copy of your OS disk?
Reason: I discovered the disk in my desktop PC on which Linux is installed is compatible with a NAS I got, while an empty unused disk I have that I was planning to put in the NAS is not compatible with the NAS due to disk manufacturers putting crappy firmware on the disk on purpose to make you have to buy different disks for desktop and NAS/RAID. So I want to move everything of my desktop PC to the new disk so that I can use the old one for the NAS.
Thanks.
Offline
Is dd necessary?
https://wiki.archlinux.org/index.php/Fu … with_rsync
Offline
@ aardwolf, There is always a possibility of some data being modified, whether you are actively using the computer or not (for example cron scripts running). It is better if you do this from a live environment.
And, as karol said, rsync is the better tool for this job.
Last edited by x33a (2013-10-29 13:22:37)
Offline
I have actually two disks in my desktop, sda and sdb, and I want to copy sda to sdc. sda and sdc have the exact same size, and I want sdc to get the exact same bytes, MBR, etc... So I think dd is quite alright in this situation, right?
I want to copy disks, not copy "/" which is a combination of two disks and possible other mounted stuff...
Offline
Boot a liveCD / liveUSB, don't do it when booting sda.
Offline
I have actually two disks in my desktop, sda and sdb, and I want to copy sda to sdc. sda and sdc have the exact same size, and I want sdc to get the exact same bytes, MBR, etc... So I think dd is quite alright in this situation, right?
I want to copy disks, not copy "/" which is a combination of two disks and possible other mounted stuff...
Yeah, dd is fine in this situation.
Offline
I would summarize most of the advice here WRT dd as "Do not mount either the source or destination disks". This may mean boot from a live environment, or from an installed system on another drive, such as /dev/sdb.
But, (ewaller gets out his soapbox) BE VERY CAREFUL WHEN USING dd. These forums are riddled with tales of woe in which data were copied to the wrong destination, obliterating the critical data that had lived in that location. dd is a dangerous command. I speak from experience.
Nothing is too wonderful to be true, if it be consistent with the laws of nature -- Michael Faraday
Sometimes it is the people no one can imagine anything of who do the things no one can imagine. -- Alan Turing
---
How to Ask Questions the Smart Way
Online
Ok, I guess I will physically disconnect sdb (which is irrelevant to me here and should of course not accidently be overwritten), boot with a live cd, and, before using dd, look with smartctl at the manufacturer name of both disks to ensure I'm using the correct one as input and the correct one as output.
I hope my arch live cd has smartctl on it...
Offline
I hope my arch live cd has smartctl on it...
smartmontools should be included: https://projects.archlinux.org/archiso. … kages.both
Offline
Can i ask why somebody suggested rsync for this task instead of a simple cp -ax?
-edit
I did it one month ago without issues, and online.
to copy (say) sda to sdc, i first partitioned and formatted sdc with a partition scheme similar to sda.
then i mounted sdc:
mount /dev/sdc1 /tmp/sdc1
mount /dev/sdc2 /tmp/sdc2
mount /dev/sdc3 /tmp/sdc3
then i cpied:
cp -axv /boot/* /tmp/sdc1/
cp -axv / /tmp/sdc3/
...and so on
All is working right now
The pros over dd are that you can (moderately) do this online and is of course safer.
The cons over dd are that you have to install the bootloader
But again, why rsync in this case?
There is even the "--update" switch on cp...
Last edited by kokoko3k (2013-10-30 13:25:47)
Help me to improve ssh-rdp !
Retroarch User? Try my koko-aio shader !
Offline
Can i ask why use reync for this task instead of a simple cp -ax?
See note https://wiki.archlinux.org/index.php/Di … g#Using_cp
A bit OT, but can you verify the factual accuracy of 'As a cp alternative' section of https://wiki.archlinux.org/index.php/Tar ?
Offline
So, (is cp vs rsync here, not cp vs dd) seems to be all about this statement?
Also, it has been reported that even with the -a flag, some extended attributes may not be copied.
Help me to improve ssh-rdp !
Retroarch User? Try my koko-aio shader !
Offline