Announcement

Collapse
No announcement yet.

Can I clone a bootable install partition?

Collapse
This topic is closed.
X
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Can I clone a bootable install partition?

    I am on Feisty and want to upgrade to Gutsy but am afraid of loosing the Feisty install in the process since it has many customizations and /home is not on a separate partition. Is it possible to create a bootable clone of that partition, perhaps with partimage, which would appear on my grub menu. I have a dual boot with Feisty and win2000 and a virtualbox win2000 VM and plenty of disk space for the clone partition.

    #2
    Re: Can I clone a bootable install partition?

    I have only tried one thing – using the dd command to backup my Kubuntu root partition to my /home partition (as a file), and it works (to restore in an emergency). I don't see why you couldn't simply clone the whole show—including your embedded /home. The rule in this image/clone game is to carefully, safely experiment, try it, before you actually need it.

    I have a friend who uses Partimage to backup his OS partitions, and can restore them in 4-6 minutes.

    Recommend experimenting!

    How I did my root partition clone (and there's references):
    dd Command
    http://kubuntuforums.net/forums/inde...opic=3090824.0
    An intellectual says a simple thing in a hard way. An artist says a hard thing in a simple way. Charles Bukowski

    Comment


      #3
      Re: Can I clone a bootable install partition?

      I am certainly going to clone my root feisty partition for backup, but it would certainly be very useful to have a clone of the partition so I could boot up and go to the many links on upgrading etc that I have collected in case of trouble.

      Comment


        #4
        Re: Can I clone a bootable install partition?

        If you look at the link, there's a now famous reference to AwesomeMachine's how-to on the dd command, where he does the clones.

        I'm not sure if we are saying the same thing here, but if you copy that whole partition (using dd or the special DoD version of dd on the Helix Live CD) or you use Partimage, then copy that image to a partition, it should be bootable. I copy the whole sdbx Kubuntu partition, then restore it, then it just boots (GRUB is in place, the whole show).

        As you know, your application settings are in your /home. In my case, that /home is on a separate partition, yet the restored image partition “hooks” right up with it and runs great upon restore/re-boot. In your case, the whole show is on the one partition where your Kubuntu root files are; so, again, seems it should work. Won't take very long to test it.

        Now, of course, as I'm sure you know, the only thing is making sure it is bootable. In my case, GRUB is installed to the MBR of the BIOS first-boot drive and it points to the Kubuntu partition (that I have cloned). You must have some BIOS-boot mechanism "pointing" at the bootable Kubuntu partition so it will actually boot.
        An intellectual says a simple thing in a hard way. An artist says a hard thing in a simple way. Charles Bukowski

        Comment


          #5
          Re: Can I clone a bootable install partition?

          Of course, if you clone the MBR, along with the partition, then the bootability is ensured; e.g., when you clone a bootable flash drive (the whole thing), the result is bootable.
          An intellectual says a simple thing in a hard way. An artist says a hard thing in a simple way. Charles Bukowski

          Comment


            #6
            Re: Can I clone a bootable install partition?

            In my case win2000 is in /hda1 and Feisty is in /hda3. Do you think the grub info will be reset so when I boot up, the new bootable "installation" will show up in the grub boot menu?

            Comment


              #7
              Re: Can I clone a bootable install partition?

              Let's say you clone your hda3 Feisty.
              And you put it into hdaX.
              Your existing GRUB menu (that comes from hda3) will not know about your second (cloned ) Kubuntu on hdaX; so you'll have to edit the menu.lst (in hda3) to include the OS in hdaX.

              Now, worst case, you upgrade hda3, it messes up, you don't like it, and EVEN the GRUB boot menu is messed up in hda3 (which probably will not happen). Even then, you could go in there (with the Kubuntu Live CD) and re-install GRUB to the MBR to point at a new GRUB menu.lst in hdaX and continue to use hdaX. Or, write the hda3 clone-image right back into hda3! Save that image somewhere safe, to write it right back where it belongs.

              There's always details, and best to think them through. Like when you create a new partition, your fstab on hda will not know about it, so you might get an error message upon re-booting, but then you just go in there and fix things (somehow!).

              How To GRUB Methods - Toolkit
              http://kubuntuforums.net/forums/inde...opic=3081671.0
              An intellectual says a simple thing in a hard way. An artist says a hard thing in a simple way. Charles Bukowski

              Comment


                #8
                Re: Can I clone a bootable install partition?

                I tried two things this morning. Both worked.

                #1 GParted (using Partition > Copy, then Partition > Paste)
                I had Kubuntu 7.10 set up & customized in sda5 with my home also included in sda5 (I.e., not in a separate partition).
                Made another partition, exact same size and ext3 format for sda6.
                Started up GParted Live CD, copied sda5 to sda6.
                Re-boot.
                Booted into sda6 manually by pressing the “c” key at the boot menu, then
                root (hd0,5)
                configfile /boot/grub/menu.lst
                (I also did it a second time by direct kernel boot using TAB completion.)
                (Later, you can add the new OS in (hd0,5) into the menu.lst on sda5.)

                And everything in sda6 was just as it is in sda5.


                #2 Use dd to make a backup image file of sda5, mess up sda5, then restore sda5:

                In sda5, using GParted, I created a data partition sda7, larger than sda5, also ext3.
                I made a backup copy of sda5 in sda7 as a file I called sda5image:
                sudo mkdir /media/sda7
                sudo mount /dev/sda7 /media/sda7
                sudo dd if=/dev/sda5 of=/media/sda7/sda5image bs=4096 conv=noerror,notrunc
                (took 6 minutes)

                Back in GParted, I “destroyed” sda5 by reformatting sda5 (again, as ext3) (and checked that by trying to re-boot back into sda5 and failing to do so).

                Used the Kubuntu Live CD to restore the sda5 Kubuntu 7.10 operating system back to sda5:
                In Live CD
                sudo mkdir /media/sda7
                sudo mount /dev/sda7 /media/sda7
                sudo dd if=/media/sda7/sda5image of=/dev/sda5 bs=4096 conv=noerror,notrunc

                Re-boot into sda5 to test that it worked (my “old” existing GRUB boot menu worked to do that).
                No problems. All my custom settings/apps were OK.

                So, there's a couple ways to get at this sort of problem. I like #2 (use dd to make a backup image of the OS).

                Partimage is another option. It's included with GParted Live CD (in GParted, close the window showing the disk/partitions, then right-click on the main GParted screen, and select partimage).

                ahurd—I should add a Disclaimer, though. Seriously, I am not a “clone-image” expert of any sort. I've just messed with dd a bit, and today with GParted (which, btw uses dd, and it also checks the filesystems as it goes). I know guys that make a career out of backups like this. I use dd with success, but there can be problems now and then. Please proceed at your own risk



                An intellectual says a simple thing in a hard way. An artist says a hard thing in a simple way. Charles Bukowski

                Comment


                  #9
                  Re: Can I clone a bootable install partition?

                  Thank you very much, Qqmike, for all your help. I will be trying one of your methods fairly soon.

                  Comment


                    #10
                    Re: Can I clone a bootable install partition?

                    http://www.debianadmin.com/backup-an...partimage.html

                    Looks like a decent reference on Partimage (which I haven't yet had time to look into, but thought you or someone might like to have it).


                    An intellectual says a simple thing in a hard way. An artist says a hard thing in a simple way. Charles Bukowski

                    Comment


                      #11
                      Re: Can I clone a bootable install partition?

                      See Reply #2 under the dd Command How-To:

                      http://kubuntuforums.net/forums/inde...2562#msg112562

                      (it's all there, in detail, exactly as I've done it in various experiments)
                      An intellectual says a simple thing in a hard way. An artist says a hard thing in a simple way. Charles Bukowski

                      Comment

                      Working...
                      X