Announcement

Collapse
No announcement yet.

How can I move my install to a different partition and still boot to it?

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

    How can I move my install to a different partition and still boot to it?

    Since I'm a total glutton for punishment, I've decided I "need" to rearrange my partitions and to create a system somewhat more defended against failures.

    My current install resides on a 4-4gb partition RAID0 array. My desire is to remove one of the partitions from the array and use only 3-4gb partitions. However, with RAID0 you can't just "fail" a member.

    So I thought I'd try copying the entire install to a different array and try boot from it. My first try failed with an unresponsive blank screen but it did allow crtl-alt-delete to restart it.

    I copied everything it would allow (the dev files won't) to the new array, changed the UUID's in fstab and grub.cfg. What did I forget or will this even work?

    I will likely end-up doing a new install and moving my config files over but that's always a PITA because I always miss something.

    Please Read Me

    #2
    Re: How can I move my install to a different partition and still boot to it?

    The only time I ever tried that maneuver, I eventually threw in the towel and reinstalled a new system, after losing a day's worth of time trying to patch up the copied OS. The only way I would do it today would be to use clonezilla (which I believe rules out your RAID array) and copy the image to an identical-sized partition. The basic new installation takes only 45 minutes, and of course the post-installation configuration and setup takes many more hours, but the benefit is you need not troubleshoot "mystery" conditions that may be attributable to the process by which the OS was transferred to its new location. That's my two cents' worth on that topic.

    However, since you're clearly seeking a mental challenge, why don't you be the pioneer and try a btrfs RAID0? I installed the OS on a btrfs partition and it went fine (you need a separate /boot partition). I also used mkfs-btrfs to make a btrfs partition elsewhere on my system. So now I want to see happens to your system when a btrfs RAID0 multi-partition filesystem is set.

    https://btrfs.wiki.kernel.org/index....ltiple_Devices

    and

    https://btrfs.wiki.kernel.org/index.php/Gotchas

    Use same-sized partitions!

    Comment


      #3
      Re: How can I move my install to a different partition and still boot to it?

      A long time ago in a galaxy far, far ... or on: November 15, 2006, 05:49:01 am

      > Topic: HOWTO: Copy kubuntu system

      Example: moving/copying kubuntu from hdb1 to the sda1
      1) move the Kubuntu
      2) fix the fstab
      3) fix the grub

      Fstab > How to fstab

      Back then it was with the grub legacy... A good place to start with the grub2 > Topic: GRUB 2: A Guide for Users

      Useful tools for the experiments > Boot Problems Open Source Tools

      Before you edit, BACKUP !

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

      Comment


        #4
        Re: How can I move my install to a different partition and still boot to it?

        That looks like a pretty good way, Rog!

        UUIDs are needed by /boot/grub/grub.cfg -- I think it picks them up from /etc/fstab, so you'll have to set up /etc/fstab to boot "by-UUID", using the UUID of the new partition, then run update-grub.

        Any symlinks to data partitions would be trashed, of course, but that's not too hard to re-do.

        /etc/blkid.tab will be wrong, but you can delete it and it will be reformed the next time you run blkid.

        It still feels like there are other lurking "consequences", but I can't think of any more.

        Comment


          #5
          Re: How can I move my install to a different partition and still boot to it?

          I'm not having trouble with grub-pc or fstab and UUID's - I've got a pretty good handle on that. I'll try the "rsync" method and see how that works.

          BTW: I was under the impression that the UUID's only changed when you re-created or re-formatted a partition. I do have symlinks to data partitions but two are NFS mounts and the other one is to a stand alone partition that won't be changed during this move.

          I also use a stand alone grub-pc partition and manually edit my grub.cfg (because it's easier than relying on update-grub, which frequently fails IMO).

          My target location is not the same size as the source location, so cloning is out - and I doubt it'd take 45 minutes over here! 8) . My current setup has three RAID0 arrays with 4-4gb members each for a total of 16gb. I decided that 16gb was too much wasted space and since I am using RAID0, I'm in danger of losing access to my system if one drive failed. My current plan is to change my 3 RAID0 arrays to 3-4gb members each spread among different drives (each skipping a different drive) and then adding a fourth array using the 3 vacated partitions. This leaves me with 4-12gb arrays. I also have four 12gb partitions (1 per drive) that can be used as backups of the arrays or as stand alone installs.

          Hey - lets be honest - 8 installs? I'm not distro-hopping as much as I used to so it's kinda over-kill even for me. I've been using RAID for performance reasons for about 4 years and I am perturbed about how many installers won't use RAID or even recognize it. If I can't install a distro to RAID without jumping through a dozen hoops, I move on.

          I tried a RAID1 on top of my RAID0 with a single partition, but the performance was nearly the same as not using RAID at all.

          Also BTW: I currently have a three partition btrfs "raid" now for experimenting purposes. It's members are 392gb each and I've backed up my server data to it. The format has some issues to be worked out like it's performance loss on a nearly-full partition, but what a fantastic format if they get it all together. It's like RAID and LVM with snapshots and other tools all rolled into one

          My next "dream" machine has 2 PCIe-x8 128gb SSD's (800mb/s each ) in a RAID0 with a 2-2tb 6Gb/s sata drive for data and backups! Talk about overkill!

          Please Read Me

          Comment


            #6
            Re: How can I move my install to a different partition and still boot to it?

            Originally posted by oshunluvr

            BTW: I was under the impression that the UUID's only changed when you re-created or re-formatted a partition.
            That is true, but what I meant was that "/" will now be on a different partition = different UUID, and /etc/fstab has to reflect the correct UUID for "/" and any other partitions that are going to be different in the new setup.

            I also use a stand alone grub-pc partition and manually edit my grub.cfg (because it's easier than relying on update-grub, which frequently fails IMO).
            I saw failures of update-grub in the first release of Kubuntu with Grub2 -- I think it was 9.10. It failed to find my other OS (aptosid) and put it on the menu, so that was not acceptable. However, Grub 2 in 10.04 and 10.10 seems to work correctly on my setup. If it did happen to work correctly, you could save yourself a lot of grub.cfg editing when kernel upgrades (in any of your collection of OS's) happen, by using update-grub and letting it do the heavy lifting, wrt grub-cfg. Just sayin .....

            I've been using RAID for performance reasons for about 4 years and I am perturbed about how many installers won't use RAID or even recognize it. If I can't install a distro to RAID without jumping through a dozen hoops, I move on.

            I tried a RAID1 on top of my RAID0 with a single partition, but the performance was nearly the same as not using RAID at all.
            Performance is the only reason I'd be tempted to try a RAID0 setup, but to be bluntly honest, it's easier for me to buy faster hardware than it is to invest the time needed to become a dmraid guru; moreover, for the one task where I have performance issues, it's a CPU PIO bottleneck, not a disk I/O bottleneck, so my best shot at improving that situation is to get a faster CPU. I'm deep into planning a new system built around an i7. Maybe an i7-960 Bloomfield -- that should overclock to about 4.2GHz stable. And a SSD for the OS (SATA 3 would be great, if the SATA 3 controller chip is supported by the Linux drivers -- I'm still trying to get a straight answer out of Google on that question), and maybe a pair of 750GB WD SATA drives in a btrfs RAID1 filesystem.


            My next "dream" machine has 2 PCIe-x8 128gb SSD's (800mb/s each ) in a RAID0 with a 2-2tb 6Gb/s sata drive for data and backups! Talk about overkill!
            Yeah -- well, what about the SATA 3 thing -- your current setup is probably already fully saturating the SATA 2 channel, so SSDs won't make it go any faster unless they're SATA 3, right? Are you looking at the Crucial C300s, or is there another choice? On the hard drives, have you noticed that the motherboards give you 2, but not 3, SATA 3 connectors? I'd love to have a SATA 3 SSD for the OS, and a pair of SATA 3 hard drives in RAID1, but I can't find a motherboard that would support that. How do you plan to skin that cat?

            EDIT: Found this ASRock board with 6 SATA 3 ports: http://www.newegg.com/Product/Produc...82E16813157213

            Looks like only 5 reviews -- not much history there, and no Linux users.

            EDIT #2: Maybe this is a better way to go: http://www.newegg.com/Product/Produc...82E16816115075

            The Linux support is more unequivocal than the Marvell 9128 reports.

            Comment


              #7
              Re: How can I move my install to a different partition and still boot to it?

              The SSD's I want are PCI-e not sata - that's why they're so fast.

              Home > Computer Hardware > Hard Drives > SSD (x) > Interface Type : PCI Express


              If you have more than one drive in your current setup I can get someone with your skills running on a RAID0 in a few minutes - seriously. It's really just a few commands away!

              Maybe I'll write a short how-to...

              Please Read Me

              Comment


                #8
                Re: How can I move my install to a different partition and still boot to it?

                Oh yeah -- that's a great approach! With the PCI-e SSD for the OS, then probably an Asus P6X58D-E motherboard, and a pair of these on the SATA 3 ports for my data, in a btrfs RAID1. My "typical" data don't need to be any faster than plain vanilla SATA, but I've got a Windows 7 VM with a database on it that needs all the help it can get, particularly with CPU flops. That could live in a second partition on the SSD and get whatever benefit comes from that.

                Thanks oshunluvr -- this has given me some useful ideas!

                And yes, feel free to write that "RAID for *buntu" guide -- I'm sure others will appreciate it.

                Comment


                  #9
                  Re: How can I move my install to a different partition and still boot to it?

                  If I win the lotto first I'll cut you a check! $20,000 do it

                  Don't forget the 32" monitor!

                  Please Read Me

                  Comment


                    #10
                    Re: How can I move my install to a different partition and still boot to it?

                    Originally posted by oshunluvr
                    If I win the lotto first I'll cut you a check! $20,000 do it

                    Don't forget the 32" monitor!
                    I'll cross my fingers for your lottery chances!

                    By the time I get SATA 3 cables and a heatsink and new keyboard and mouse I think it's over $2600. I may have to take a break from retirement to pay for it. :P

                    I'm thinking a nice 24" monitor would be OK. I've been looking at a Samsung SyncMaster 1100 CRT (21") for the past 5 years, so I'm obviously easily pleased.

                    Comment


                      #11
                      Re: How can I move my install to a different partition and still boot to it?

                      OK, so I was successful in moving my install off of the RAID0 array onto a single partition and running from it now..

                      steps:
                      copied (all copies used rsync -a) from /dev/md0 to /dev/sdd5
                      copied /dev/sda3 (/boot) to /dev/sdd5/boot
                      edited /dev/sdd5/etc/fstab to reflect /dev/sdd5 UUID instead of /dev/md0 (and removed reference to separate /boot)
                      edited grub.cfg to reflect /dev/sdd5 UUID

                      This worked like a champ.

                      Then I deleted and reformed new /dev/md0 and...

                      copied /dev/sdd5/boot/ to /dev/sdb2
                      copied /dev/sdd5/ to /dev/md0
                      edited fstab, mdadm.conf and grub.cfg to reflect correct UUID's

                      ...I get a blank screen. Nothing being logged so I assume the error is very early in the boot process. I get the grub menu, but nothing after selecting the raid-ed install. The drive access light blinks on and off for a few seconds (about 8) and then stops. I've left it in this state for 20 minutes or so.

                      I've tried several different partitions, re-installed grub, re-did and re-traced the above steps half-a-dzen times, nada.

                      Ideas?

                      Please Read Me

                      Comment


                        #12
                        Re: How can I move my install to a different partition and still boot to it?

                        If there's no error message at all, I've got to be suspicious of either the partition table or the designation (in grub.cfg) of /dev/sdb2/boot. In other words, it's either not seeing that partition at all, or not finding anything when it looks there.

                        Comment


                          #13
                          Re: How can I move my install to a different partition and still boot to it?

                          Yeah - I think it's odd too. Checked partitions and file systems, did a new install to the target partitions just to verify it would boot (it did), grub stanza in newly installed grub identical to non-working version. I used rysnc -a to copy files which worked going the other direction (off the RAID to a single partition). Checked and re-checked UUID's

                          I guess I'm stuck with the new install option. But that's a whole weekend of tweaking to get it back to my previous state. :P

                          Please Read Me

                          Comment


                            #14
                            Re: How can I move my install to a different partition and still boot to it?

                            One late-breaking thought -- the BIOS on my Intel D975XBX mobo requires a "boot" flag be set on the partition to be booted. It won't boot from a partition that doesn't have the "boot" flag set.

                            Comment


                              #15
                              Re: How can I move my install to a different partition and still boot to it?

                              Hmm... worth a try.

                              Please Read Me

                              Comment

                              Working...
                              X