Results 1 to 4 of 4

Thread: copying logical partition

  1. #1
    Join Date
    Mar 2009
    Beans
    83

    copying logical partition

    I have an install on say sda6. I would like to 'copy" this to say sda8.
    The reason, is to have a working backup of the partition, so if I do an upgrade or install new app, and it fails, I could always boot to working copy (ala time machine almost) But I believe since their are uids used in many places, not too mention boot loader, this is not possible?

    swap is on its own partition.

  2. #2
    Join Date
    Sep 2012
    Location
    Gnome12o4/14o4
    Beans
    Hidden!

    Re: copying logical partition

    One way you can do this is with clonezilla.

    And your right, you must change the uuid after you clone or it will reak havock with the original.

    http://www.googlubuntu.com/results/?...Search&lang=en

  3. #3
    Join Date
    Jun 2006
    Location
    UK
    Beans
    Hidden!
    Distro
    Ubuntu 14.04 Trusty Tahr

    Re: copying logical partition

    Quote Originally Posted by pjmlmas View Post
    I have an install on say sda6. I would like to 'copy" this to say sda8.
    The reason, is to have a working backup of the partition, so if I do an upgrade or install new app, and it fails, I could always boot to working copy (ala time machine almost) But I believe since their are uids used in many places, not too mention boot loader, this is not possible?
    This is easily done, and moreover can be done with a simple file copy using the terminal command "cp". Ignore the naysayers who say it is not possible using cp. I have done something similar many times. But you are right - you must take into account the UUID of sda8.

    This is what I would do, and I am assuming that you have already formatted sda8 with the same filesystem as sda6 (ext3 - ext3; ext 4 - ext4) and that it is empty. I'm also assuming that sda6 is your working installation and that is what you boot into at present.

    1. Boot up with a live CD or live USB. You cannot copy the contents of sda6 while you running a system which is on sda6.

    2. Mount sda6 and sda8. For illustration I'll assume you've mounted sda6 on /media/sda6 and sda8 on /media/sda8. Adjust the commands below as appropriate. Run:

      Code:
      sudo cp -av /media/sda6/* /media/sda8/
      The -a option ensures a recursive copy with all ownerships, permissions, attributes preserved. The -v option reassures you that something is going on since this will take a little while!

    3. Now run:

      Code:
      sudo blkid
      ... to determine the UUID of sda8.

    4. Now:

      Code:
      gksu gedit /media/sda8/etc/fstab
      EDIT: apologies, you are using Xubuntu. Gedit will work with the Ubuntu CD. If you are using a live session of Xubuntu, this should work in lieu of the gedit line:

      Code:
      gksu leafpad /media/sda8/etc/fstab
      END-EDIT

      And edit the root (/) line so that it has the sda8 UUID, not the sda6 one. While you are in /etc/fstab, check that the swap partition UUID is the same as what you saw from blkid. Save and exit.

    5. Reboot. Your sda6 grub menu will not yet have an entry for the sda8 "clone". After you have logged in, run:

      Code:
      sudo update-grub
      This will include an entry for your new sda8 "clone" system. Reboot and choose the sda8 system from the grub menu. It may not be clear which this is - it won't be the first one. If you are unsure, highlight the grub entry you think it is and press 'e' to see which partition it is referring to.

    6. Once you have booted into your sda8 system and checked that everything is working, you can re-install grub with:

      Code:
      sudo grub-install /dev/sda
      sudo update-grub
      When you now reboot, the sda8 installation will be first in the grub menu and the sda6 one will be further down the list.


    Any problems - post back.
    Last edited by coffeecat; November 25th, 2012 at 06:45 PM. Reason: correction

    Please do not PM me about your forum account unless you have been asked to. The correct place to contact an admin about your account is here.

  4. #4
    Join Date
    Mar 2009
    Beans
    83

    Re: copying logical partition

    I am going to try the cp command. clonezilla I need to worry about partitions sizes, not actually usuage.

    If cp works, I could use rsync in the future, and just remember live usb and uuid fix before booting sda8?

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
  •