Review your favorite Linux distribution.
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
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!


  Search this Thread
Old 08-21-2009, 11:00 AM   #1
Registered: Dec 2008
Location: Kerala, India
Distribution: Ubuntu 11.10
Posts: 334

Rep: Reputation: 33
Wink How to clone ?

Is there something like to make a clone in Ubuntu , I mean I had used Ghost in Windows , is it there for Ubuntu too .. Please provide necessary links to get studied
Old 08-21-2009, 11:04 AM   #2
LQ 5k Club
Registered: May 2001
Location: Belgium
Distribution: Arch
Posts: 8,528

Rep: Reputation: 899Reputation: 899Reputation: 899Reputation: 899Reputation: 899Reputation: 899Reputation: 899
Take a look at
Old 08-21-2009, 11:11 AM   #3
LQ Guru
Registered: May 2009
Location: Gibraltar, Gibraltar
Distribution: Fedora 20 with Awesome WM
Posts: 6,805
Blog Entries: 1

Rep: Reputation: 1295Reputation: 1295Reputation: 1295Reputation: 1295Reputation: 1295Reputation: 1295Reputation: 1295Reputation: 1295Reputation: 1295

You could use FOG (User guide) or CloneZilla (HowTo with CloneZilla Live).

Kind regards,


Last edited by EricTRA; 08-21-2009 at 11:14 AM. Reason: typo fixing :-)
Old 08-21-2009, 11:28 AM   #4
LQ Guru
Registered: May 2005
Location: boston, usa
Distribution: fc-15/ fc-20-live-usb/ aix
Posts: 5,167

Rep: Reputation: 890Reputation: 890Reputation: 890Reputation: 890Reputation: 890Reputation: 890Reputation: 890
if the output file is >= the input file, dd would probably be the best:
dd if=/dev/sdx of=/dev/sdy # bs=8192
caution: do not get sdx and sdy confused.

Last edited by schneidz; 08-21-2009 at 11:29 AM.
Old 08-21-2009, 11:42 AM   #5
Registered: Oct 2005
Location: Pakistan
Distribution: Debian,Pclinuxos
Posts: 327

Rep: Reputation: 31
you could also use programs like partimage to save the image.I used partimage to transfer my root partition (i.e. a complete debian installation) to another harddisk
Old 08-21-2009, 01:49 PM   #6
Senior Member
Registered: May 2008
Location: Poland
Distribution: Slackware, Mint
Posts: 1,252

Rep: Reputation: 205Reputation: 205Reputation: 205
To clone Linux system I run live Linux distribution (for example Slax) and use the commands:

tar czf /path/to/stored/system/linux.tgz *

tar xzf /path/to/stored/system/linux.tgz
Then I have to customize /etc/fstab and /etc/lilo.conf files, chroot to restored system, and run lilo command.


To clone Windows system I use the commands:

dd if=/dev/hda1 | gzip > /path/to/stored/system/windows.gz

zcat -c /path/to/stored/system/windows.gz | dd of=/dev/hda1
As wrote schneidz in such case the partition for restored system can't be smaller then the partition with stored system. It shouldn't be too big as well because after restoring the system the size of the partition seen by Windows will be exactly as big as the size of stored partition. Any excess will be ignored (unusable).
Old 08-21-2009, 01:57 PM   #7
LQ Guru
Registered: May 2005
Location: boston, usa
Distribution: fc-15/ fc-20-live-usb/ aix
Posts: 5,167

Rep: Reputation: 890Reputation: 890Reputation: 890Reputation: 890Reputation: 890Reputation: 890Reputation: 890
^ the unclaimed spaced can be reclaimed with something like gparted.
Old 08-21-2009, 02:16 PM   #8
Registered: May 2009
Posts: 34

Rep: Reputation: 0
i actually have used Clonezilla. It can take and restore and image of any drive or copy drive to drive. You can even set up a clonezilla server and do cloning over a lan or wan or ftp share (thats a little more complicated. But for local imaging it works great. And its free and open source.
Old 08-21-2009, 02:19 PM   #9
Gentoo support team
Registered: May 2008
Location: Lucena, Córdoba (Spain)
Distribution: Gentoo
Posts: 4,074

Rep: Reputation: 387Reputation: 387Reputation: 387Reputation: 387
There really isn't much situations in which the use of dd is really justified for backup purposes. It will waste time and space, and doesn't really adds anything to it. Besides that, if you use tar, your restored copy will be fully defragmented when you restore it, unlike with a dd image. Some silly OSes require a few files to be on certain placements in the disk, physically. However linux is not that faulty, and the bootloader can read your kernel without any problem from any part of the disk, as long as your BIOS can see it at that stage.

If it's just for backup purposes, use tar, rsync or whatever fits you better. If you truly want to use dd for that, at least be smart and zero out the empty part of your disk before to save some space. That can be done by growing a file full or zeros, and then deleting it.

dd if=/dev/zero of=/foo.img
rm /foo.img
As least now you will be able to compress the image much better to store it.
Old 08-26-2009, 06:43 PM   #10
Senior Member
Registered: May 2008
Location: Poland
Distribution: Slackware, Mint
Posts: 1,252

Rep: Reputation: 205Reputation: 205Reputation: 205

I tried to unclaim the reclaimed disk space with gparted but it wasn't able to do it. Here's the information about partitions on that disk:

# fdisk -l
Disk /dev/hda: 80.0 GB, 80026361856 bytes
16 heads, 63 sectors/track, 155061 cylinders
Units = cylinders of 1008 * 512 = 516096 bytes
Disk identifier: 0x3db012b3

   Device Boot      Start         End      Blocks   Id  System
/dev/hda1   *           1       15375     7748968+   c  W95 FAT32 (LBA)
/dev/hda2           15376       30750     7749000   83  Linux
/dev/hda3           30751      153750    61992000   83  Linux
/dev/hda4          153751      155061      660744   82  Linux swap
# df
Filesystem           1K-blocks      Used Available Use% Mounted on
/dev/hda2              7748748   4977820   2770928  65% /
tmpfs                   257088         0    257088   0% /dev/shm
/dev/hda1              6790684   2781828   4008856  41% /mnt/hda1
/dev/hda3             61990104  44140000  17850104  72% /mnt/hda3
According to fdisk first and second partitions have almost the same size: 7748968+ vs 7749000. According to df the first partition is significantly smaller then the second: 6790684 vs 7748748. According to Windows first partition has 6.47 GB (2.65 GB of used space and 3.82 GB of free space). I restored first partition from the backup that I prepared a few years ago with dd and gzip on some smaller partition. When I restore the image of the smaller partition on the bigger one the system ignores disk space exceeding restored image. As I mentioned above gparted is unable to unclaim the reclaimed space.


I started to backup Windows partition with dd ten years ago. I used that method because I wasn't able to store Polish file names with tar. In the meantime I improved fstab entry for Windows partition using iocharset=iso8859-2 and codepage=852:

/dev/hda1 /mnt/hda1 vfat iocharset=iso8859-2,codepage=852,showexec,noexec,auto,uid=1000,gid=100 0 0
In result Linux can read and write file names with Polish diacritics.

Now I backed up Windows system with tar and gzip. After restoring the system from the backup it works well. The only flaw are two ``desktop.ini -- Notepad'' windows popping up after start up of the system:

It means nothing. To avoid it it's enough to delete desktop.ini file from Documents and Settings\All Users\Start Menu\Programs\Startup or Documents and Settings\All Users\Start Menu\Programs or Documents and Settings\All Users\Start Menu directories.

I tested three methods of the backup of the same partition. Backup prepared with dd and gzip has 2.978 MB. Backup prepared with dd and gzip after defragmentation with defrag.exe and after wiping of unused disk space with KillDiskSuiteFree (DOS version) has 2.092 MB. Backup prepared with tar and gzip has 1.739 MB.

A few years ago I bought a laptop with Windows system. I did the backup copy of that system using dd and gzip. If I need Windows for some reason I can restore it from that backup in a few minutes.


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
I would like to clone my OS strangerklone Linux - Newbie 5 06-08-2009 09:44 PM
I need to Clone a Red Hat drive and install clone in HP server drummer54 Linux - Newbie 14 03-07-2009 05:15 PM
bugzilla: to clone, or not to clone? The00Dustin Linux - Newbie 1 05-24-2008 06:19 AM
Can I clone myself? fannymites SUSE / openSUSE 3 03-02-2006 04:06 AM
how to use clone() icoming Programming 1 02-03-2005 12:19 PM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 06:47 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration