LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 01-25-2020, 07:05 PM   #1
Gregg Bell
Senior Member
 
Registered: Mar 2014
Location: Illinois
Distribution: Xubuntu
Posts: 2,034

Rep: Reputation: 176Reputation: 176
What's a simple, easy way to clone a hard drive?


I've got the connector cord to connect my main computer to the hard drive I want to clone it to. I'm using Xubuntu 18.04LTS, and I want to clone a 75GB (source) SATA hard drive to a 250GB (destination) SATA hard drive. I've read about Clonezilla and "dd" but it's still pretty confusing. Like what about MBR and stuff like that? Anyway, my question is, what's a simple, safe way to clone one hard drive to another so that the destination hard drive is absolutely identical to the source drive, and after the clone is complete, I can switch out the hard drives and the cloned hard drive will do everything the original one did. Thanks.
 
Old 01-25-2020, 07:26 PM   #2
frankbell
LQ Guru
 
Registered: Jan 2006
Location: Virginia, USA
Distribution: Slackware, Ubuntu MATE, Mageia, and whatever VMs I happen to be playing with
Posts: 19,330
Blog Entries: 28

Rep: Reputation: 6144Reputation: 6144Reputation: 6144Reputation: 6144Reputation: 6144Reputation: 6144Reputation: 6144Reputation: 6144Reputation: 6144Reputation: 6144Reputation: 6144
If you've got a cable connection and can mount both drives, you should not need to use Clonezilla.

Take a look at rsync.
 
1 members found this post helpful.
Old 01-25-2020, 07:36 PM   #3
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,130

Rep: Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121
Simplest - dd
Followed by clonezilla

All copiously documented. Will do what you asked, not necessarily what you might want. The rsync suggestion will require you to do some setup, which you appear dis-inclined to do.
 
1 members found this post helpful.
Old 01-25-2020, 07:38 PM   #4
vtel57
Senior Member
 
Registered: Jul 2006
Location: USA
Distribution: Slackware64 - 14.2 w/ Xfce
Posts: 1,631

Rep: Reputation: 489Reputation: 489Reputation: 489Reputation: 489Reputation: 489
Rsync is not necessarily simple for a not-so-experienced Linux user. However, it would be my choice. I rsync (mirror) my /, /home, and /archive partitions to a backup drive every Sunday morning.

The most important thing to remember with rsync is if you want a true bootable image of a drive, you must remember when setting up source and destinations to ALWAYS REMEMBER THE FULLOWING / on the source.

For example:

Source: /dev/sda1/
Destination: /dev/sdb1

If you forget the following / on the source, you'll end up with your entire backup being placed in a new directory on the backup drive rather than being an actual true mirror of the source drive.

An easy way to use Rsync to back up is to use a portable Linux (on a disk or USB stick) like Porteus. Within Porteus, you'll find the graphic version of rsync known as grsync. It looks like THIS. Very simple to set-up and operate.

Personally, I don't rsync my main system to my backup drive from within the active/booted main system. I prefer to use a portable Linux to mount and mirror the appropriate partitions using rsync.

Luck with it.

Last edited by vtel57; 01-25-2020 at 08:12 PM.
 
1 members found this post helpful.
Old 01-25-2020, 09:26 PM   #5
slackware-current
Member
 
Registered: Jun 2019
Posts: 60

Rep: Reputation: 6
dd if=/dev/you want to copy of=/dev/yopu want to send copy to.
https://www.linuxnix.com/what-you-sh...ux-dd-command/
 
1 members found this post helpful.
Old 01-25-2020, 10:42 PM   #6
Geist
Member
 
Registered: Jul 2013
Distribution: Slackware 14 / current
Posts: 442

Rep: Reputation: 196Reputation: 196
Imho, the scare factor of dd is overrated, not completely unwarranted, mind you, but overrated.
Yes, it can be a 'data destroyer', but so can pretty much every software, no matter how friendly, if it deals with storage media and sporting any sort of 'erase' functionality of any shape.

If the destination harddrive is 'empty', or, which would make sense in this case 'contents don't matter, then dd is quite safe, as long as you keep the 'in file' aka if= to your source, never put your 'source' in the output file.

Code:
dd status=progress if=/dev/source of=/dev/destination
the 'of' bit is the one getting the lovin', as long as you take care to only put things there that you are fine getting written to, then you'll be okay.

Last edited by Geist; 01-25-2020 at 10:46 PM. Reason: Added the 'status' option for further peace of mind
 
1 members found this post helpful.
Old 01-25-2020, 11:23 PM   #7
EdGr
Member
 
Registered: Dec 2010
Location: California, USA
Distribution: I run my own OS
Posts: 998

Rep: Reputation: 470Reputation: 470Reputation: 470Reputation: 470Reputation: 470
Since the drives are different sizes, you do not want an image copy (dd).

If the drive is bootable, you need to install the OS on it and then use rsync to copy any data onto it. If the drive contains only data, you need to partition it (gdisk), make the filesystem (mkfs.ext4), and then run rsync to copy the data.
Ed
 
1 members found this post helpful.
Old 01-25-2020, 11:47 PM   #8
Geist
Member
 
Registered: Jul 2013
Distribution: Slackware 14 / current
Posts: 442

Rep: Reputation: 196Reputation: 196
The sizes are different, but in this case, from small to large, that should merely result in unallocated space after the cloned image.
In other words, the larger drive will appear as if it were the smaller drive, a harddrive with (lets assume) one partition with 75GB of space.

But, unlike the smaller drive, the larger drive will have space available, albeit 'unallocated' beyond that.

Thus, the clone of the old drive, which is said one partition, could be expanded to fill the entire 250GB, or more partitions could be put after it.
Code:
Small drive:
 p1
[||||||||||||]

Large drive after clone:
 p1         | unallocated
[||||||||||||xxxxxxxxxxxxxx]

After expanding the partition
  
p1          | still p1, but with free space
[||||||||||||______________]

Or with a new partition:
p1          |p2
[||||||||||||______________]
In the second to last example, the partition is extended and it would be like the 75gb drive had grown to a 250Ggb one.
In the last example, partition one would be full (if the source drive of 75gb were full too) and the second partition would be empty.

Last edited by Geist; 01-25-2020 at 11:58 PM.
 
1 members found this post helpful.
Old 01-26-2020, 02:37 PM   #9
Gregg Bell
Senior Member
 
Registered: Mar 2014
Location: Illinois
Distribution: Xubuntu
Posts: 2,034

Original Poster
Rep: Reputation: 176Reputation: 176
Quote:
Originally Posted by frankbell View Post
If you've got a cable connection and can mount both drives, you should not need to use Clonezilla.

Take a look at rsync.
Thanks Frank. And thanks for the link. rsync looks pretty simple.
 
Old 01-26-2020, 02:39 PM   #10
Gregg Bell
Senior Member
 
Registered: Mar 2014
Location: Illinois
Distribution: Xubuntu
Posts: 2,034

Original Poster
Rep: Reputation: 176Reputation: 176
Quote:
Originally Posted by syg00 View Post
Simplest - dd
Followed by clonezilla

All copiously documented. Will do what you asked, not necessarily what you might want. The rsync suggestion will require you to do some setup, which you appear dis-inclined to do.
Thanks syg00. I'm thinking Clonezilla is a little less scary at this point, and yes, I'm pretty disinclined to do set up.
 
Old 01-26-2020, 02:43 PM   #11
Gregg Bell
Senior Member
 
Registered: Mar 2014
Location: Illinois
Distribution: Xubuntu
Posts: 2,034

Original Poster
Rep: Reputation: 176Reputation: 176
Quote:
Originally Posted by vtel57 View Post
Rsync is not necessarily simple for a not-so-experienced Linux user. However, it would be my choice. I rsync (mirror) my /, /home, and /archive partitions to a backup drive every Sunday morning.

The most important thing to remember with rsync is if you want a true bootable image of a drive, you must remember when setting up source and destinations to ALWAYS REMEMBER THE FULLOWING / on the source.

For example:

Source: /dev/sda1/
Destination: /dev/sdb1

If you forget the following / on the source, you'll end up with your entire backup being placed in a new directory on the backup drive rather than being an actual true mirror of the source drive.

An easy way to use Rsync to back up is to use a portable Linux (on a disk or USB stick) like Porteus. Within Porteus, you'll find the graphic version of rsync known as grsync. It looks like THIS. Very simple to set-up and operate.

Personally, I don't rsync my main system to my backup drive from within the active/booted main system. I prefer to use a portable Linux to mount and mirror the appropriate partitions using rsync.

Luck with it.
Thanks vtel57. Yep, I'm the not-so-experienced user. Thanks for the warning about the / nuance. If I use rysync I will definitely be back here asking if my plans look okay.

I have grsync on another computer but haven't used it hardly at all as I've found FreeFileSync to be a little more straightforward.
 
1 members found this post helpful.
Old 01-26-2020, 02:47 PM   #12
Gregg Bell
Senior Member
 
Registered: Mar 2014
Location: Illinois
Distribution: Xubuntu
Posts: 2,034

Original Poster
Rep: Reputation: 176Reputation: 176
Quote:
Originally Posted by slackware-current View Post
dd if=/dev/you want to copy of=/dev/yopu want to send copy to.
https://www.linuxnix.com/what-you-sh...ux-dd-command/
Thanks. Wow, that's simple.
 
Old 01-26-2020, 02:49 PM   #13
Gregg Bell
Senior Member
 
Registered: Mar 2014
Location: Illinois
Distribution: Xubuntu
Posts: 2,034

Original Poster
Rep: Reputation: 176Reputation: 176
Quote:
Originally Posted by Geist View Post
Imho, the scare factor of dd is overrated, not completely unwarranted, mind you, but overrated.
Yes, it can be a 'data destroyer', but so can pretty much every software, no matter how friendly, if it deals with storage media and sporting any sort of 'erase' functionality of any shape.

If the destination harddrive is 'empty', or, which would make sense in this case 'contents don't matter, then dd is quite safe, as long as you keep the 'in file' aka if= to your source, never put your 'source' in the output file.

Code:
dd status=progress if=/dev/source of=/dev/destination
the 'of' bit is the one getting the lovin', as long as you take care to only put things there that you are fine getting written to, then you'll be okay.
Thanks Geist. And thanks for the reminder that everything is a risk of some sort. What does the

status=progress

do?
 
Old 01-26-2020, 02:52 PM   #14
Gregg Bell
Senior Member
 
Registered: Mar 2014
Location: Illinois
Distribution: Xubuntu
Posts: 2,034

Original Poster
Rep: Reputation: 176Reputation: 176
Quote:
Originally Posted by EdGr View Post
Since the drives are different sizes, you do not want an image copy (dd).

If the drive is bootable, you need to install the OS on it and then use rsync to copy any data onto it. If the drive contains only data, you need to partition it (gdisk), make the filesystem (mkfs.ext4), and then run rsync to copy the data.
Ed
Thanks Ed. That complicates things a bit. So in that process I would have to reinstall all my apps, right?
 
Old 01-26-2020, 02:53 PM   #15
vtel57
Senior Member
 
Registered: Jul 2006
Location: USA
Distribution: Slackware64 - 14.2 w/ Xfce
Posts: 1,631

Rep: Reputation: 489Reputation: 489Reputation: 489Reputation: 489Reputation: 489
Definitely keep us posted on your progress or holler if you need some more assistance, Gregg.

Luck with it!

~Eric
 
1 members found this post helpful.
  


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
Easy way to clone my hard drive rmcellig Linux - Newbie 18 10-07-2009 08:59 PM
clone hard drive to smaller hard drive digity Linux - Newbie 8 01-11-2009 06:29 PM
Clone a dual booting IDE hard drive to a SATA hard drive namida12 Linux - Distributions 1 07-14-2008 10:01 AM
Easy way to clone linux installed hard drive mobassir Linux - Software 6 01-12-2004 05:34 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 01:44 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