PDA

View Full Version : [ubuntu] Clone an Ubuntu Installation to another PC



pinguino99
January 22nd, 2009, 09:25 AM
Hello all,
I have an ubuntu installation on a PC, let's call it PC1, and its hard disk DISK1 250 GB, partitioned by ubuntu installer. Only 20GB are used.
I have PC2, with DISK2 smaller (160GB) and i would like to "clone" PC1 to PC2.
Is it possibile ? How ?
I tried clonezilla ... but no success.
My aim will be have PC2 with ubuntu in a similar way PC1 is.
I work in IT on a company and I would like to easily prepare PC without installing and configuring everything.
Any suggestion ?
Thanks to all !!
Pinguino99

Partyboi2
January 22nd, 2009, 09:36 AM
Have a look at partimage (http://www.psychocats.net/ubuntu/partimage)

pinguino99
January 22nd, 2009, 02:38 PM
Have a look at partimage (http://www.psychocats.net/ubuntu/partimage)

Thanks for the reply...
Partimage seems more to be a backup/restore tool for partitions.
My request is a bit different : backup an ubuntu installation, and restore it to a different pc / hard disk...

Kevbert
January 22nd, 2009, 02:55 PM
If the PC hardware is exactly the same cloning should be fine, but if you want to just make sure you have all the same packages installed on each computer you could try this in terminal on computer one:

sudo dpkg --get-selections > filelist.txt

This makes a package list (filelist.txt) which you want to copy to the new PC (which you've already installed Ubuntu). Now to install all packages:

sudo dpkg --clear-selections
sudo dpkg --set-selections < filelist.txt
sudo aptitude install dselect-upgrade

The other method would be to produce your own installation CD. (https://help.ubuntu.com/community/InstallCDCustomization)
This may be of use (http://www.justlinux.com/forum/showthread.php?threadid=149328%27) - you'll need to recreate the mbr and grub via the live-CD.
Hope this is of use.

pinguino99
January 22nd, 2009, 03:04 PM
If the PC hardware is exactly the same cloning should be fine, but if you want to just make sure you have all the same packages installed on each computer you could try this in terminal on computer one:

sudo dpkg --get-selections > filelist.txt

This makes a package list (filelist.txt) which you want to copy to the new PC (which you've already installed Ubuntu). Now to install all packages:

sudo dpkg --clear-selections
sudo dpkg --set-selections < filelist.txt
sudo aptitude install dselect-upgrade

The other method would be to produce your own installation CD. (https://help.ubuntu.com/community/InstallCDCustomization)
Hope this is of use.

Ok, but your solutions requires that i install and configure ubuntu, update it, and then download/install (and in some cases configure) packages. Moreover i uses some non free software (Lotus Notes, for example) that needs to be installed and there is no repo.
I thought there was a solution that i can backup the whole disk/partitions content, and restore it in another computer if with smaller disk.
If PC is the same i could use clonezilla or some "ghost-image" tool. But i would deploy a high number of ubuntu installations on different computers. So a tool for quickly "clone" a working ubuntu pc would be great.
Anyway, thanks a lot for the interest and the reply.

Kevbert
January 22nd, 2009, 03:06 PM
See last link that I've just added in previous post, it may be a better solution.

pinguino99
January 22nd, 2009, 03:38 PM
See last link that I've just added in previous post, it may be a better solution.

Thanks again...
But the link you gave me maybe is not very helpful.
It says :
How to migrate XP, Vista, Linux, BSD and Solaris to a bigger hard disk

but if i have smaller hard disks ?!?

boof1988
January 22nd, 2009, 05:27 PM
Hello all,
I have an ubuntu installation on a PC, let's call it PC1, and its hard disk DISK1 250 GB, partitioned by ubuntu installer. Only 20GB are used.
I have PC2, with DISK2 smaller (160GB) and i would like to "clone" PC1 to PC2.
Is it possibile ? How ?
I tried clonezilla ... but no success.
My aim will be have PC2 with ubuntu in a similar way PC1 is.
I work in IT on a company and I would like to easily prepare PC without installing and configuring everything.
Any suggestion ?
Thanks to all !!
Pinguino99

How about Remastersys (http://www.remastersys.klikit-linux.com/)? Would it do what you need?

Kevbert
January 22nd, 2009, 06:14 PM
Thanks again...
But the link you gave me maybe is not very helpful.
It says :
How to migrate XP, Vista, Linux, BSD and Solaris to a bigger hard disk

but if i have smaller hard disks ?!?

It's the method that you want, the size of the hard disk is pretty irrelevant as you want to copy all information from one disk to another.

pinguino99
January 23rd, 2009, 09:11 AM
It's the method that you want, the size of the hard disk is pretty irrelevant as you want to copy all information from one disk to another.

Ok, i will take a look and try to follow your suggestion and also the remastersys option.
Honestly i thought it would be easier.
I'll write down the results.
Thanks again to all.

jamesande
January 23rd, 2009, 01:36 PM
This may be of use (http://www.justlinux.com/forum/showthread.php?threadid=149328%27)


thanks heaps that was really helpful

rzrgenesys187
January 23rd, 2009, 04:30 PM
I read about this page a while ago. May not be exactly what you are looking for but may be useful http://codepoets.co.uk/docs/system_imaging.

Basically it involves using dd to to a bitwise copy of whatever you want. You can then restore this image to a different partition

macvr
March 10th, 2009, 02:01 PM
i used to use the dselect package as was given above...

but i found this in the #ubuntu irc... just type " !clone " in the irc

i think that this is better since there is no need to install the dselect package , and it just uses the aptitude... :D

To replicate your packages selection on another machine (or restore it if re-installing), you can type

$aptitude --display-format '%p' search '?installed!?automatic' > ~/my-packages
move the file "my-packages" to the other machine, and there type

$sudo xargs aptitude --schedule-only install < my-packages ; sudo aptitude install



also this is an easy option> http://ubuntuforums.org/showpost.php?p=6660813&postcount=1

pinguino99
May 13th, 2009, 09:25 AM
To replicate your packages selection on another machine (or restore it if re-installing), you can type

$aptitude --display-format '%p' search '?installed!?automatic' > ~/my-packages
move the file "my-packages" to the other machine, and there type

$sudo xargs aptitude --schedule-only install < my-packages ; sudo aptitude install



Thanks but... remember that not all applications installed comes from repos. SAP Gui (and all java apps) for example, or Lotus Notes.
Or MS Office 2003, through wine.

I tried remastersys and ... i am impressed because it really works.
Creating the .ISO, burn it, and then install it to another different pc.
Really seems to work flawlessly.

Thanks to all, very helpful.

black_shadow
May 13th, 2009, 01:39 PM
Hi

Even Easier if you have the second hard drive in your PC is

http://www.linux.com/learn/tutorials/8225-clone-your-ubuntu-installation-onto-a-new-hard-disk

Mike

theozzlives
May 13th, 2009, 01:43 PM
Use remastersys, I don't remember the link but do a google, it's the klikit one.