Announcement

Collapse
No announcement yet.

(SOLVED)Moving installation to another drive/partition

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

    (SOLVED)Moving installation to another drive/partition

    Haven't had a lot of luck searching the board - is there any way to force an AND instead of OR?

    Anyhow, my issue is that I have Oneiric running pretty much how I like, except the drive it's on is too small. I want to move it from sdb5 to sda1 (1TB drive). I tried using Clonezilla but that seemed to try to duplicate the partitions, which left me with the install on the drive I wanted but still in a partition that's too small.

    So the steps I'll need to do (I think) are:

    Partition sda1 to two partitions (ext4 and 10G swap)
    Flag sda1 as boot (sdb currently boot but I've messed it up somehow and need BIOS boot options to get into sdb5)
    copy all from sdb5 to sda1
    run GRUB to set boot (unplug sdb so as not to confuse GRUB?)

    Am I headed in the right direction and can I do the copying with a simple CLI command or do I have to get fancy?

    Thanks!



    #2
    Re: Moving installation to another drive/partition

    dd should work: http://kubuntuforums.net/forums/inde...opic=3090824.0

    But the UUID of the new partitions will be different, so you will have to (using a booted Live CD) edit /etc/fstab and fix it to match the new UUIDs.

    Comment


      #3
      Re: Moving installation to another drive/partition

      Originally posted by enginemusic
      Haven't had a lot of luck searching the board - is there any way to force an AND instead of OR?
      .....
      Search this forum from Google. In the search box enter "site:Kubuntuforums.net " followed by your phrases and boolean logic.
      "A nation that is afraid to let its people judge the truth and falsehood in an open market is a nation that is afraid of its people.”
      – John F. Kennedy, February 26, 1962.

      Comment


        #4
        Re: Moving installation to another drive/partition

        [quote=GreyGeek ]
        Originally posted by enginemusic
        Search this forum from Google. In the search box enter "site:Kubuntuforums.net " followed by your phrases and boolean logic.
        Can't believe I hadn't thought of that, since I just suggested my wife do the same thing on another forum last week.

        Originally posted by dibl
        From the article:
        ... I would not recommend using dd to copy one partition to another; however, people do it.
        ALSO:
        ...dd will copy everything exactly: the filesystem, the Master Boot Record, the bootloader setup...

        I specifically don't want to copy bootloader setup and MBR (I'm still a bit sketchy on these two, more study required) as they are wrong on the source drive. Is it as simple as copying the entire contents over and running grub-install?

        Comment


          #5
          Re: Moving installation to another drive/partition

          Originally posted by enginemusic
          ....
          Can't believe I hadn't thought of that, since I just suggested my wife do the same thing on another forum last week.
          ...,
          Uh oh.... that's the first symptoms of Sometimers! I speak from experience, that symptom plagues me constantly.
          "A nation that is afraid to let its people judge the truth and falsehood in an open market is a nation that is afraid of its people.”
          – John F. Kennedy, February 26, 1962.

          Comment


            #6
            Re: Moving installation to another drive/partition

            For the bootloader, your best bet is to (in a booted Live CD session) mount the partition that holds the OS, and then install grub using the --root-directory=/mnt/target option.

            So, in your live CD session, if the target partition is /dev/sda1, you mount that on the running filesystem:

            Code:
            sudo mkdir -p /mnt/os
            Code:
            sudo mount -t ext4 /dev/sda1 /mnt/os
            Code:
            sudo grub-install --root-directory=/mnt/os /dev/sda
            More guidance is here -- you want Section 4.

            Comment


              #7
              Re: Moving installation to another drive/partition

              Odd aside: with data copied to drive using CloneZilla, partition manager showed sda was a .9TB drive with 450GB used, while Dolphin showed a .9TB drive with 450GB used but indicated that only 5GB was available (the situation that’s on sdb5 where the data came from). Used Partition Manager to shrink then expand partition, Dolphin then read partition correctly had 450GB available.


              Did following from livecd kubuntu:

              Code:
              sudo mkdir -p /mnt/os
              sudo mount -t ext4 /dev/sda1 /mnt/os
              can’t find /dev/sda1 in /etc/fstab or /etc/fstab
              edited fstab with kate to include sda1, removing line that told it root was aufs (cdrom?)
              Code:
              mount /dev/sda1
              mount: according to mtab, aufs is already mounted on /
              mount failed
              edited mtab to include sda1, removing aufs and other sda1 line that referred to it by UUID
              Code:
              sudo mount /dev/sda1
              cannot create link /etc/mtab~
              mount: /dev/sda1 already mounted or / busy
              mount: according to mtab, /dev/sda1 is already mounted on /
              Code:
              sudo mkdir -p /mnt/os
              sudo mount -t ext4 /dev/sda1 /mnt/os
              Cannot create link to /etc/mtab~
              perhaps there is a stale lock file?
              Code:
              sudo mount -t ext4 /dev/sda1 /mnt/os (just because I don’t like taking no for an answer)
              mount: /dev/sda1 already mounted or / busy
              mount: according to mtab, /dev/sda1 is already mounted on /
              Code:
              sudo umount /dev/sda1
              umount: /: device is busy

              So, I'm still stuck. Where'd I go wrong?

              Also, is there any way I can copy a Konsole session other than retyping it?

              Thanks for any and all help.

              Comment


                #8
                Re: Moving installation to another drive/partition

                The problem I see is that you accidentally made sda1 the liveCD think sda1 was root and not the live image on the disc. The best thing to do ts reboot into the kubuntu live CD. Check and see if /dev/sda1 isalready mounted in /mnt or (more likely) /media and umount it if it is. then, you can remount it as /mnt/os to do the grub-install.
                The unjust distribution of goods persists, creating a situation of social sin that cries out to Heaven and limits the possibilities of a fuller life for so many of our brothers. -- Archbishop Jorge Mario Bergoglio of Buenos Aires (now Pope Francis)

                Comment


                  #9
                  (SOLVED)Re: Moving installation to another drive/partition

                  Well hmmm. Just for poops and grins, I booted a Linux Mint 11 CD I had lying around, and re-ran dibl's commands - lo and behold, it worked. Not sure why things were different with the Kubuntu 11 Live distro, but there ya go.

                  It did return one error:
                  grub-probe: error: cannot stat 'aufs'
                  Installation finished. No Error reported.

                  Uh, it just said error, then it said there isn't one (scratches head). Ok.

                  But everything works fine, so this sucka's SOLVED. Thanks guys - especially dibl, who has come to my rescue twice before.


                  Comment


                    #10
                    Re: (SOLVED)Moving installation to another drive/partition

                    And sorry to prattle on so, but I did end up using dd to do the data transfer.

                    I did triple-check that I had my IF and OF named properly!

                    Comment


                      #11
                      Re: Moving installation to another drive/partition

                      Originally posted by enginemusic

                      Did following from livecd kubuntu:

                      Code:
                      sudo mkdir -p /mnt/os
                      sudo mount -t ext4 /dev/sda1 /mnt/os
                      can’t find /dev/sda1 in /etc/fstab or /etc/fstab
                      At this point, seeing that there was confusion on the device identification, what you needed to do was run

                      Code:
                      sudo fdisk -l
                      or

                      Code:
                      sudo blkid -c /dev/null -o list
                      to see a list of the hard drives and partitions. As mention in my earlier post, you need to know the ID of the partition that holds your OS. It would not matter what the Live CD session thinks it is, as long as you can figure it out and use it. Apparently the mint CD did not have whatever issue affected the Kubuntu CD.

                      Good job copying it and installing Grub!

                      Comment

                      Working...
                      X