Announcement

Collapse
No announcement yet.

HOWTO: Copy kubuntu system

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

    HOWTO: Copy kubuntu system

    With two kubuntus you can easily revert kubuntu upgrade. :P

    Tip #1: HOW TO: GRUB Methods - Toolkit
    http://kubuntuforums.net/forums/inde...opic=3081671.0

    Tip #2: Get Super Grub

    Super Grub
    http://supergrub.forjamari.linex.org/
    Super Grub Disk is a bootable cdrom, usb or floppy specially designed for the restore of boot.

    Features
    ...
    Boot Gnu/Linux partition
    ...

    Example: moving/copying kubuntu from hdb1 to the sda1

    Start kubuntu from cd. (Here using: kubuntu dapper cd)

    Choose:Start Kubuntu in safe graphic mode


    Make directories and mount them. In the konsole:

    Code:
    sudo mkdir /media/old
    sudo mount /dev/hdb1 /media/old
    
    sudo mkdir /media/new
    sudo mount /dev/sda1 /media/new

    Copy kubuntu:

    Code:
    sudo rsync -a /media/old/ /media/new
    Note /1/:
    A trailing slash on the source changes this behavior to avoid creating an additional directory level at the destination.

    Now you have two identical kubuntus. Edit /media/new/etc/fstab and /media/new/boot/grub/menu.lst.

    Alt + F2:
    Code:
    kdesu kate /media/new/etc/fstab
    Change fstab from

    Code:
    /dev/hdb1 / ext3 nouser,defaults,errors=remount-ro,atime,auto,rw,dev,exec,suid 0 1
    /dev/hdb6 none swap sw 0 0
    to

    Code:
    /dev/sda1 / ext3 nouser,defaults,errors=remount-ro,atime,auto,rw,dev,exec,suid 0 1
    /dev/sda3 none swap sw 0 0

    Code:
    kdesu kate /media/new/boot/grub/menu.lst
    Change from

    Code:
    kernel		/boot/vmlinuz-2.6.15-27-k7 root=/dev/hdb1 ro quiet splash vga=792
    to

    Code:
    kernel		/boot/vmlinuz-2.6.15-27-k7 root=/dev/sda1 ro quiet splash vga=792

    Making grub to start kubuntu from sda1

    Note from /5/
    2 Naming convention

    The partition numbers are counted from zero, not from one.
    and
    GRUB does not distinguish IDE from SCSI - it simply counts the drive numbers from zero, regardless of their type.
    So in my machine:
    To grub hda1 is (hd0,0), hdb1 = (hd1,0) and sda1 = (hd2,0)
    (I have two pata and one sata)

    In the konsole:
    Code:
    :~$sudo grub
    Checking where is /boot/grub/stage1

    Code:
    grub> find /boot/grub/stage1
    (hd1,0)
    (hd2,0)
    New kubuntu partition is sda1 => (hd2,0)

    Code:
    grub>root (hd2,0)
    Filesystem type is ext2fs, partition type 0x83
    Code:
    grub>setup (hd0)
    Checking if "/boot/grub/stage1" exists... yes
     Checking if "/boot/grub/stage2" exists... yes
     Checking if "/boot/grub/e2fs_stage1_5" exists... yes
     Running "embed /boot/grub/e2fs_stage1_5 (hd0)"... 16 sectors are embedded.
    succeeded
     Running "install /boot/grub/stage1 d (hd0) (hd0)1+16 p (hd2,0)/boot/grub/stage
    2 /boot/grub/menu.lst"... succeeded
    Done.

    Code:
    grub>quit

    Boot and check that everything works.

    If dmesg tells that:
    Unable to find swap-space signature
    In the konsole:
    Code:
    sudo mkswap -c /dev/sda3
    Note/2/:
    mkswap - set up a Linux swap area
    Code:
    sudo swapon -a
    swap ok !
    Note/3/:
    swapon, swapoff - enable/disable devices and files for paging and swapping




    /1/ man rsync
    /2/ man mkswap
    /3/ man swapon
    /4/ man grub
    /5/ GNU GRUB Manual 0.97 (http://www.gnu.org/software/grub/manual/grub.html)
    Before you edit, BACKUP !

    Why there are dead links ?
    1. Thread: Please explain how to access old kubuntu forum posts
    2. Thread: Lost Information

    #2
    Cloning the Kubuntu 12.04 installation

    Example: moving/copying Kubuntu 12.04 from the /dev/sda7 (root) & /dev/sda8 (home) to the /dev/sda11 & /dev/sda12



    I have several Linux installations, using the Kubuntu 11.10 installation to copy the Kubuntu 12.04. This can be done from the Live CD.


    0) UUID

    Code:
    sudo blkid
    ...
    /dev/sda7: LABEL="BetaRoot" UUID="139d9bb1-bec4-4fc8-9fe7-089efcc2747a" TYPE="ext4"
    /dev/sda8: LABEL="BetaHome" UUID="bfcb7fc3-f4fa-404c-a0ad-bd730c3db607" TYPE="ext4"
    ...
    /dev/sda11: LABEL="DeltaRoot" UUID="d2944c21-b834-459f-8151-d34227967c1b" TYPE="ext4"
    /dev/sda12: LABEL="DeltaHome" UUID="c441c10f-dab5-4643-a253-8d39518f822e" TYPE="ext4"
    ...
    1) Making directories and mounting them.

    Konsole:
    Code:
    sudo mkdir -p /media/oldroot
    sudo mount /dev/sda7 /media/oldroot
    
    sudo mkdir -p /media/newroot
    sudo mount /dev/sda11 /media/newroot
    
    sudo mkdir -p /media/oldhome
    sudo mount /dev/sda8 /media/oldhome
    
    sudo mkdir -p /media/newhome
    sudo mount /dev/sda12 /media/newhome
    2) Copying

    Konsole:
    Code:
    sudo rsync -P -a /media/oldroot/ /media/newroot
    
    sudo rsync -P -a /media/oldhome/ /media/newhome

    3) Fixing


    The fstab is having the old UUIDs

    Code:
    kdesudo kwrite /media/newroot/etc/fstab
    # /etc/fstab: static file system information.
    #
    # Use 'blkid' to print the universally unique identifier for a
    # device; this may be used with UUID= as a more robust way to name devices
    # that works even if disks are added and removed. See fstab(5).
    #
    # <file system> <mount point> <type> <options> <dump> <pass>
    proc /proc proc nodev,noexec,nosuid 0 0
    # / was on /dev/sda7 during installation
    UUID=139d9bb1-bec4-4fc8-9fe7-089efcc2747a / ext4 errors=remount-ro 0 1
    # /home was on /dev/sda8 during installation
    UUID=bfcb7fc3-f4fa-404c-a0ad-bd730c3db607 /home ext4 defaults 0 2
    =>

    # / was on /dev/sda11 during installation
    UUID=d2944c21-b834-459f-8151-d34227967c1b / ext4 errors=remount-ro 0 1
    # /home was on /dev/sda12 during installation
    UUID=c441c10f-dab5-4643-a253-8d39518f822e /home ext4 defaults 0 2
    Updating the grub:
    Code:
    sudo update-grub
    Generating grub.cfg ...
    Found background image: /lib/plymouth/themes/my-plymouth/my-wallpaper.png
    Found linux image: /boot/vmlinuz-3.0.0-17-generic
    Found initrd image: /boot/initrd.img-3.0.0-17-generic
    Found linux image: /boot/vmlinuz-3.0.0-16-generic
    Found initrd image: /boot/initrd.img-3.0.0-16-generic
    Found memtest86+ image: /boot/memtest86+.bin
    Found Ubuntu precise (development branch) (12.04) on /dev/sda11
    Found Ubuntu precise (development branch) (12.04) on /dev/sda7
    ...
    The Grub (11.10) is finding the old (/dev/sda7) and the new (/dev/sda11) Kubuntu 12.04. Booting to the 12.04 (new) and reinstalling the Grub:

    Code:
     sudo grub-install /dev/sda
    After this the Grub is from the 12.04 (new).


    Links

    - http://www.kubuntuforums.net/showthr...on-Regenerated
    - https://help.ubuntu.com/community/UsingUUID
    - https://help.ubuntu.com/community/Fstab
    - https://help.ubuntu.com/community/Grub2
    Last edited by OneLine; Apr 17, 2012, 03:41 AM.
    Have you tried ?

    - How to Ask a Question on the Internet and Get It Answered
    - How To Ask Questions The Smart Way

    Comment


      #3
      Awesome how to! Thank you!

      Comment

      Working...
      X