Whiskey Kilo Linux  •  Exploring GNU/Linux and F/OSS
styline.jpg

Monday 6th February 2012

drupal member logo

drupal logo

ubuntu logo

gnome logo

opensource logo

Clone an Ubuntu PC with partimage

My employer replaced a bunch of old Compaq ENS pentium III 1000Mhz pc's with new ones. Usually these old pc's are offered to employees without an operating system for a small fee. Not a very attractive offer if you ask me, so i decided to install Ubuntu Edge Eft on all of them. But how do you clone one pc into thirty or so more? Partimage to the rescue!

Compaq ENS pentium III 1000Mhz

First i installed Edgy Eft on the master pc. I also installed automatix2 and a bunch of extra packages like inkscape and scribus. I changed /etc/fstab so that the device files are used instead of the UUID (these change when you make new partitions). Then i installed the partimage package on the master and on my server. For some reason i was unable to let the master partimage talk to the server partimaged. Something to do with authentication. Because security on my internal network isn't an issue i installed the static binaries from the Partimage site on my server and booted the client with SystemResueCD.

I decided that all pc's would have a 500MB swap partition on /dev/hda1 and a large ext3 partition on /dev/hda2 (9.5GB on the master pc). Here's what i did next.

On the server i stopped (as root) the Ubuntu version of partimaged and started the static binary version in partimaged in my home directory:

/etc/init.d/partimaged stop
cd ~
./partimage

On the master pc i booted SystemResueCD and started partimage. wildcat is the name of my server:

partimage -s wildcat save /dev/hda2 edgy

It took a little over 15 minutes to copy and compress 2.2GB of data to the server. Next i replaced the harddisk in the master pc for a new one, booted the SystemResueCD again, deleted all partitions with cfdisk and made a 500MB swap partition on /dev/hda1 and a large ext3 partition on /dev/hda2 (10GB). Now it is time prepare the swap partition to restore the data.

mkswap -c /dev/hda1
partimage -s wildcat restore /dev/hda2 edgy.000

This took a little under 4 minutes. Impressive! In order to boot the new harddisk i degraded the /dev/hda2 partition from ext3 to ext2, did a file system check, resized the partition and upgraded to ext3 again and installed grub:

tune2fs -O ˆhas_journal /dev/hda2
e2fsck -f -y /dev/hda2
resize2fs -p /dev/hda2
tune2fs -j /dev/hda2

grub
root (hd0,1)
setup (hd0)
quit

And voila! A new Ubuntu Edgy Eft pc is born. Making the next clone should be possible well within 10 minutes. Another 28 to go :-)

Tags:

Post new comment

The content of this field is kept private and will not be shown publicly.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd>
  • Lines and paragraphs break automatically.
  • You may link to images on this site using a special syntax

More information about formatting options

CAPTCHA
This question is used to make sure you are a human visitor and to prevent spam submissions.
Image CAPTCHA
Copy the characters (respecting upper/lower case) from the image.