Results 1 to 8 of 8

Thread: [SOLVED] Cloning a Disk with multiple partitions

  1. #1
    Join Date
    Apr 2008
    Beans
    89

    [SOLVED] Cloning a Disk with multiple partitions

    I need a way to create a backup such that If I start with a blank hard drive with no partitions, I can restore my backup to it. After the restore the new hard drive will have the ext2 partitions and the ntfs partition from the original drive. I can't just use something like gparted and just copy and paste from one drive to the other because my intent would be to apply it to the same drive after I break it. I like experimenting with different forms of bootable live USB drives but they don't always work and I may prefer to go back to a previous state for the drive.

    Thanks

    P.S. I forgot to mention that I've tried partimage and I love it, but I don't think it will backup multiple partitions into one file. Though, I hope I'm wrong about that, I would prefer just to use partimage.

  2. #2
    Join Date
    Oct 2007
    Location
    United Kingdom
    Beans
    762
    Distro
    Ubuntu 9.10 Karmic Koala

    Re: Cloning a Disk with multiple partitions

    See here for an explanation on how to clone an entire disk, partition table and all partitions included. (I think partimage focusses on imaging partitions rather than entire disks, so probably isn't entirely suitable for your purposes.)
    "Python, the language that wraps itself around a problem to squeeze out a solution, swallowing it whole."
    Linux user number #14284
    "A journey of a thousand miles begins with a single step." - Confucius.

  3. #3
    Join Date
    Apr 2008
    Beans
    89

    Re: Cloning a Disk with multiple partitions

    Thanks
    I found dd.
    I believe what I want to do is:
    $ sudo dd /dev/sde | gzip > /media/400/16GB.gz

  4. #4
    Join Date
    Oct 2007
    Location
    United Kingdom
    Beans
    762
    Distro
    Ubuntu 9.10 Karmic Koala

    Re: Cloning a Disk with multiple partitions

    Quote Originally Posted by JohnGalt131 View Post
    Thanks
    I found dd.
    I believe what I want to do is:
    $ sudo dd /dev/sde | gzip > /media/400/16GB.gz
    Very nearly, it should be like this:

    Code:
    sudo dd if=/dev/sde | gzip >/media/400/16GB.gz
    To restore:

    Code:
    zcat /media/400/16GB.gz | dd of=/dev/sde
    "Python, the language that wraps itself around a problem to squeeze out a solution, swallowing it whole."
    Linux user number #14284
    "A journey of a thousand miles begins with a single step." - Confucius.

  5. #5
    Join Date
    Mar 2008
    Location
    California, USA
    Beans
    8,111

    Re: Cloning a Disk with multiple partitions

    JohnGalt131, I think you would be interested in this thread that also uses "dd" to image a HDD; but by choosing the block size to be 512 bytes (same as your HDD sector size), and saving your partition table with "sudo fdisk -lu", it is possible to restore just a single partition from the entire HDD image if you want to. So it basically gives extra functionality over just a simple dd backup where block size is not set, because then the only choice is to restore the entire HDD.

  6. #6
    Join Date
    Aug 2007
    Location
    Bulgaria
    Beans
    271
    Distro
    Ubuntu 12.04 Precise Pangolin

    Re: [SOLVED] Cloning a Disk with multiple partitions

    OK, I am interested - can I clone 2 partitions. Let`s say I have /dev/sda but sda has sda1 sda2 sda3. By cloning sda I`ll get a raw clone of everything so if the hdd is 500 G and the OS I want to clone is 80... like what? I`ll have 500Gb image?
    ubuntu - humanity for me and for you

  7. #7
    Join Date
    Feb 2007
    Beans
    23,847
    Distro
    Ubuntu 16.04 Xenial Xerus

    Re: [SOLVED] Cloning a Disk with multiple partitions

    From the Ubuntu Forums Code of Conduct.
    If a post is older than a year or so and hasn't had a new reply in that time, instead of replying to it, create a new thread. In the software world, a lot can change in a very short time, and doing things this way makes it more likely that you will find the best information. You may link to the original discussion in the new thread if you think it may be helpful.
    Thread closed.

  8. #8
    Join Date
    Oct 2006
    Location
    Ayrshire.
    Beans
    48,513
    Distro
    Ubuntu Development Release

    Re: [SOLVED] Cloning a Disk with multiple partitions

    Old thread closed.

    Have a look at Clonezilla, and feel free to start a fresh thread.

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •