Announcement

Collapse
No announcement yet.

I want to relocate my main Kubuntu - a partitioning question

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

    [SOLVED] I want to relocate my main Kubuntu - a partitioning question

    I have three *buntu's on my laptop. My main is Kubuntu 12.04, and it is on /dev/sda7 (root) and /dev/sda8 (/home). I want to delete the *buntu on /dev/sda5 (root) and /dev/sda6 (/home) and move or copy (part of this question) to those two partitions. Obviously, when completed, I want Grub to know that the OS has been moved, and to where. Oh, and I want the partitioning to report the moved Kubuntu as /dev/sda5 and /dev/sda6 after the move/copy.

    I tend to over think things, and likely I'm doing so here. What do I do to accomplish what I want?
    Windows no longer obstructs my view.
    Using Kubuntu Linux since March 23, 2007.
    "It is a capital mistake to theorize before one has data." - Sherlock Holmes

    #2
    First thaught: rsync oldPart to newPart, update-grub, fix fstab, fix a million other things, then format drive and start from scratch.
    Actually, I don't have a clue, but here is my plan.
    I've been running 12.04 on sda6 which is only 12 gigs. (too small)
    At end of April I plan to download final release, Do fresh install on sda3 which is 20Gigs (big enough). symlink Music, Pictures, etc to folders I KEEP on /data partition. Then sda6 will be available for some other testing.

    I am curious to see what you end up doing, but for this lame brain the quick way usually ends up being the bad way.

    Curious Ken.
    Opinions are like rear-ends, everybody has one. Here's mine. (|)

    Comment


      #3
      Live on the edge, I say. Or at least the cloudy edge. Here's what I do locally...

      * 30 GiB for / (on /dev/sda1)
      * size-of-RAM + 1 GiB for swap (on /dev/sda2) [good guideline for laptops]
      * remainder for /home (on /dev/sda3)

      /home has two purposes: (1) be the place for config files; (2) be a non-authoritative copy of documents/music/pics/movies.

      Install davfs2. Create a Box.com folder in /home/$USER. In /etc/fstab, mount your Box.com WebDAV URL to that folder.

      Install luckybackup. Create a Box.local folder in /home/$USER. Configure Lucky Backup to automatically sync from Box.com to Box.local every 30 minutes.

      I just set this up today on my T520. Works great.

      Comment


        #4
        Examples: http://www.kubuntuforums.net/showthr...kubuntu-system
        Have you tried ?

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

        Comment


          #5
          The easiest way would be to resize the last two partitions, though wont achieve exactly what you want (though you shouldn't really need to worry about the partition numbers).

          To do it how you want you need to copy the data across to the other drives repetitively, this can be done with dd or any other file copying util (ie rsync).

          This should be done from a livecd or operating system that's not involved in the move.
          Note that this is quite dangerous (as is anything when you mess with partitions) and could render your system unbootable or lose all your data.

          dd is generally easier if the drive you are moving to is the same size or larger, but gets complicated if its smaller;
          Code:
          sudo dd if=/dev/sda7 of=/dev/sda5 # Make sure you get the drive numbers correct or you will lose data
          However, with this method you will need to delete the old partitions, or edit /etc/fstab to not use UUIDs as dd will copy them over as well give you two drive with the same UUID (which will confuse the mount tools).

          rsync is generally quicker if the drive isn't full as it needs to copy across less data, but you normally have to edit /etc/fstab in order for it to boot.
          First format the drive to what ever partition you want;
          Code:
          sudo mkfs.ext4 -L DISKLABEL /dev/sda5 # -L DISKLABEL is optional but gives the drive a label
          then mount both drives
          Code:
          sudo mkdir -p /mnt/old /mnt/new
          sudo mount /dev/sda5 /mnt/new
          sudo mount /dev/sda7 /mnt/new
          Then copy the filesystem across
          Code:
          sudo rsync -avhP /mnt/old/ /mnt/new/
          Repeat for your home dive.

          Then for both methods check fstab and see if anything needs to change (you usually have to change something if you do the second method). Use
          Code:
          sudo bldid -c /dev/null
          to find out the new UUID's for the drives.
          Finally reinstall grub to the new partition.

          Until you delete the old partitions (/dev/sda{7,8}) you should still be able to boot them (possibly by reinstalling grub again)

          Comment


            #6
            Originally posted by Snowhog View Post
            I have three *buntu's on my laptop. My main is Kubuntu 12.04, and it is on /dev/sda7 (root) and /dev/sda8 (/home). I want to delete the *buntu on /dev/sda5 (root) and /dev/sda6 (/home) and move or copy (part of this question) to those two partitions. Obviously, when completed, I want Grub to know that the OS has been moved, and to where. Oh, and I want the partitioning to report the moved Kubuntu as /dev/sda5 and /dev/sda6 after the move/copy.

            I tend to over think things, and likely I'm doing so here. What do I do to accomplish what I want?
            You don't say what your sizes are or what you're really trying to accomplish by doing this but:

            1. You could use a live GParted CD to do exactly what you state. I have done a similar task in the past without problems but it will take some time.
            2. If the partitions are the same size you could use dd to copy the entire partitions. This works best if the partitions are exactly the same size.

            As far as the partition numbering, it depends again on what your desired end results are. I assume you're looking to consolidate the space currently held by sda7 and 8 into something larger.

            grub should fix itself well enough with update-grub. Personally, I would do this from a liveUSB or CD. When data move is complete, use the liveUSB/CD to reset grub. Or you could also easily enough do a one-time manual edit of the /boot/grub/grub.cfg and inset the new partition numbers/UUID's it you create any. Then once booted to the new location, run udate-grub. I think if you use Gparted live or dd to move the data, the UUID's will be intact.

            Please Read Me

            Comment


              #7
              Originally posted by oshunluvr View Post
              I think if you use Gparted live or dd to move the data, the UUID's will be intact.
              Which can cause problems if you don't delete the old partitions as there will then be two drives with the same UUID.

              Comment


                #8
                Originally posted by james147 View Post
                Which can cause problems if you don't delete the old partitions as there will then be two drives with the same UUID.
                Very true. If you wanted to keep the old partitions intact, you could change the UUID of sda7/8.

                Please Read Me

                Comment


                  #9
                  Originally posted by SteveRiley View Post
                  Live on the edge, I say. Or at least the cloudy edge. Here's what I do locally...

                  * 30 GiB for / (on /dev/sda1)
                  * size-of-RAM + 1 GiB for swap (on /dev/sda2) [good guideline for laptops]
                  * remainder for /home (on /dev/sda3)

                  /home has two purposes: (1) be the place for config files; (2) be a non-authoritative copy of documents/music/pics/movies.

                  Install davfs2. Create a Box.com folder in /home/$USER. In /etc/fstab, mount your Box.com WebDAV URL to that folder.

                  Install luckybackup. Create a Box.local folder in /home/$USER. Configure Lucky Backup to automatically sync from Box.com to Box.local every 30 minutes.

                  I just set this up today on my T520. Works great.
                  And while I'm at it, just write down the proof to the Unified Theory and collect the Noble Prize!
                  Windows no longer obstructs my view.
                  Using Kubuntu Linux since March 23, 2007.
                  "It is a capital mistake to theorize before one has data." - Sherlock Holmes

                  Comment


                    #10
                    Originally posted by oshunluvr View Post
                    You don't say what your sizes are or what you're really trying to accomplish by doing this but:
                    All three OS's are setup with partitioning that is the same: 15GB for root and 50GB for /home. My swap partition, 4GB, is on /dev/sda1.

                    It's an aesthetics issue only. I would prefer that my partitioning numbering reflect the physical configuration of the HDD. So, swap remains as /dev/sda1, and the relocated root would be reported as /dev/sda5 and /home as /dev/sda6 (obviously, I have an extended partition occupying /dev/sda2, and everything except swap occupies logical partitions).

                    If I 'move' both partitions: /dev/sda7 and /dev/sda8; to the nuked /dev/sda5 and /dev/sda6 partitions, then they retain their partition numbering - 7 and 8, even though they would then occupy partitions 5 and 6. If I copy them instead, will they then inherit the partition numbers they are copied into?
                    Windows no longer obstructs my view.
                    Using Kubuntu Linux since March 23, 2007.
                    "It is a capital mistake to theorize before one has data." - Sherlock Holmes

                    Comment


                      #11
                      Originally posted by Snowhog View Post
                      If I 'move' both partitions: /dev/sda7 and /dev/sda8; to the nuked /dev/sda5 and /dev/sda6 partitions, then they retain their partition numbering - 7 and 8, even though they would then occupy partitions 5 and 6. If I copy them instead, will they then inherit the partition numbers they are copied into?
                      If you copy the contents of the partitions (with dd or rsync or any other tool that doesn't just move the partitions) then they will use the new numbers as you are moving the data on the partition and not the partition itself. Using dd will copy the whole file system (which doesn't store the partition number, but dose store the UUID of the filesystem) where rsync will only copy the data to a new file system (so the partition number and UUID will change).

                      Comment


                        #12
                        fdisk can easily correct the partition numbering. Look at the "Advanced" menu.

                        Please Read Me

                        Comment


                          #13
                          Thanks oshunluvr.

                          My new Seagate Expansion USB 3.0 1TB HDD arrived today. For the moment, just used Clonezilla 1.2.12-37 to clone the laptop HDD to it. Always want to have a full backup clone 'just in case'.
                          Windows no longer obstructs my view.
                          Using Kubuntu Linux since March 23, 2007.
                          "It is a capital mistake to theorize before one has data." - Sherlock Holmes

                          Comment


                            #14
                            Done. Not as cleanly as I wanted, but done. Turns out that using Clonezilla to restore the backup to a different partition number results in grub being rebuilt with the new partitions UUID, so I just had to restore my /dev/sda7 and /dev/sda8 backups to /dev/sda5 and /dev/sda6.
                            Windows no longer obstructs my view.
                            Using Kubuntu Linux since March 23, 2007.
                            "It is a capital mistake to theorize before one has data." - Sherlock Holmes

                            Comment


                              #15
                              Originally posted by Snowhog View Post
                              Done. Not as cleanly as I wanted, but done. Turns out that using Clonezilla to restore the backup to a different partition number results in grub being rebuilt with the new partitions UUID, so I just had to restore my /dev/sda7 and /dev/sda8 backups to /dev/sda5 and /dev/sda6.
                              Sounds pretty easy though! No headaches, just a little time...

                              Please Read Me

                              Comment

                              Working...
                              X