LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 10-11-2022, 09:50 PM   #1
wh33t
Member
 
Registered: Oct 2003
Location: Canada
Posts: 922

Rep: Reputation: 61
Talking Can I clone a whole drive to another drive using dd?


Lets say I have 3 drives in my computer.

Lets say I have a Linux OS installed on all three drives, if I boot into drive 1, can I use command line dd to verbatim copy drive 2 to drive 3?

Also, would this still be possible if the drives are external and USB?
 
Old 10-11-2022, 10:55 PM   #2
!!!
Member
 
Registered: Jan 2017
Location: Fremont, CA, USA
Distribution: Trying any&ALL on old/minimal
Posts: 997

Rep: Reputation: 382Reputation: 382Reputation: 382Reputation: 382
Identical size? Think about how dd works, and the block structure of a disk.
 
1 members found this post helpful.
Old 10-11-2022, 10:55 PM   #3
jefro
Moderator
 
Registered: Mar 2008
Posts: 21,982

Rep: Reputation: 3625Reputation: 3625Reputation: 3625Reputation: 3625Reputation: 3625Reputation: 3625Reputation: 3625Reputation: 3625Reputation: 3625Reputation: 3625Reputation: 3625
You might be able to.

Clone by dd is best when exact size drive and exact location is used.
 
1 members found this post helpful.
Old 10-11-2022, 11:37 PM   #4
wh33t
Member
 
Registered: Oct 2003
Location: Canada
Posts: 922

Original Poster
Rep: Reputation: 61
Yes, identical disk. I'll give it a go!
 
1 members found this post helpful.
Old 10-11-2022, 11:59 PM   #5
!!!
Member
 
Registered: Jan 2017
Location: Fremont, CA, USA
Distribution: Trying any&ALL on old/minimal
Posts: 997

Rep: Reputation: 382Reputation: 382Reputation: 382Reputation: 382
I don't understand the concept of:
Quote:
Originally Posted by jefro View Post
...exact [same?] location is used.
How can any two things be in the same location? Maybe you mean ?container? (like two people being in the same room)?

Probably something n00bME doesn't know about the other 98% of Linux or the other 99.99% of computer technology...
 
Old 10-12-2022, 12:00 AM   #6
Debian6to11
Member
 
Registered: Jan 2022
Location: Limassol, Cyprus
Distribution: Debian
Posts: 382
Blog Entries: 1

Rep: Reputation: 71
From what I remember reading some time ago, it was identical or bigger.
 
1 members found this post helpful.
Old 10-12-2022, 01:16 AM   #7
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 21,846

Rep: Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309
Quote:
Originally Posted by !!! View Post
I don't understand the concept of:


How can any two things be in the same location? Maybe you mean ?container? (like two people being in the same room)?

Probably something n00bME doesn't know about the other 98% of Linux or the other 99.99% of computer technology...
It means you copy from the beginning of the disk to the beginning of the disk. (so the copied data will be on the same location on the second disk).

Warning:
You cannot use both the original and the cloned disk in the same time, because the partitions will be identical. You might need to change uuids to make that work.
 
3 members found this post helpful.
Old 10-12-2022, 07:05 AM   #8
business_kid
LQ Guru
 
Registered: Jan 2006
Location: Ireland
Distribution: Slackware, Slarm64 & Android
Posts: 16,292

Rep: Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322
I tried cloning disks (32G USB key to 32G USB key) with 0% success.

First of all, they weren't exactly the same, stuff was in slightly different places and those slight differences. If you bought two of the same disks from the same place on the same day, you'd be fine.

Clone the partitions, & Use rsync
 
1 members found this post helpful.
Old 10-14-2022, 08:33 AM   #9
biker_rat
Member
 
Registered: Feb 2010
Posts: 369

Rep: Reputation: 220Reputation: 220Reputation: 220
rsync
 
Old 10-14-2022, 10:34 AM   #10
business_kid
LQ Guru
 
Registered: Jan 2006
Location: Ireland
Distribution: Slackware, Slarm64 & Android
Posts: 16,292

Rep: Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322
Quote:
Originally Posted by biker_rat View Post
rsync
Not that simple as it was a live usb. Normally, rsync is my tool of choice.
 
Old 10-14-2022, 11:10 AM   #11
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 21,846

Rep: Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309
rsync is not the ideal tool to clone a disk.
 
Old 10-14-2022, 03:34 PM   #12
jefro
Moderator
 
Registered: Mar 2008
Posts: 21,982

Rep: Reputation: 3625Reputation: 3625Reputation: 3625Reputation: 3625Reputation: 3625Reputation: 3625Reputation: 3625Reputation: 3625Reputation: 3625Reputation: 3625Reputation: 3625
dd has been used by many people but there are limits.
There are plenty of other ways to clone drives like clonezilla.

What I meant about position is that if you clone sdb to sdd you may have to move the cloned drive to sdb. There are some enterprise distro's that suggest you make a drive generic so that when you do clone it and use it you then change all the unique properties.
 
  


Reply



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
LXer: Open-spec SBC is a clone of a clone of a clone of a Raspberry Pi 3 LXer Syndicated Linux News 0 04-25-2018 04:56 PM
Linux 64 bit fresh install, created clone on cd, want to use clone on another laptop... apollo1980 Linux - Software 12 10-12-2017 02:59 PM
Encryption of the whole disk vs. a partition filling the whole disk taylorkh Linux - Security 5 09-19-2016 11:03 AM
I need to Clone a Red Hat drive and install clone in HP server drummer54 Linux - Newbie 14 03-07-2009 04:15 PM
clone the whole linux using rsync cccc Linux - Server 3 11-24-2008 03:41 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 01:06 AM.

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
Open Source Consulting | Domain Registration