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 |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
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.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. 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.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
 |
|
06-30-2017, 07:09 PM
|
#1
|
LQ Newbie
Registered: Jan 2010
Posts: 10
Rep:
|
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.
|
|
|
06-30-2017, 07:16 PM
|
#2
|
LQ Veteran
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,378
|
When in doubt, read the manpage. That's a lower case ell for (l)ist, not a numeric one.
|
|
|
06-30-2017, 08:27 PM
|
#3
|
Moderator
Registered: Mar 2008
Posts: 22,361
|
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.
|
|
|
06-30-2017, 08:58 PM
|
#4
|
LQ Guru
Registered: Jan 2005
Location: USA and Italy
Distribution: Debian testing/sid; OpenSuSE; Fedora; Mint
Posts: 5,524
|
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/
|
|
|
06-30-2017, 09:03 PM
|
#5
|
Member
Registered: Jul 2013
Posts: 749
Rep: 
|
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.
|
|
|
07-01-2017, 09:16 AM
|
#6
|
Senior Member
Registered: Oct 2003
Posts: 3,018
|
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.
|
|
|
07-01-2017, 11:34 AM
|
#7
|
LQ Newbie
Registered: Jan 2010
Posts: 10
Original Poster
Rep:
|
Quote:
Originally Posted by kilgoretrout
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?
|
|
|
07-01-2017, 12:36 PM
|
#8
|
LQ Guru
Registered: Jan 2005
Location: USA and Italy
Distribution: Debian testing/sid; OpenSuSE; Fedora; Mint
Posts: 5,524
|
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.
|
|
|
07-02-2017, 02:10 PM
|
#9
|
LQ Newbie
Registered: Jan 2010
Posts: 10
Original Poster
Rep:
|
Quote:
Originally Posted by AwesomeMachine
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.
|
|
|
07-02-2017, 05:35 PM
|
#10
|
Member
Registered: Nov 2010
Posts: 223
Rep:
|
Quote:
Originally Posted by yankeenewbie
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.
|
|
|
07-02-2017, 06:31 PM
|
#11
|
LQ Newbie
Registered: Jan 2010
Posts: 10
Original Poster
Rep:
|
Quote:
Originally Posted by DVOM
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.
Last edited by yankeenewbie; 07-02-2017 at 06:34 PM.
|
|
|
07-02-2017, 10:04 PM
|
#12
|
Senior Member
Registered: Apr 2010
Posts: 2,288
|
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.
|
|
|
07-03-2017, 12:48 AM
|
#13
|
Member
Registered: Jul 2013
Posts: 749
Rep: 
|
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.
|
|
|
07-03-2017, 01:25 AM
|
#14
|
Member
Registered: Nov 2010
Posts: 223
Rep:
|
Quote:
Originally Posted by yankeenewbie
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"
|
|
|
07-03-2017, 10:57 AM
|
#15
|
LQ Guru
Registered: Jan 2005
Location: USA and Italy
Distribution: Debian testing/sid; OpenSuSE; Fedora; Mint
Posts: 5,524
|
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.
|
|
|
All times are GMT -5. The time now is 04:14 PM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|