How long dd 100gb
I've been out of the admin role for many years now, but I know that 'dd' is up to the job. I used this technique regularly in the late 80s on Sun Sparc and i computers. We installed on the first computer, configured the app, ran SunOS' sys-unconfig, placed the drive in a shoebox with a different SCSI address and then proceeded to 'dd' to the other 30 drives. As others have mentioned above, one of the gotchas with cloning a mounted file system is potential data corruption.
This obviously won't apply to full drive clones, but if you're using LVM you can Snapshot the LogicalVolume and dd from the snapshot to get a consistent image.
It's part of the ntfsprogs package. To compress the image using gzip, I use David Hick's excellent answer. The benefit is that I can then use 7-Zip to inspect the contents of the image without decompressing the entire archive.
That's made possible by the fact that xz supports random seeking, and that 7-Zip can interpret many file system types. Sign up to join this community. The best answers are voted up and rise to the top. Stack Overflow for Teams — Collaborate and share knowledge with a private group. Create a free Team What is Teams? Learn more. Using DD for disk cloning Ask Question. Asked 12 years, 6 months ago. Active 3 months ago. Viewed k times. Improve this question. Skyhawk 14k 3 3 gold badges 50 50 silver badges 93 93 bronze badges.
I'm aware how dd works, my question was more in the direction of any known problems related to dd when cloning disks as described by the link , maybe this wasn't very clear. What his answer contains and yours doesn't is "I've never once had any problems with it".
I did upvote your answer too, as you did definitely present some interesting points I like the one about no progress indication. Looks like you got the Spolsky Bump: joelonsoftware. It's ironic that Joel linked to the question as a good example of server-fault, although none of the answers were good.
There was not one answer among 25 excluding comments with the right dd options for skipping bad blocks - which is essential when cloning disks for recovery. This method will also save the unallocated part of a disk, if any. If you don't need it, you can tell it where to stop count parameter for dd , or pipe the data through head -c … for anything else; but I'm not sure how to find the exact number of bytes yet, or at least a good upper bound — Display Name.
Also note than most of the times, dd program is unnecessary. You can use head or cat for reading from a block device, and write to a regular file using a redirect. And you can write to a block device with tee. Then you won't have to guess a good block size, and it's likely going to be faster too.
And if the source disk is in bad condition, then dd isn't a really good option too, use ddrescue to save data from damaged disks instead. Show 3 more comments. Active Oldest Votes. Improve this answer. Izzy 2 2 gold badges 8 8 silver badges 25 25 bronze badges. Adam Gibbins Adam Gibbins 7, 2 2 gold badges 27 27 silver badges 42 42 bronze badges. Nobody seems to know this trick I've never experienced any issues with this method.
Good luck! Mistiry, that's not the meaning of the word symmetric. Show 13 more comments. To save space, you can compress data produced by dd with gzip, e. Fidel 1 1 gold badge 3 3 silver badges 17 17 bronze badges.
David Hicks David Hicks 2, 2 2 gold badges 14 14 silver badges 12 12 bronze badges. DD works on block devices, a level of abstraction lower than the file system, so it should, yes.
I haven't actually tried it, though. I suspect that sync is not the answer to file corruption problems. What happens if a deamon or something writes more files after the sync , during the dd operation? It's a good idea to umount the drive first or remount as read-only but it's not always possible — Alex Bolotov.
In which case, you use rsync and let it do file handle magic to get a consistent file and let Copy On Write semantics handle the incoming writes. Using rsync will ensure that the internal data in the destination filesystem is consistent. It will not ensure that the data in the files is consistent — to do that, you would need to lock the files and any programs that write to the files would need to respect these locks.
It is not block size, but buffer size and is not related to the block size of the media. I'm pretty sure the variable bs is referencing to block size, not buffer size. Could I use this method to dd a turnkey linux or other type of linux that is designed to work off of a usb drive, to a hardd drive or ssd? You saved me soooo thank you! I was seeing every sites talking about the complexity of cloning a drive, others tells to use a paid software, others tells to use CloneZilla Again I thank you so much for these great explanations and examples, you've done a very helpfull job!
As others have said, dd has the ability to display progress so you could in theory remove the requirement of piping it through pv. You could do the same manually with the information provided out of dd's progress speed and amount completed but why compute something manually when passing it through pv is of very little cost a couple extra cpu cycles.
My big issue with the article that you should look to fix however is when changing the blocksize using bs and using pipes between "dd if" and "dd of". You should set try to set the block size on either side of the pipe to be the same size or larger on the write side.
Ideally you want to use the blocksize most efficient for your destination disk. GNU Linux safed my Windows ass This feature is only available to subscribers. Get your subscription here. Log in or Sign up. You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features.
Registration is quick, simple and absolutely free. Join our community today! Note that registered members see fewer ads, and ContentLink is completely disabled once you log in. Are you new to LinuxQuestions. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies. Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Click here for more info. Doing a complete backkup of one drive to another, creating a duplicate. Sign up to join this community. The best answers are voted up and rise to the top. Stack Overflow for Teams — Collaborate and share knowledge with a private group.
Create a free Team What is Teams? Learn more. Asked 9 years, 8 months ago. Active 6 years, 5 months ago. Viewed 85k times. Improve this question. Flimm Luis Alvarado Luis Alvarado k gold badges silver badges bronze badges. The duplicate question has a more updated answer. Garrett correct. Hence why this was marked as a duplicate of that one. Thank you.
0コメント