Page 1 of 1

Creating a clone of a disc unit using Linux mint

Posted: Sat Dec 27, 2014 10:59 am
by chinano
Hello,
I am kinda new to Linux - i just installed on my old laptop and I am also currently reinstalling my better Win7 computer. I want to keep the windows, but I hate the reinstalling process (you know, you have to reinstall the system, which takes hours and then you also have to reinstall all the sw, which takes even longer).
The thing is - I heard there is a way to create a disc clone using linux (by which I mean copying the whole disc unit to one file) - which would be wonderfully useful to me (because bot the steps mentioned above woud be shorted into one simple command). Can any of you guys help me out?

Re: Creating a clone of a disc unit using Linux mint

Posted: Sat Dec 27, 2014 11:15 am
by coffee412
With about every flavor of linux comes the 'dd' command. This makes a sector by sector copy of a disk to another of equal or bigger size. You can make a clone of a drive or save it to an image file that can be mounted or moved to other drives for storage.

This is a command line program but easy to work with.

Lets say you have a drive called /dev/sdb and you want to clone it to /dev/sdc:

dd if=/dev/sdb of=/dev/sdc

Thats the basics. Be prepared to leave it for a while as dd reads each sector and writes it to the new media.

You can also perform this on just a partition:

You want to backup your home partition that is /dev/sdb1 as an example, to a image file:

dd if=/dev/sdb1 of=/mnt/otherdrive/my-home-backup.img

There are a lot of examples if you do a search.

Hope this helps.

coffee

Re: Creating a clone of a disc unit using Linux mint

Posted: Sat Dec 27, 2014 11:23 am
by richyrich
You can also download and burn yourself a cd of clonezilla . . This is what I personally use and recommend for cloning and/or backup !

http://clonezilla.org/

Re: Creating a clone of a disc unit using Linux mint

Posted: Sat Dec 27, 2014 11:25 am
by Dyfi
Indirectly, you seem to asking about imaging your system.

These may help:-

Google Clonezilla, Redobackup and fsarchiver.

Re: Creating a clone of a disc unit using Linux mint

Posted: Sat Dec 27, 2014 11:51 am
by austin.texas
For backing up your Windows installation, there are some MS utilities specifically for that -
http://windows.microsoft.com/en-us/wind ... =windows-7
http://windows.microsoft.com/en-us/wind ... up-restore

Re: Creating a clone of a disc unit using Linux mint

Posted: Sat Dec 27, 2014 11:59 pm
by mintybits
Alteratively, use Macrium Reflect to backup your Windows installation and then restore to your new disk.

Re: Creating a clone of a disc unit using Linux mint

Posted: Sun Dec 28, 2014 12:26 am
by WharfRat
chinano wrote:The thing is - I heard there is a way to create a disc clone using linux (by which I mean copying the whole disc unit to one file) - which would be wonderfully useful to me (because bot the steps mentioned above woud be shorted into one simple command). Can any of you guys help me out?
You can use dd, just make sure none of the partitions are mounted.

dd if=/dev/sda of=/path/to/sda.img

To restore, do the opposite

dd if=/path/to/sda.img of=/dev/sda

You can go disk to disk with

dd if=/dev/sda of=/dev/sdb

Good luck :wink:

Re: Creating a clone of a disc unit using Linux mint

Posted: Sun Dec 28, 2014 12:54 am
by Reorx
richyrich wrote:You can also download and burn yourself a cd of clonezilla . . This is what I personally use and recommend for cloning and/or backup !

http://clonezilla.org/
This! Clonezilla has resurrected my wife's Windoze gaming machine more than once... OBTW - the "clone" is 1 folder, not 1 file... :mrgreen:

Re: Creating a clone of a disc unit using Linux mint

Posted: Sun Dec 28, 2014 12:56 am
by Pierre
the live_disc also uses Gparted,
- this can also be used to clone drives & partitions:
http://computerdoctor-mitchel.blogspot. ... -disc.html

Re: Creating a clone of a disc unit using Linux mint

Posted: Sun Dec 28, 2014 2:01 am
by caf4926
I'd prefer

Code: Select all

ionice -c3 ddrescue /dev/sda /<path-to-target-save>

Re: Creating a clone of a disc unit using Linux mint

Posted: Sun Dec 28, 2014 4:28 am
by UgoRipley
I understand that Clonezilla supports many file systems, but is it possibile to clone a whole pc with a dual boot solution and possibly 2 different file systems (Windows & Mint)?

Re: Creating a clone of a disc unit using Linux mint

Posted: Sun Dec 28, 2014 11:41 am
by Reorx
UgoRipley wrote:I understand that Clonezilla supports many file systems, but is it possibile to clone a whole pc with a dual boot solution and possibly 2 different file systems (Windows & Mint)?
Yes. Clonezilla doesn't care how many OSs or file systems are on the disk.

Re: Creating a clone of a disc unit using Linux mint

Posted: Thu Jan 01, 2015 8:55 pm
by Cattleman
Creating a clone is something I have always done with my windoz in the past, so now I am looking for this for Mint 17.1. I always like to be prepared for the time my system crashes and I know it will eventually.
I discovered a program for this on SourceForge. The program is Rescatux. It looks like it has a good GUI and may be the best way to go since it makes a bootable recovery dvd and will restore grub and seems to work with both Linux and Windoz MBR. I downloaded the iso and burned a dvd but have not tried it yet. Forget Rescatux.

I just discovered that Rescatux won't run in vesa mode, so I'm going to use Clonezilla'


goodbye Bill, I'm closing windows and opening doors.

Re: Creating a clone of a disc unit using Linux mint

Posted: Sat Jan 03, 2015 5:10 am
by dontNull
Hi there,

The tools suggested previously should serve you well if you have major issue with your system.
(I personally use dd)

Just a couple of things to note:

-make sure the image file you make is on a separate hard disk, not just separate partition.
(In the event of a hard drive failure you will lose access to all partitions on that drive.)

-If you were thinking of cloning your laptop, then writing the image to your win 7 computer,
(Not sure if this is what you were thinking)
then don't do this!
When an OS is installed to a computer, it creates a useable file system for that computer.
It will be different for different computers (different motherboard, CPU etc, will use different drivers).
This would only work for multiple identical computers.

Jay

Re: Creating a clone of a disc unit using Linux mint

Posted: Fri Jun 12, 2015 3:19 pm
by chinano
Hi again,
thanks for all the replys, from all the suggestions, I like best the dd comand. I know that the OS that I want to clone is on sda2 and that i want to copy it into an image ("win-clone.img") file on sda4. Here is what happened when I read this:
WharfRat wrote: You can use dd, just make sure none of the partitions are mounted.

dd if=/dev/sda of=/path/to/sda.img

To restore, do the opposite

dd if=/path/to/sda.img of=/dev/sda

You can go disk to disk with

dd if=/dev/sda of=/dev/sdb

Good luck :wink:
so I typed this into the terminal and the terminal answered:

petr@Petr-Gamecomputer ~ $ sudo dd if=/dev/sda2 of=/dev/sda4/win-clone.img
[sudo] password for petr:
dd: failed to open ‘/dev/sda4/win-clone.img’: Not a directory

Does anybody know where I made the mistake? I attached a printscreen of the whole terminal

Re: Creating a clone of a disc unit using Linux mint

Posted: Fri Jun 12, 2015 3:29 pm
by WharfRat
Ouch :shock:

If you want to clone the partition to a file, you have to have the partition /dev/sda4 mounted to a mount point e.g. /media/winpart.

Code: Select all

sudo mkdir /media/winpart

Code: Select all

sudo mount -t ntfs-3g -o defaults,noatime,utf8,dmask=002,fmask=111,uid=1000,gid=1000 /dev/sda4  /media/winpart
You're lucky it erred otherwise you would have overwritten that partition.

Re: Creating a clone of a disc unit using Linux mint

Posted: Fri Jun 12, 2015 4:52 pm
by Reorx
Chinano;

Before you shoot yourself in the foot with dd >>> Clonezilla can be thought of as a simple (menu driven) user interface for dd... the nested menus walk you thru the process of creating a long-ish dd command to do what you want... and it actually shows you the final dd terminal command before it executes it so that you can learn something about dd if you are interested...

Just sayin'...