Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have a work-computer with Win7 but I'd like to use Ubuntu. At some point I will have to give back that computer as it was - with Win7 on it.

What I'd like to do:

  1. Clone(?) or backup somehow windows as it is right now on that computer and store the clone, .img or whatever it might be.
  2. Do a fresh Ubuntu install on it.
  3. Restore the state as of today with Win7 when I have to give back the pc at some point in future.

I've found following tutorial (

Create disk image

  1. Boot from a liveCD or liveUSB.

  2. Make sure no partitions are mounted from the source hard drive.

  3. Mount the external HD

  4. Backup the drive.

     dd if=/dev/hda conv=sync,noerror bs=64K | gzip -c  > /mnt/sda1/hda.img.gz`
  5. Save extra information about the drive geometry necessary in order to interpret the partition table stored within the image. The most important of which is the cylinder size.

    fdisk -l /dev/hda > /mnt/sda1/

NOTE: You may wish to use a block size (bs=) that is equal to the amount of cache on the HD you are backing up. For example, bs=8192K works for an 8MB cache. The 64K mentioned in this article is better than the default bs=512 bytes, but it will run faster with a larger bs=. Restore system

To restore your system:

    gunzip -c /mnt/sda1/hda.img.gz | dd of=/dev/hda

Is that the way to do it? Or is there a better way?

I see three partitions on the system now: SYSTEM_DRF, Windows7_OS, and Lenovo_Recovery. Could I also only copy the Lenoveo_Recovery partition and then rebuild the system from there?

share|improve this question

migrated from Nov 29 '12 at 5:22

This question came from our site for professional and enthusiast programmers.

Perhaps this should be on SuperUser or AskUbuntu. – SuperDisk Nov 29 '12 at 0:58
yes, I was not really sure where to post it. Can I migrate this question to eg. AskUbuntu? – Philippe Nov 29 '12 at 1:04
up vote 0 down vote accepted

There are a couple of other ways.

  1. Clonezilla is a popular tool for creating and restoring disk images. You could let it handle the details of the clone/restore operation.

  2. You could resize the Windows partion out of the way and then dual-boot Ubuntu.

    Resize the Windows partition to be small, and then create new partition(s) for Ubuntu in the free space -- the Ubuntu installer should be able to do this for you. If you back up the MBR beforehand (first 512 bytes of the disk) you should be able to restore the computer to its original condition by deleting the Ubuntu partitions, resizing the Windows partition back to full size, and restoring the Windows MBR. (The MBR can also be restored using a Windows CD, if you have one.)

    If you don't want to deal with the MBR, have GRUB (the Linux boot loader) install to the Ubuntu partition, not to the MBR. You should then be able to set up GRUB to be loaded as an option in the standard Windows boot loader. It's pretty easy with NTLDR (used through Windows XP), but I don't know about Windows Vista/7/8.

I would not assume you can recover the system from the recovery partition; your company has probably made subsequent modifications to the system.

share|improve this answer

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .