Can I move boot linux partition to another/drive partition and just boot from there?Can I change an unmounted...

Gofer work in exchange for Letter of Recommendation

Atmospheric methane to carbon

What allows us to use imaginary numbers?

Reducing contention in thread-safe LruCache

Adding things to bunches of things vs multiplication

!I!n!s!e!r!t! !b!e!t!w!e!e!n!

Polar contour plot in Mathematica?

Best model for precedence constraints within scheduling problem

Have made several mistakes during the course of my PhD. Can't help but feel resentment. Can I get some advice about how to move forward?

Why is the name Bergson pronounced like Berksonne?

Can sulfuric acid itself be electrolysed?

Installing certbot - error - "nothing provides pyparsing"

Did Wernher von Braun really have a "Saturn V painted as the V2"?

How could Tony Stark wield the Infinity Nano Gauntlet - at all?

Metal that glows when near pieces of itself

How does the illumination of the sky from the sun compare to that of the moon?

What are these protruding elements from SU-27's tail?

Designing a prison for a telekinetic race

What's the point of writing that I know will never be used or read?

Meaning and structure of headline "Hair it is: A List of ..."

Is there a way to make the "o" keypress of other-window <C-x><C-o> repeatable?

What happened after the end of the Truman Show?

Repurpose telephone line to ethernet

My father gets angry everytime I pass Salam, that means I should stop saying Salam when he's around?



Can I move boot linux partition to another/drive partition and just boot from there?


Can I change an unmounted partition's type from another partition on the drive?Move Data from Partition to Partition on Same DriveBackup and then wipe partition table from head of driveMove free space from end of the drive to first partition with gpartedHow can I move my /boot partition?Move root partition but keep bootResize extended partition containing /boot/EFI and rootHow can I move a single partition to another empty drive?How can I re-partition a hard/ssd-drive without losing data?Will I be able to move my root partition without failing to boot?






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty{ margin-bottom:0;
}







0















Can I move working boot partition / root filesystem to another drive/partition and just boot from there?



Or device names will be changed and prevent from working?










share|improve this question































    0















    Can I move working boot partition / root filesystem to another drive/partition and just boot from there?



    Or device names will be changed and prevent from working?










    share|improve this question



























      0












      0








      0








      Can I move working boot partition / root filesystem to another drive/partition and just boot from there?



      Or device names will be changed and prevent from working?










      share|improve this question














      Can I move working boot partition / root filesystem to another drive/partition and just boot from there?



      Or device names will be changed and prevent from working?







      partition move-partition






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Aug 12 '17 at 16:38









      DimsDims

      5441 gold badge11 silver badges42 bronze badges




      5441 gold badge11 silver badges42 bronze badges

























          3 Answers
          3






          active

          oldest

          votes


















          1














          If you use UUIDs in /etc/fstab (and other related files that may be relevant in your distro), like /dev/disk/by-uuid/57c59366-9196-4613-ba53-5ad24dcecfb9, and adjust your boot loader configuration if you move your kernel boot partition, then it should work.






          share|improve this answer


























          • uuid will not help if he is moving a whole partition content.

            – in1t3r
            Aug 12 '17 at 17:52











          • I meant if he is creating new partition and moving to that new partition content of /boot that new partition will have different UUID its easier to use labels as its easier to keep track of them.

            – in1t3r
            Aug 12 '17 at 18:01



















          1














          Yes it is possible. Also its not easy. If you intent to move separated /boot partition and or / partition you should consider first of all changing the fstab entries.



          If you are moving the files to new partition then don't forget to use cp -p while copying to preserve permissions. adjust then your /etc/fstab to the new UUID's of partitions that you will use. YOu can get the partition uuid by running blkid /dev/sdXn where X is name of the drive and n number of partition.



          You can also use blkid to attach labels to your partitions and then mount via labels which is much easier read man blkid to learn more.



          After you change the partitions and adjust /etc/fstab you should run the update-grub - available on Debian/Ubuntu script or grub-mkconfig -o /boot/grub/grub.cfg to generate a new config file and then reinstall grub into the first hdd that you bot from. grub-install --recheck /dev/sda



          Of course do not forget that when copiying mount a new / or /boot partition on /mnt and after copying all of the files mount them as / and /boot chroot and only then run update of the grub if you want things to be done correctly.






          share|improve this answer

































            0














            I just like to mention what I did to move Debian Stretch installed in old MBR style disk which is near to dying and moved the OS to new disk with GPT, in my case ESP(EFI system partition) is present in old disk, so I was already booting using UEFI. I followed answer already given above by user in1t3r .




            1. Get gparted live in usb

            2. Boot with gparted live, select old drive select partition, copy partition

              Select new drive paste partition, save changes.
              Do this for root(& boot) and ESP(EFI system partition)

            3. Boot to OS in old drive as normal.

            4. Run sudo gdisk, go to new /dev/sdX check ESP partition, if incorrect set to type ef00. (use ? or 'help' command)

            5. Check the UUID of partiotions copied n new drive, use command sudo blkid, (blkid is part of the e2fsprogs package)

            6. If UUID is not different than OLD partition change UUID of new partition copied in new drive,

              Use command, tune2fs -U random /dev/sdXy

              if it ask to run, e2fsck -f /dev/sdbXy , run it then run tune2fs.

            7. Create mount point directory '/newpart' to mount new drive partition.

            8. Mount new drive OS root(and boot) partitions,

              a) root drv; sudo mount /dev/sdbXx /newpart

              b) ESP drv; sudo mount /dev/sdbXy /newpart/boot/efi

            9. We need to update and generate new grub, but for that we need to chroot to new partition as root

              mount dev,proc,sys on '/newpart' dev,proc,sys

              sudo mount --rbind /dev /newpart/dev

              sudo mount --rbind /proc /newpart/proc

              sudo mount --rbind /sys /newpart/sys

            10. Change /etc/fstab on both new OS part (/newpart/etc/fstab) and old to point root(/) and boot if exists to new UUID,

              UUID=[new-part-UUID] , comment the old one

            11. chroot to '/newpart', sudo chroot /newpart

            12. Run

              a) grub-install --recheck

              c) update-grub

              b) grub-install --recheck

              d) exit (to exit from chroot)

            13. Unmount dev,proc,sys (mount --make-rslave needed 1st for recursive umount)

              sudo mount --make-rslave /newpart/sys

              sudo mount --make-rslave /newpart/proc

              sudo mount --make-rslave /newpart/dev

              sudo umount -R /newpart/sys

              sudo umount -R /newpart/proc

              sudo umount -R /newpart/dev

              sudo umount /newpart

            14. Correct the old OS /etc/fstab to point root(/) and boot id exists as before, (NOTE don't change in new disk)

            15. Reboot,

            16. GO to UEFI-BIOS, chose new disk as boot priority

            17. ON rebooting with new drive ESP, Grub menu will appear, go to 1st menu wiz. OS on new drive .

              (Second menu is for OS in old drive)






            share|improve this answer








            New contributor



            Deep Saurabh is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
            Check out our Code of Conduct.
























              Your Answer








              StackExchange.ready(function() {
              var channelOptions = {
              tags: "".split(" "),
              id: "106"
              };
              initTagRenderer("".split(" "), "".split(" "), channelOptions);

              StackExchange.using("externalEditor", function() {
              // Have to fire editor after snippets, if snippets enabled
              if (StackExchange.settings.snippets.snippetsEnabled) {
              StackExchange.using("snippets", function() {
              createEditor();
              });
              }
              else {
              createEditor();
              }
              });

              function createEditor() {
              StackExchange.prepareEditor({
              heartbeatType: 'answer',
              autoActivateHeartbeat: false,
              convertImagesToLinks: false,
              noModals: true,
              showLowRepImageUploadWarning: true,
              reputationToPostImages: null,
              bindNavPrevention: true,
              postfix: "",
              imageUploader: {
              brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
              contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
              allowUrls: true
              },
              onDemand: true,
              discardSelector: ".discard-answer"
              ,immediatelyShowMarkdownHelp:true
              });


              }
              });














              draft saved

              draft discarded


















              StackExchange.ready(
              function () {
              StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f385696%2fcan-i-move-boot-linux-partition-to-another-drive-partition-and-just-boot-from-th%23new-answer', 'question_page');
              }
              );

              Post as a guest















              Required, but never shown

























              3 Answers
              3






              active

              oldest

              votes








              3 Answers
              3






              active

              oldest

              votes









              active

              oldest

              votes






              active

              oldest

              votes









              1














              If you use UUIDs in /etc/fstab (and other related files that may be relevant in your distro), like /dev/disk/by-uuid/57c59366-9196-4613-ba53-5ad24dcecfb9, and adjust your boot loader configuration if you move your kernel boot partition, then it should work.






              share|improve this answer


























              • uuid will not help if he is moving a whole partition content.

                – in1t3r
                Aug 12 '17 at 17:52











              • I meant if he is creating new partition and moving to that new partition content of /boot that new partition will have different UUID its easier to use labels as its easier to keep track of them.

                – in1t3r
                Aug 12 '17 at 18:01
















              1














              If you use UUIDs in /etc/fstab (and other related files that may be relevant in your distro), like /dev/disk/by-uuid/57c59366-9196-4613-ba53-5ad24dcecfb9, and adjust your boot loader configuration if you move your kernel boot partition, then it should work.






              share|improve this answer


























              • uuid will not help if he is moving a whole partition content.

                – in1t3r
                Aug 12 '17 at 17:52











              • I meant if he is creating new partition and moving to that new partition content of /boot that new partition will have different UUID its easier to use labels as its easier to keep track of them.

                – in1t3r
                Aug 12 '17 at 18:01














              1












              1








              1







              If you use UUIDs in /etc/fstab (and other related files that may be relevant in your distro), like /dev/disk/by-uuid/57c59366-9196-4613-ba53-5ad24dcecfb9, and adjust your boot loader configuration if you move your kernel boot partition, then it should work.






              share|improve this answer













              If you use UUIDs in /etc/fstab (and other related files that may be relevant in your distro), like /dev/disk/by-uuid/57c59366-9196-4613-ba53-5ad24dcecfb9, and adjust your boot loader configuration if you move your kernel boot partition, then it should work.







              share|improve this answer












              share|improve this answer



              share|improve this answer










              answered Aug 12 '17 at 17:12









              L29AhL29Ah

              5572 silver badges15 bronze badges




              5572 silver badges15 bronze badges
















              • uuid will not help if he is moving a whole partition content.

                – in1t3r
                Aug 12 '17 at 17:52











              • I meant if he is creating new partition and moving to that new partition content of /boot that new partition will have different UUID its easier to use labels as its easier to keep track of them.

                – in1t3r
                Aug 12 '17 at 18:01



















              • uuid will not help if he is moving a whole partition content.

                – in1t3r
                Aug 12 '17 at 17:52











              • I meant if he is creating new partition and moving to that new partition content of /boot that new partition will have different UUID its easier to use labels as its easier to keep track of them.

                – in1t3r
                Aug 12 '17 at 18:01

















              uuid will not help if he is moving a whole partition content.

              – in1t3r
              Aug 12 '17 at 17:52





              uuid will not help if he is moving a whole partition content.

              – in1t3r
              Aug 12 '17 at 17:52













              I meant if he is creating new partition and moving to that new partition content of /boot that new partition will have different UUID its easier to use labels as its easier to keep track of them.

              – in1t3r
              Aug 12 '17 at 18:01





              I meant if he is creating new partition and moving to that new partition content of /boot that new partition will have different UUID its easier to use labels as its easier to keep track of them.

              – in1t3r
              Aug 12 '17 at 18:01













              1














              Yes it is possible. Also its not easy. If you intent to move separated /boot partition and or / partition you should consider first of all changing the fstab entries.



              If you are moving the files to new partition then don't forget to use cp -p while copying to preserve permissions. adjust then your /etc/fstab to the new UUID's of partitions that you will use. YOu can get the partition uuid by running blkid /dev/sdXn where X is name of the drive and n number of partition.



              You can also use blkid to attach labels to your partitions and then mount via labels which is much easier read man blkid to learn more.



              After you change the partitions and adjust /etc/fstab you should run the update-grub - available on Debian/Ubuntu script or grub-mkconfig -o /boot/grub/grub.cfg to generate a new config file and then reinstall grub into the first hdd that you bot from. grub-install --recheck /dev/sda



              Of course do not forget that when copiying mount a new / or /boot partition on /mnt and after copying all of the files mount them as / and /boot chroot and only then run update of the grub if you want things to be done correctly.






              share|improve this answer






























                1














                Yes it is possible. Also its not easy. If you intent to move separated /boot partition and or / partition you should consider first of all changing the fstab entries.



                If you are moving the files to new partition then don't forget to use cp -p while copying to preserve permissions. adjust then your /etc/fstab to the new UUID's of partitions that you will use. YOu can get the partition uuid by running blkid /dev/sdXn where X is name of the drive and n number of partition.



                You can also use blkid to attach labels to your partitions and then mount via labels which is much easier read man blkid to learn more.



                After you change the partitions and adjust /etc/fstab you should run the update-grub - available on Debian/Ubuntu script or grub-mkconfig -o /boot/grub/grub.cfg to generate a new config file and then reinstall grub into the first hdd that you bot from. grub-install --recheck /dev/sda



                Of course do not forget that when copiying mount a new / or /boot partition on /mnt and after copying all of the files mount them as / and /boot chroot and only then run update of the grub if you want things to be done correctly.






                share|improve this answer




























                  1












                  1








                  1







                  Yes it is possible. Also its not easy. If you intent to move separated /boot partition and or / partition you should consider first of all changing the fstab entries.



                  If you are moving the files to new partition then don't forget to use cp -p while copying to preserve permissions. adjust then your /etc/fstab to the new UUID's of partitions that you will use. YOu can get the partition uuid by running blkid /dev/sdXn where X is name of the drive and n number of partition.



                  You can also use blkid to attach labels to your partitions and then mount via labels which is much easier read man blkid to learn more.



                  After you change the partitions and adjust /etc/fstab you should run the update-grub - available on Debian/Ubuntu script or grub-mkconfig -o /boot/grub/grub.cfg to generate a new config file and then reinstall grub into the first hdd that you bot from. grub-install --recheck /dev/sda



                  Of course do not forget that when copiying mount a new / or /boot partition on /mnt and after copying all of the files mount them as / and /boot chroot and only then run update of the grub if you want things to be done correctly.






                  share|improve this answer













                  Yes it is possible. Also its not easy. If you intent to move separated /boot partition and or / partition you should consider first of all changing the fstab entries.



                  If you are moving the files to new partition then don't forget to use cp -p while copying to preserve permissions. adjust then your /etc/fstab to the new UUID's of partitions that you will use. YOu can get the partition uuid by running blkid /dev/sdXn where X is name of the drive and n number of partition.



                  You can also use blkid to attach labels to your partitions and then mount via labels which is much easier read man blkid to learn more.



                  After you change the partitions and adjust /etc/fstab you should run the update-grub - available on Debian/Ubuntu script or grub-mkconfig -o /boot/grub/grub.cfg to generate a new config file and then reinstall grub into the first hdd that you bot from. grub-install --recheck /dev/sda



                  Of course do not forget that when copiying mount a new / or /boot partition on /mnt and after copying all of the files mount them as / and /boot chroot and only then run update of the grub if you want things to be done correctly.







                  share|improve this answer












                  share|improve this answer



                  share|improve this answer










                  answered Aug 12 '17 at 18:00









                  in1t3rin1t3r

                  1028 bronze badges




                  1028 bronze badges


























                      0














                      I just like to mention what I did to move Debian Stretch installed in old MBR style disk which is near to dying and moved the OS to new disk with GPT, in my case ESP(EFI system partition) is present in old disk, so I was already booting using UEFI. I followed answer already given above by user in1t3r .




                      1. Get gparted live in usb

                      2. Boot with gparted live, select old drive select partition, copy partition

                        Select new drive paste partition, save changes.
                        Do this for root(& boot) and ESP(EFI system partition)

                      3. Boot to OS in old drive as normal.

                      4. Run sudo gdisk, go to new /dev/sdX check ESP partition, if incorrect set to type ef00. (use ? or 'help' command)

                      5. Check the UUID of partiotions copied n new drive, use command sudo blkid, (blkid is part of the e2fsprogs package)

                      6. If UUID is not different than OLD partition change UUID of new partition copied in new drive,

                        Use command, tune2fs -U random /dev/sdXy

                        if it ask to run, e2fsck -f /dev/sdbXy , run it then run tune2fs.

                      7. Create mount point directory '/newpart' to mount new drive partition.

                      8. Mount new drive OS root(and boot) partitions,

                        a) root drv; sudo mount /dev/sdbXx /newpart

                        b) ESP drv; sudo mount /dev/sdbXy /newpart/boot/efi

                      9. We need to update and generate new grub, but for that we need to chroot to new partition as root

                        mount dev,proc,sys on '/newpart' dev,proc,sys

                        sudo mount --rbind /dev /newpart/dev

                        sudo mount --rbind /proc /newpart/proc

                        sudo mount --rbind /sys /newpart/sys

                      10. Change /etc/fstab on both new OS part (/newpart/etc/fstab) and old to point root(/) and boot if exists to new UUID,

                        UUID=[new-part-UUID] , comment the old one

                      11. chroot to '/newpart', sudo chroot /newpart

                      12. Run

                        a) grub-install --recheck

                        c) update-grub

                        b) grub-install --recheck

                        d) exit (to exit from chroot)

                      13. Unmount dev,proc,sys (mount --make-rslave needed 1st for recursive umount)

                        sudo mount --make-rslave /newpart/sys

                        sudo mount --make-rslave /newpart/proc

                        sudo mount --make-rslave /newpart/dev

                        sudo umount -R /newpart/sys

                        sudo umount -R /newpart/proc

                        sudo umount -R /newpart/dev

                        sudo umount /newpart

                      14. Correct the old OS /etc/fstab to point root(/) and boot id exists as before, (NOTE don't change in new disk)

                      15. Reboot,

                      16. GO to UEFI-BIOS, chose new disk as boot priority

                      17. ON rebooting with new drive ESP, Grub menu will appear, go to 1st menu wiz. OS on new drive .

                        (Second menu is for OS in old drive)






                      share|improve this answer








                      New contributor



                      Deep Saurabh is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                      Check out our Code of Conduct.


























                        0














                        I just like to mention what I did to move Debian Stretch installed in old MBR style disk which is near to dying and moved the OS to new disk with GPT, in my case ESP(EFI system partition) is present in old disk, so I was already booting using UEFI. I followed answer already given above by user in1t3r .




                        1. Get gparted live in usb

                        2. Boot with gparted live, select old drive select partition, copy partition

                          Select new drive paste partition, save changes.
                          Do this for root(& boot) and ESP(EFI system partition)

                        3. Boot to OS in old drive as normal.

                        4. Run sudo gdisk, go to new /dev/sdX check ESP partition, if incorrect set to type ef00. (use ? or 'help' command)

                        5. Check the UUID of partiotions copied n new drive, use command sudo blkid, (blkid is part of the e2fsprogs package)

                        6. If UUID is not different than OLD partition change UUID of new partition copied in new drive,

                          Use command, tune2fs -U random /dev/sdXy

                          if it ask to run, e2fsck -f /dev/sdbXy , run it then run tune2fs.

                        7. Create mount point directory '/newpart' to mount new drive partition.

                        8. Mount new drive OS root(and boot) partitions,

                          a) root drv; sudo mount /dev/sdbXx /newpart

                          b) ESP drv; sudo mount /dev/sdbXy /newpart/boot/efi

                        9. We need to update and generate new grub, but for that we need to chroot to new partition as root

                          mount dev,proc,sys on '/newpart' dev,proc,sys

                          sudo mount --rbind /dev /newpart/dev

                          sudo mount --rbind /proc /newpart/proc

                          sudo mount --rbind /sys /newpart/sys

                        10. Change /etc/fstab on both new OS part (/newpart/etc/fstab) and old to point root(/) and boot if exists to new UUID,

                          UUID=[new-part-UUID] , comment the old one

                        11. chroot to '/newpart', sudo chroot /newpart

                        12. Run

                          a) grub-install --recheck

                          c) update-grub

                          b) grub-install --recheck

                          d) exit (to exit from chroot)

                        13. Unmount dev,proc,sys (mount --make-rslave needed 1st for recursive umount)

                          sudo mount --make-rslave /newpart/sys

                          sudo mount --make-rslave /newpart/proc

                          sudo mount --make-rslave /newpart/dev

                          sudo umount -R /newpart/sys

                          sudo umount -R /newpart/proc

                          sudo umount -R /newpart/dev

                          sudo umount /newpart

                        14. Correct the old OS /etc/fstab to point root(/) and boot id exists as before, (NOTE don't change in new disk)

                        15. Reboot,

                        16. GO to UEFI-BIOS, chose new disk as boot priority

                        17. ON rebooting with new drive ESP, Grub menu will appear, go to 1st menu wiz. OS on new drive .

                          (Second menu is for OS in old drive)






                        share|improve this answer








                        New contributor



                        Deep Saurabh is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                        Check out our Code of Conduct.
























                          0












                          0








                          0







                          I just like to mention what I did to move Debian Stretch installed in old MBR style disk which is near to dying and moved the OS to new disk with GPT, in my case ESP(EFI system partition) is present in old disk, so I was already booting using UEFI. I followed answer already given above by user in1t3r .




                          1. Get gparted live in usb

                          2. Boot with gparted live, select old drive select partition, copy partition

                            Select new drive paste partition, save changes.
                            Do this for root(& boot) and ESP(EFI system partition)

                          3. Boot to OS in old drive as normal.

                          4. Run sudo gdisk, go to new /dev/sdX check ESP partition, if incorrect set to type ef00. (use ? or 'help' command)

                          5. Check the UUID of partiotions copied n new drive, use command sudo blkid, (blkid is part of the e2fsprogs package)

                          6. If UUID is not different than OLD partition change UUID of new partition copied in new drive,

                            Use command, tune2fs -U random /dev/sdXy

                            if it ask to run, e2fsck -f /dev/sdbXy , run it then run tune2fs.

                          7. Create mount point directory '/newpart' to mount new drive partition.

                          8. Mount new drive OS root(and boot) partitions,

                            a) root drv; sudo mount /dev/sdbXx /newpart

                            b) ESP drv; sudo mount /dev/sdbXy /newpart/boot/efi

                          9. We need to update and generate new grub, but for that we need to chroot to new partition as root

                            mount dev,proc,sys on '/newpart' dev,proc,sys

                            sudo mount --rbind /dev /newpart/dev

                            sudo mount --rbind /proc /newpart/proc

                            sudo mount --rbind /sys /newpart/sys

                          10. Change /etc/fstab on both new OS part (/newpart/etc/fstab) and old to point root(/) and boot if exists to new UUID,

                            UUID=[new-part-UUID] , comment the old one

                          11. chroot to '/newpart', sudo chroot /newpart

                          12. Run

                            a) grub-install --recheck

                            c) update-grub

                            b) grub-install --recheck

                            d) exit (to exit from chroot)

                          13. Unmount dev,proc,sys (mount --make-rslave needed 1st for recursive umount)

                            sudo mount --make-rslave /newpart/sys

                            sudo mount --make-rslave /newpart/proc

                            sudo mount --make-rslave /newpart/dev

                            sudo umount -R /newpart/sys

                            sudo umount -R /newpart/proc

                            sudo umount -R /newpart/dev

                            sudo umount /newpart

                          14. Correct the old OS /etc/fstab to point root(/) and boot id exists as before, (NOTE don't change in new disk)

                          15. Reboot,

                          16. GO to UEFI-BIOS, chose new disk as boot priority

                          17. ON rebooting with new drive ESP, Grub menu will appear, go to 1st menu wiz. OS on new drive .

                            (Second menu is for OS in old drive)






                          share|improve this answer








                          New contributor



                          Deep Saurabh is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                          Check out our Code of Conduct.









                          I just like to mention what I did to move Debian Stretch installed in old MBR style disk which is near to dying and moved the OS to new disk with GPT, in my case ESP(EFI system partition) is present in old disk, so I was already booting using UEFI. I followed answer already given above by user in1t3r .




                          1. Get gparted live in usb

                          2. Boot with gparted live, select old drive select partition, copy partition

                            Select new drive paste partition, save changes.
                            Do this for root(& boot) and ESP(EFI system partition)

                          3. Boot to OS in old drive as normal.

                          4. Run sudo gdisk, go to new /dev/sdX check ESP partition, if incorrect set to type ef00. (use ? or 'help' command)

                          5. Check the UUID of partiotions copied n new drive, use command sudo blkid, (blkid is part of the e2fsprogs package)

                          6. If UUID is not different than OLD partition change UUID of new partition copied in new drive,

                            Use command, tune2fs -U random /dev/sdXy

                            if it ask to run, e2fsck -f /dev/sdbXy , run it then run tune2fs.

                          7. Create mount point directory '/newpart' to mount new drive partition.

                          8. Mount new drive OS root(and boot) partitions,

                            a) root drv; sudo mount /dev/sdbXx /newpart

                            b) ESP drv; sudo mount /dev/sdbXy /newpart/boot/efi

                          9. We need to update and generate new grub, but for that we need to chroot to new partition as root

                            mount dev,proc,sys on '/newpart' dev,proc,sys

                            sudo mount --rbind /dev /newpart/dev

                            sudo mount --rbind /proc /newpart/proc

                            sudo mount --rbind /sys /newpart/sys

                          10. Change /etc/fstab on both new OS part (/newpart/etc/fstab) and old to point root(/) and boot if exists to new UUID,

                            UUID=[new-part-UUID] , comment the old one

                          11. chroot to '/newpart', sudo chroot /newpart

                          12. Run

                            a) grub-install --recheck

                            c) update-grub

                            b) grub-install --recheck

                            d) exit (to exit from chroot)

                          13. Unmount dev,proc,sys (mount --make-rslave needed 1st for recursive umount)

                            sudo mount --make-rslave /newpart/sys

                            sudo mount --make-rslave /newpart/proc

                            sudo mount --make-rslave /newpart/dev

                            sudo umount -R /newpart/sys

                            sudo umount -R /newpart/proc

                            sudo umount -R /newpart/dev

                            sudo umount /newpart

                          14. Correct the old OS /etc/fstab to point root(/) and boot id exists as before, (NOTE don't change in new disk)

                          15. Reboot,

                          16. GO to UEFI-BIOS, chose new disk as boot priority

                          17. ON rebooting with new drive ESP, Grub menu will appear, go to 1st menu wiz. OS on new drive .

                            (Second menu is for OS in old drive)







                          share|improve this answer








                          New contributor



                          Deep Saurabh is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                          Check out our Code of Conduct.








                          share|improve this answer



                          share|improve this answer






                          New contributor



                          Deep Saurabh is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                          Check out our Code of Conduct.








                          answered 2 days ago









                          Deep SaurabhDeep Saurabh

                          11 bronze badge




                          11 bronze badge




                          New contributor



                          Deep Saurabh is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                          Check out our Code of Conduct.




                          New contributor




                          Deep Saurabh is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                          Check out our Code of Conduct.



































                              draft saved

                              draft discarded




















































                              Thanks for contributing an answer to Unix & Linux Stack Exchange!


                              • Please be sure to answer the question. Provide details and share your research!

                              But avoid



                              • Asking for help, clarification, or responding to other answers.

                              • Making statements based on opinion; back them up with references or personal experience.


                              To learn more, see our tips on writing great answers.




                              draft saved


                              draft discarded














                              StackExchange.ready(
                              function () {
                              StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f385696%2fcan-i-move-boot-linux-partition-to-another-drive-partition-and-just-boot-from-th%23new-answer', 'question_page');
                              }
                              );

                              Post as a guest















                              Required, but never shown





















































                              Required, but never shown














                              Required, but never shown












                              Required, but never shown







                              Required, but never shown

































                              Required, but never shown














                              Required, but never shown












                              Required, but never shown







                              Required, but never shown







                              Popular posts from this blog

                              Taj Mahal Inhaltsverzeichnis Aufbau | Geschichte | 350-Jahr-Feier | Heutige Bedeutung | Siehe auch |...

                              Baia Sprie Cuprins Etimologie | Istorie | Demografie | Politică și administrație | Arii naturale...

                              Nicolae Petrescu-Găină Cuprins Biografie | Opera | In memoriam | Varia | Controverse, incertitudini...