Creating a clone of a disc unit using Linux mint

All Gurus once were Newbies
Forum rules
There are no such things as "stupid" questions. However if you think your question is a bit stupid, then this is the right place for you to post it. Please stick to easy to-the-point questions that you feel people can answer fast. For long and complicated questions prefer the other forums within the support section.
Before you post please read how to get help
Post Reply
chinano
Level 1
Level 1
Posts: 4
Joined: Sat Dec 27, 2014 10:46 am

Creating a clone of a disc unit using Linux mint

Post 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?

User avatar
coffee412
Level 6
Level 6
Posts: 1059
Joined: Mon Nov 12, 2012 7:38 pm
Location: Indiana, USA
Contact:

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

Post 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
Ryzen x1800 Asus Prime x370-Pro 32 gigs Ram RX480 graphics
IceWarp 12.0.3 * Mint 18.3 * RAID 1/5 * OpenVPN * Linux since kernel 2.0.36
************* Get Your Linux on! ***************

User avatar
richyrich
Level 19
Level 19
Posts: 9059
Joined: Mon May 04, 2009 8:31 pm

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

Post 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/

Dyfi
Level 4
Level 4
Posts: 241
Joined: Fri Nov 27, 2009 7:25 am

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

Post by Dyfi »

Indirectly, you seem to asking about imaging your system.

These may help:-

Google Clonezilla, Redobackup and fsarchiver.

User avatar
austin.texas
Level 20
Level 20
Posts: 12048
Joined: Tue Nov 17, 2009 3:57 pm
Location: at /home

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

Post 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
Mint 18.2 Cinnamon, Quad core AMD A8-3870 with Radeon HD Graphics 6550D, 8GB DDR3, Ralink RT2561/RT61 802.11g PCI
Linux Linx 2018

mintybits
Level 6
Level 6
Posts: 1123
Joined: Fri Jan 27, 2012 5:09 pm

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

Post by mintybits »

Alteratively, use Macrium Reflect to backup your Windows installation and then restore to your new disk.

User avatar
WharfRat
Level 21
Level 21
Posts: 13900
Joined: Thu Apr 07, 2011 8:15 pm

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

Post 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:
ImageImage

User avatar
Reorx
Level 12
Level 12
Posts: 4008
Joined: Tue Jul 07, 2009 7:14 pm
Location: SE Florida, USA

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

Post 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:
Full time Linux Mint user since 2011 - Currently running LM19 Cinnamon.

Image Image

User avatar
Pierre
Level 20
Level 20
Posts: 10275
Joined: Fri Sep 05, 2008 5:33 am
Location: Perth, AU.

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

Post by Pierre »

the live_disc also uses Gparted,
- this can also be used to clone drives & partitions:
http://computerdoctor-mitchel.blogspot. ... -disc.html
Image
Please edit your original post title to include [SOLVED] - when your problem is solved!
and DO LOOK at those Unanswered Topics - - you may be able to answer some!.

User avatar
caf4926
Level 7
Level 7
Posts: 1883
Joined: Mon Mar 22, 2010 3:21 pm
Location: UK Lake District

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

Post by caf4926 »

I'd prefer

Code: Select all

ionice -c3 ddrescue /dev/sda /<path-to-target-save>
Linux Mint 19.3 Cinnamon

User avatar
UgoRipley
Level 3
Level 3
Posts: 108
Joined: Tue Nov 04, 2014 6:32 pm

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

Post 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)?
ugo@LinuxMint17 ~ $ inxi -Sx
System: Host: LinuxMint17 Kernel: 3.16.0-38-generic i686 (32 bit gcc: 4.8.2) - Desktop: Cinnamon 2.8.6 (Gtk 3.10.8-0ubuntu1.6) - Distro: Linux Mint 17.3 Rosa

User avatar
Reorx
Level 12
Level 12
Posts: 4008
Joined: Tue Jul 07, 2009 7:14 pm
Location: SE Florida, USA

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

Post 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.
Full time Linux Mint user since 2011 - Currently running LM19 Cinnamon.

Image Image

Cattleman
Level 3
Level 3
Posts: 124
Joined: Tue Dec 02, 2014 11:59 am

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

Post 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.

dontNull
Level 1
Level 1
Posts: 37
Joined: Fri Dec 05, 2014 9:37 pm

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

Post 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
The more I learn the more I realize I don't know.

chinano
Level 1
Level 1
Posts: 4
Joined: Sat Dec 27, 2014 10:46 am

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

Post 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
Attachments
terminal.png

User avatar
WharfRat
Level 21
Level 21
Posts: 13900
Joined: Thu Apr 07, 2011 8:15 pm

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

Post 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.
ImageImage

User avatar
Reorx
Level 12
Level 12
Posts: 4008
Joined: Tue Jul 07, 2009 7:14 pm
Location: SE Florida, USA

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

Post 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'...
Full time Linux Mint user since 2011 - Currently running LM19 Cinnamon.

Image Image

Post Reply

Return to “Newbie Questions”