LinuxQuestions.org
Review your favorite Linux distribution.
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 06-30-2017, 07:09 PM   #1
yankeenewbie
LQ Newbie
 
Registered: Jan 2010
Posts: 10

Rep: Reputation: 0
Cloning Hard Drive


I am running Mint 17.2 and wish to clone my harddrive. I am trying to follow a paper entitled "Clone a Hard Drive Using an Ubuntu Live CD" which is actually instructions for using dd.

My problem is that when I run the command "sudo fdisk -1" I get an error message that "-1" is invalid. The command is supposed to display all connected harddrives and is vital for correct identification of source and destination drives.

How do I proceed? The goal is to clone my 500GB HDD so I have a bootable backup.
 
Old 06-30-2017, 07:16 PM   #2
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 18,127

Rep: Reputation: 2923Reputation: 2923Reputation: 2923Reputation: 2923Reputation: 2923Reputation: 2923Reputation: 2923Reputation: 2923Reputation: 2923Reputation: 2923Reputation: 2923
When in doubt, read the manpage. That's a lower case ell for (l)ist, not a numeric one.
 
Old 06-30-2017, 08:27 PM   #3
jefro
Moderator
 
Registered: Mar 2008
Posts: 19,217

Rep: Reputation: 2926Reputation: 2926Reputation: 2926Reputation: 2926Reputation: 2926Reputation: 2926Reputation: 2926Reputation: 2926Reputation: 2926Reputation: 2926Reputation: 2926
I agree that it is not one but ell.

Consider a different backup plan too. Many people use dd but quite a lot of folks (me too) have borked installs using the command line program dd.

There are other ways to image a system. Might look at a few that tend to be a bit safer.

In many cases you don't need a clone too. You just need personal data and a file of the programs you had installed.

However. Your backup plan is yours alone. Any plan is better than none.
 
Old 06-30-2017, 08:58 PM   #4
AwesomeMachine
LQ Guru
 
Registered: Jan 2005
Location: USA and Italy
Distribution: Debian testing/sid; OpenSuSE; Fedora; Mint
Posts: 5,513

Rep: Reputation: 1004Reputation: 1004Reputation: 1004Reputation: 1004Reputation: 1004Reputation: 1004Reputation: 1004Reputation: 1004
If you reverse the intended source and target, which is kind of like accidentally shooting yourself in the head instead of your intended target, you'll run into trouble with "dd". But if you think you could avoid that, dd is a good tool for cloning.

Read this: http://www.linuxquestions.org/questi...ommand-362506/
 
Old 06-30-2017, 09:03 PM   #5
Doug G
Member
 
Registered: Jul 2013
Posts: 749

Rep: Reputation: Disabled
Keep in mind your clone will only contain whatever was on the disk as of the moment you cloned it. Cloning takes some time, and really isn't suitable for day-to-day backup, unless you can afford to shut down your system and boot a live distro daily/hourly

I do dd disk clones often, usually as:
1. An archive snapshot of a system at some time (like quarterly/yearly)
2. When replacing the hard drive in a system
3. When I'd like to have instant access to a system contents (as of clone date) from the image (system may be not on the network).

As Jefro said, any backup plan is better than none. For myself, I do cron jobs that rsync over my network to backup servers for regular backups.
 
Old 07-01-2017, 09:16 AM   #6
kilgoretrout
Senior Member
 
Registered: Oct 2003
Posts: 2,704

Rep: Reputation: 245Reputation: 245Reputation: 245
Quote:
The goal is to clone my 500GB HDD so I have a bootable backup.
For the stated purpose, I would recommend Clonezilla:

http://clonezilla.org/

It's faster than dd for supported file systems(all linux file systems are supported) and more flexible - you can clone to a smaller disk if the data on the larger disk is small enough to fit on the smaller disk. For example, if you had a 1TB disk with only 100GB of data on it, to clone with dd you would need a target disk 1TB or larger to do the clone. With Clonezilla, you could clone to a target disk of 100GB or larger.

Once you have a cloned copy of your hard drive, I'd just use rsync to keep the cloned drive in sync. It would be a lot faster than periodically rerunning your clone with Clonezilla or dd.

Last edited by kilgoretrout; 07-01-2017 at 10:46 AM.
 
Old 07-01-2017, 11:34 AM   #7
yankeenewbie
LQ Newbie
 
Registered: Jan 2010
Posts: 10

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by kilgoretrout View Post
For the stated purpose, I would recommend Clonezilla:

http://clonezilla.org/

It's faster than dd for supported file systems(all linux file systems are supported) and more flexible - you can clone to a smaller disk if the data on the larger disk is small enough to fit on the smaller disk. For example, if you had a 1TB disk with only 100GB of data on it, to clone with dd you would need a target disk 1TB or larger to do the clone. With Clonezilla, you could clone to a target disk of 100GB or larger.

Once you have a cloned copy of your hard drive, I'd just use rsync to keep the cloned drive in sync. It would be a lot faster than periodically rerunning your clone with Clonezilla or dd.
Thanks to all for fast responses!!

I understood that the instructions were somewhat in doubt since the first line had a "1" (number) and the next line had an "l" (ell) but neither worked. When I went back and re-tried with the "ell" I got a readout of the drives. But dd refuses to execute the clone command. No error message, it just doesn't respond.

Same kind of problem with password. In the Terminal, when I execute a command I am sometimes asked again for the password (as I am already logged in on reboot) and sometimes not. Sometimes I enter the password and press "enter" and it is ignored. Other times it isn't. What's going on with this?
 
Old 07-01-2017, 12:36 PM   #8
AwesomeMachine
LQ Guru
 
Registered: Jan 2005
Location: USA and Italy
Distribution: Debian testing/sid; OpenSuSE; Fedora; Mint
Posts: 5,513

Rep: Reputation: 1004Reputation: 1004Reputation: 1004Reputation: 1004Reputation: 1004Reputation: 1004Reputation: 1004Reputation: 1004
Dd doesn't have a clone command. Did you see the link I posted above. And, you can run dd on a live system. You don't have to boot with a live CD. Drives can be mounted or not. It doesn't matter with dd. But with the size of today's drives, dd can be slow.
 
Old 07-02-2017, 02:10 PM   #9
yankeenewbie
LQ Newbie
 
Registered: Jan 2010
Posts: 10

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by AwesomeMachine View Post
Dd doesn't have a clone command. Did you see the link I posted above. And, you can run dd on a live system. You don't have to boot with a live CD. Drives can be mounted or not. It doesn't matter with dd. But with the size of today's drives, dd can be slow.
I have made several attempts to run CloneZilla without success; IO am using an article from the CloneZilla website as my guide but it leads to nothingness.

Can someone give the simple steps for cloning the internal HDD to an external HDD on my Mint 17.2 machine? I tried Clonezilla in Beginner mode and it did not understand that the destination drive was external--it expected both drives to be internal which is not possible ( I think) on this machine. So I tried the "Expert" mode but not I cannot get into the CMD mode because it apparently needs some password or something to authenticate "user@zesty:~$" about which I know nothing.
Likewise the Expert mode seems to want to clone partition by partition instead of disk by disk.

This whole process is dirt simple in Windows using the Apricorn Easy Gig IV CD and hardware. But Easy Gig doesn't seem to like Linux.
 
Old 07-02-2017, 05:35 PM   #10
DVOM
Member
 
Registered: Nov 2010
Posts: 223

Rep: Reputation: 48
Quote:
Originally Posted by yankeenewbie View Post
I have made several attempts to run CloneZilla without success; IO am using an article from the CloneZilla website as my guide but it leads to nothingness.
Could you provide a link to that article?

I have just booted to a clonezilla USB with a 2TB USB disk attached (at boot), Clonezilla saw both my 1TB internal drive and my 2TB external drive and offered them up as source and/or target options. What size is your source drive and what size is your target drive? The target drive has to be as big or bigger than the source drive. If the external drive is not being seen, then that needs to be solved. Also the clonezilla I'm using is "clonezilla-live-20161004-yakkety-amd64".

I use clonezilla at least 2 to 3 times each week. However I always image and/or restore a partition, I've never cloned a drive to another drive.
 
Old 07-02-2017, 06:31 PM   #11
yankeenewbie
LQ Newbie
 
Registered: Jan 2010
Posts: 10

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by DVOM View Post
Could you provide a link to that article?

I have just booted to a clonezilla USB with a 2TB USB disk attached (at boot), Clonezilla saw both my 1TB internal drive and my 2TB external drive and offered them up as source and/or target options. What size is your source drive and what size is your target drive? The target drive has to be as big or bigger than the source drive. If the external drive is not being seen, then that needs to be solved. Also the clonezilla I'm using is "clonezilla-live-20161004-yakkety-amd64".

I use clonezilla at least 2 to 3 times each week. However I always image and/or restore a partition, I've never cloned a drive to another drive.
The article came from "clonezilla.org/show-live-doc-content.php?topic=clonezilla-liv" and at this point the URL ran off the printout so I do not have all of it.

Attached is a screenshot showing that Clonezilla found both drives and also the final error message with no further explanation of what goes wrong.

The source and destination drives are both 500GB.

I have also used images as backups but why not just clone onto a new drive? They are inexpensive and this avoids the problem of an invalid image (of which I have encountered many)--I test the cloned drive immediately to be sure it is good, then store it until the next clone session, perhaps two months later.
Attached Thumbnails
Click image for larger version

Name:	dd-1.jpg
Views:	17
Size:	121.6 KB
ID:	25367  

Last edited by yankeenewbie; 07-02-2017 at 06:34 PM.
 
Old 07-02-2017, 10:04 PM   #12
JJJCR
Senior Member
 
Registered: Apr 2010
Posts: 1,642

Rep: Reputation: 277Reputation: 277Reputation: 277
Yes, Clonezilla is good.

Check out this link: http://clonezilla.org/show-live-doc-..._to_disk_clone

DD is good as well but it might turn south if is not use correctly.

DD = disk destroyer if source and destination is reversed.
 
Old 07-03-2017, 12:48 AM   #13
Doug G
Member
 
Registered: Jul 2013
Posts: 749

Rep: Reputation: Disabled
I don't like clonezilla, it makes it difficult to do some of the things I require with a disk image. Because storage space is pretty cheap, I want my images to be easily mountable. I store images on external hard drives, and if I need something retrieved from any image all I have to do is use the mount command on the image. Plus, dd full disk images are mountable in windows, I use VirtualCloneDrive to mount image files into the windows filesystem.

As far as I know, you have to do an extra step involving extra storate to turn a clonezilla image into a raw image .iso before you can use mount. This is an extra step in the process to extract something from an image.

I'll stick with dd, it's simple and fast. As long as you do a couple double-checks on what you've picked for input and output, and if you don't mind the size of the resulting image being uncompressed, dd works great.
 
Old 07-03-2017, 01:25 AM   #14
DVOM
Member
 
Registered: Nov 2010
Posts: 223

Rep: Reputation: 48
Quote:
Originally Posted by yankeenewbie View Post
The article came from "clonezilla.org/show-live-doc-content.php?topic=clonezilla-liv" and at this point the URL ran off the printout so I do not have all of it.

Attached is a screenshot showing that Clonezilla found both drives and also the final error message with no further explanation of what goes wrong.

The source and destination drives are both 500GB.

I have also used images as backups but why not just clone onto a new drive? They are inexpensive and this avoids the problem of an invalid image (of which I have encountered many)--I test the cloned drive immediately to be sure it is good, then store it until the next clone session, perhaps two months later.
That image doesn't look like a clonezilla window. This part really doesn't look like a clonezilla window:
"sudo dd if=/dev/sda of=/dev/sdb"
 
Old 07-03-2017, 10:57 AM   #15
AwesomeMachine
LQ Guru
 
Registered: Jan 2005
Location: USA and Italy
Distribution: Debian testing/sid; OpenSuSE; Fedora; Mint
Posts: 5,513

Rep: Reputation: 1004Reputation: 1004Reputation: 1004Reputation: 1004Reputation: 1004Reputation: 1004Reputation: 1004Reputation: 1004
You can compress a dd image:
Code:
$ dd if=/dev/sda | gzip > image.file.gz

Last edited by AwesomeMachine; 07-03-2017 at 11:09 AM.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
Hard Drive Cloning junquesea Linux - Newbie 3 07-15-2012 10:19 PM
Cloning Hard Drive FredGSanford Linux - Software 5 08-28-2008 05:37 AM
Cloning a hard drive! Shioni Linux - General 6 03-19-2006 11:39 AM
Hard drive cloning sabeel_ansari Programming 2 02-14-2006 01:40 PM
Cloning a hard drive davcefai Debian 3 11-28-2005 05:36 PM

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

All times are GMT -5. The time now is 05:57 PM.

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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration