Clonezilla clone won't boot without reinstalling grub2

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP











up vote
2
down vote

favorite












I've taken a clone of a machine with the following partitions:



Device Type Label
/dev/sda
/dev/sda1 Ext4 boot
/dev/sda2 Linux LVM
/dev/system/ LV system
/dev/system/home LV home
/dev/system/root LV root
/dev/system/swap LV swap


These are referenced by label in



/etc/fstab:



LABEL=root / ext4
LABEL=boot /boot ext4
LABEL=home /home ext4
LABEL=swap /swap swap


and grub.cfg:



menuentry 'openSUSE, with linux <version>' --class opensuse --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-<version>-simple-<UUID>' 
insmod ext2
set root='hd0,msdos1'
linux /vmlinuz-<version> root=/dev/mapper/system-root resume=/dev/disk/by-label/swap <other options>
initrd /initrd-<version>



I am trying to install this clone on another identical machine. The install succeeds, but I can't boot into the machine without doing the following in the grub prompt it dumps me into:



grub> set root=(hd0,1)
grub> linux /boot/vmlinuz-<version> root=/dev/sda1
grub> initrd /boot/initrd.img-<version>
grub> boot


I'd much prefer to get an image which does not require these steps, but I'm not sure where the problem lies (grub config, other system files, clonezilla). Things I have tried so far:



  • Edited /etc/defaults/grub and uncommented 'GRUB_DISABLE_LINUX_UUID=true'

  • Edited grub-mkconfig_lib to comment out the lines like search --no-floppy --fs-uuid --set=root $hints $fs_uuid to prevent them being added when grub.cfg is generated

  • (and re-generated grub.cfg)

  • Selected advanced clonezilla install and told it to re-install the MBR afterwards (option -j1. option -g auto "Reinstall grub in client disk MBR" was already selected by default)

Any other things I can try?



I did notice that /boot/grub2/device.map lists "sda1" for hd0, but the HD of the other machine is being detected as sda1 when I install the clone so I don't think this is likely to be the culprit.



(I wasn't sure if here or Superuser was the better fit for the question, I am happy for it to be migrated as appropriate.)










share|improve this question























  • In my experience (limited to BIOS not LVM and partition clone not disk clone) when restoring image Clonezilla runs grub-install automatically fixing UUID and other. A little more info may help: What version of Clonezilla? Did you clone the disk or just the partition? Were there any errors on the restore, particularly in the grub-install part?
    – jc__
    May 25 '17 at 14:20










  • Version of clonezilla: 20170220-yakkety. Cloned the entire disk, also tried both with the partimage and dd options when making the clone. Re-running the install now I did see a "couldn't find device uuid" mesage scroll past briefly before the partclone screen appeared, but couldn't get all the details in time. No errors were listed in the output once install had finished.
    – jam
    May 25 '17 at 14:56











  • I am working with a much older version, but this is the selections Ive used to get the grub-install called automatically: (device-image) (local_dev or where ever) (Beginner) (saveparts) (...). Then the reverse for restoring the image. (device-image) (local_dev or where ever) (Beginner) (restoreparts).
    – jc__
    May 25 '17 at 15:12










  • Look at my answer here for a quick how to clone using Clonezilla in the Parted Magic live ISO.
    – jc__
    May 25 '17 at 15:20















up vote
2
down vote

favorite












I've taken a clone of a machine with the following partitions:



Device Type Label
/dev/sda
/dev/sda1 Ext4 boot
/dev/sda2 Linux LVM
/dev/system/ LV system
/dev/system/home LV home
/dev/system/root LV root
/dev/system/swap LV swap


These are referenced by label in



/etc/fstab:



LABEL=root / ext4
LABEL=boot /boot ext4
LABEL=home /home ext4
LABEL=swap /swap swap


and grub.cfg:



menuentry 'openSUSE, with linux <version>' --class opensuse --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-<version>-simple-<UUID>' 
insmod ext2
set root='hd0,msdos1'
linux /vmlinuz-<version> root=/dev/mapper/system-root resume=/dev/disk/by-label/swap <other options>
initrd /initrd-<version>



I am trying to install this clone on another identical machine. The install succeeds, but I can't boot into the machine without doing the following in the grub prompt it dumps me into:



grub> set root=(hd0,1)
grub> linux /boot/vmlinuz-<version> root=/dev/sda1
grub> initrd /boot/initrd.img-<version>
grub> boot


I'd much prefer to get an image which does not require these steps, but I'm not sure where the problem lies (grub config, other system files, clonezilla). Things I have tried so far:



  • Edited /etc/defaults/grub and uncommented 'GRUB_DISABLE_LINUX_UUID=true'

  • Edited grub-mkconfig_lib to comment out the lines like search --no-floppy --fs-uuid --set=root $hints $fs_uuid to prevent them being added when grub.cfg is generated

  • (and re-generated grub.cfg)

  • Selected advanced clonezilla install and told it to re-install the MBR afterwards (option -j1. option -g auto "Reinstall grub in client disk MBR" was already selected by default)

Any other things I can try?



I did notice that /boot/grub2/device.map lists "sda1" for hd0, but the HD of the other machine is being detected as sda1 when I install the clone so I don't think this is likely to be the culprit.



(I wasn't sure if here or Superuser was the better fit for the question, I am happy for it to be migrated as appropriate.)










share|improve this question























  • In my experience (limited to BIOS not LVM and partition clone not disk clone) when restoring image Clonezilla runs grub-install automatically fixing UUID and other. A little more info may help: What version of Clonezilla? Did you clone the disk or just the partition? Were there any errors on the restore, particularly in the grub-install part?
    – jc__
    May 25 '17 at 14:20










  • Version of clonezilla: 20170220-yakkety. Cloned the entire disk, also tried both with the partimage and dd options when making the clone. Re-running the install now I did see a "couldn't find device uuid" mesage scroll past briefly before the partclone screen appeared, but couldn't get all the details in time. No errors were listed in the output once install had finished.
    – jam
    May 25 '17 at 14:56











  • I am working with a much older version, but this is the selections Ive used to get the grub-install called automatically: (device-image) (local_dev or where ever) (Beginner) (saveparts) (...). Then the reverse for restoring the image. (device-image) (local_dev or where ever) (Beginner) (restoreparts).
    – jc__
    May 25 '17 at 15:12










  • Look at my answer here for a quick how to clone using Clonezilla in the Parted Magic live ISO.
    – jc__
    May 25 '17 at 15:20













up vote
2
down vote

favorite









up vote
2
down vote

favorite











I've taken a clone of a machine with the following partitions:



Device Type Label
/dev/sda
/dev/sda1 Ext4 boot
/dev/sda2 Linux LVM
/dev/system/ LV system
/dev/system/home LV home
/dev/system/root LV root
/dev/system/swap LV swap


These are referenced by label in



/etc/fstab:



LABEL=root / ext4
LABEL=boot /boot ext4
LABEL=home /home ext4
LABEL=swap /swap swap


and grub.cfg:



menuentry 'openSUSE, with linux <version>' --class opensuse --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-<version>-simple-<UUID>' 
insmod ext2
set root='hd0,msdos1'
linux /vmlinuz-<version> root=/dev/mapper/system-root resume=/dev/disk/by-label/swap <other options>
initrd /initrd-<version>



I am trying to install this clone on another identical machine. The install succeeds, but I can't boot into the machine without doing the following in the grub prompt it dumps me into:



grub> set root=(hd0,1)
grub> linux /boot/vmlinuz-<version> root=/dev/sda1
grub> initrd /boot/initrd.img-<version>
grub> boot


I'd much prefer to get an image which does not require these steps, but I'm not sure where the problem lies (grub config, other system files, clonezilla). Things I have tried so far:



  • Edited /etc/defaults/grub and uncommented 'GRUB_DISABLE_LINUX_UUID=true'

  • Edited grub-mkconfig_lib to comment out the lines like search --no-floppy --fs-uuid --set=root $hints $fs_uuid to prevent them being added when grub.cfg is generated

  • (and re-generated grub.cfg)

  • Selected advanced clonezilla install and told it to re-install the MBR afterwards (option -j1. option -g auto "Reinstall grub in client disk MBR" was already selected by default)

Any other things I can try?



I did notice that /boot/grub2/device.map lists "sda1" for hd0, but the HD of the other machine is being detected as sda1 when I install the clone so I don't think this is likely to be the culprit.



(I wasn't sure if here or Superuser was the better fit for the question, I am happy for it to be migrated as appropriate.)










share|improve this question















I've taken a clone of a machine with the following partitions:



Device Type Label
/dev/sda
/dev/sda1 Ext4 boot
/dev/sda2 Linux LVM
/dev/system/ LV system
/dev/system/home LV home
/dev/system/root LV root
/dev/system/swap LV swap


These are referenced by label in



/etc/fstab:



LABEL=root / ext4
LABEL=boot /boot ext4
LABEL=home /home ext4
LABEL=swap /swap swap


and grub.cfg:



menuentry 'openSUSE, with linux <version>' --class opensuse --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-<version>-simple-<UUID>' 
insmod ext2
set root='hd0,msdos1'
linux /vmlinuz-<version> root=/dev/mapper/system-root resume=/dev/disk/by-label/swap <other options>
initrd /initrd-<version>



I am trying to install this clone on another identical machine. The install succeeds, but I can't boot into the machine without doing the following in the grub prompt it dumps me into:



grub> set root=(hd0,1)
grub> linux /boot/vmlinuz-<version> root=/dev/sda1
grub> initrd /boot/initrd.img-<version>
grub> boot


I'd much prefer to get an image which does not require these steps, but I'm not sure where the problem lies (grub config, other system files, clonezilla). Things I have tried so far:



  • Edited /etc/defaults/grub and uncommented 'GRUB_DISABLE_LINUX_UUID=true'

  • Edited grub-mkconfig_lib to comment out the lines like search --no-floppy --fs-uuid --set=root $hints $fs_uuid to prevent them being added when grub.cfg is generated

  • (and re-generated grub.cfg)

  • Selected advanced clonezilla install and told it to re-install the MBR afterwards (option -j1. option -g auto "Reinstall grub in client disk MBR" was already selected by default)

Any other things I can try?



I did notice that /boot/grub2/device.map lists "sda1" for hd0, but the HD of the other machine is being detected as sda1 when I install the clone so I don't think this is likely to be the culprit.



(I wasn't sure if here or Superuser was the better fit for the question, I am happy for it to be migrated as appropriate.)







boot grub2 lvm clonezilla






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited May 25 '17 at 14:58

























asked May 25 '17 at 12:47









jam

13518




13518











  • In my experience (limited to BIOS not LVM and partition clone not disk clone) when restoring image Clonezilla runs grub-install automatically fixing UUID and other. A little more info may help: What version of Clonezilla? Did you clone the disk or just the partition? Were there any errors on the restore, particularly in the grub-install part?
    – jc__
    May 25 '17 at 14:20










  • Version of clonezilla: 20170220-yakkety. Cloned the entire disk, also tried both with the partimage and dd options when making the clone. Re-running the install now I did see a "couldn't find device uuid" mesage scroll past briefly before the partclone screen appeared, but couldn't get all the details in time. No errors were listed in the output once install had finished.
    – jam
    May 25 '17 at 14:56











  • I am working with a much older version, but this is the selections Ive used to get the grub-install called automatically: (device-image) (local_dev or where ever) (Beginner) (saveparts) (...). Then the reverse for restoring the image. (device-image) (local_dev or where ever) (Beginner) (restoreparts).
    – jc__
    May 25 '17 at 15:12










  • Look at my answer here for a quick how to clone using Clonezilla in the Parted Magic live ISO.
    – jc__
    May 25 '17 at 15:20

















  • In my experience (limited to BIOS not LVM and partition clone not disk clone) when restoring image Clonezilla runs grub-install automatically fixing UUID and other. A little more info may help: What version of Clonezilla? Did you clone the disk or just the partition? Were there any errors on the restore, particularly in the grub-install part?
    – jc__
    May 25 '17 at 14:20










  • Version of clonezilla: 20170220-yakkety. Cloned the entire disk, also tried both with the partimage and dd options when making the clone. Re-running the install now I did see a "couldn't find device uuid" mesage scroll past briefly before the partclone screen appeared, but couldn't get all the details in time. No errors were listed in the output once install had finished.
    – jam
    May 25 '17 at 14:56











  • I am working with a much older version, but this is the selections Ive used to get the grub-install called automatically: (device-image) (local_dev or where ever) (Beginner) (saveparts) (...). Then the reverse for restoring the image. (device-image) (local_dev or where ever) (Beginner) (restoreparts).
    – jc__
    May 25 '17 at 15:12










  • Look at my answer here for a quick how to clone using Clonezilla in the Parted Magic live ISO.
    – jc__
    May 25 '17 at 15:20
















In my experience (limited to BIOS not LVM and partition clone not disk clone) when restoring image Clonezilla runs grub-install automatically fixing UUID and other. A little more info may help: What version of Clonezilla? Did you clone the disk or just the partition? Were there any errors on the restore, particularly in the grub-install part?
– jc__
May 25 '17 at 14:20




In my experience (limited to BIOS not LVM and partition clone not disk clone) when restoring image Clonezilla runs grub-install automatically fixing UUID and other. A little more info may help: What version of Clonezilla? Did you clone the disk or just the partition? Were there any errors on the restore, particularly in the grub-install part?
– jc__
May 25 '17 at 14:20












Version of clonezilla: 20170220-yakkety. Cloned the entire disk, also tried both with the partimage and dd options when making the clone. Re-running the install now I did see a "couldn't find device uuid" mesage scroll past briefly before the partclone screen appeared, but couldn't get all the details in time. No errors were listed in the output once install had finished.
– jam
May 25 '17 at 14:56





Version of clonezilla: 20170220-yakkety. Cloned the entire disk, also tried both with the partimage and dd options when making the clone. Re-running the install now I did see a "couldn't find device uuid" mesage scroll past briefly before the partclone screen appeared, but couldn't get all the details in time. No errors were listed in the output once install had finished.
– jam
May 25 '17 at 14:56













I am working with a much older version, but this is the selections Ive used to get the grub-install called automatically: (device-image) (local_dev or where ever) (Beginner) (saveparts) (...). Then the reverse for restoring the image. (device-image) (local_dev or where ever) (Beginner) (restoreparts).
– jc__
May 25 '17 at 15:12




I am working with a much older version, but this is the selections Ive used to get the grub-install called automatically: (device-image) (local_dev or where ever) (Beginner) (saveparts) (...). Then the reverse for restoring the image. (device-image) (local_dev or where ever) (Beginner) (restoreparts).
– jc__
May 25 '17 at 15:12












Look at my answer here for a quick how to clone using Clonezilla in the Parted Magic live ISO.
– jc__
May 25 '17 at 15:20





Look at my answer here for a quick how to clone using Clonezilla in the Parted Magic live ISO.
– jc__
May 25 '17 at 15:20











3 Answers
3






active

oldest

votes

















up vote
1
down vote



accepted










In the end, I resolved this by taking a partition clone of the original machine's boot partition and installing this on the other machines with "-j1" selected from the advanced options.



Slightly annoying to have the extra step, but at least restoring a clone of the boot partition only takes seconds.






share|improve this answer



























    up vote
    0
    down vote













    The working procedure to fix this we have to manually install GRUB(2) after a failed installation/cloning, or disk corruption of the MBR.



    Now, after restarting, let's fix the grub boot:



    sh:grub>set pager=1 # for paging long command outputs; There must be no spaces on either side of the equals sign. 
    grub> set root=(hd0,XY)
    'grub> insmod /boot/grub/linux.mod # AFAIK, optional step
    grub> linux /boot/vmlinuz-4.4.92-36-default root=/dev/sdaXY
    grub> initrd /boot/initrd.img-4.4.92-36-default
    grub> boot


    After successfully booting into your Linux, let's make the repair permanent:



    # update-grub
    # grub-install /dev/sda #or what ever your system disk is


    if you get the error update-grub command not found don't worry, it's simply a shell script that was created to make things easier. Acutally, it does:



    set -e
    exec grub2-mkconfig -o /boot/grub/grub.cfg "$@"


    After running grub-install ... your system should be back to normal. I did this with a cloned OpenSuse Leap 42.2 using Clonezilla 2016-02-10 (migrated primary laptop disk to a bigger SSD).



    Refs: How to Rescue a Non-booting GRUB 2 on Linux
    Repairing a Broken GRUB 2 Boot-Loader on Ubuntu



    Here is an alternative approach that works without booting into Linux:



    $ sudo fdisk -l (From this you need to find the device name of your physical drive that won't boot, something like “/dev/sdxy″ - where x is the drive and y is the root partition. Since I was using a software RAID, root (/) was on md1)
    $ sudo mount /dev/sdxy /mnt (Mount the root partition)
    $ sudo mount --bind /dev /mnt/dev
    $ sudo mount --bind /proc /mnt/proc
    $ sudo mount --bind /sys /mnt/sys
    $ sudo chroot /mnt (This will change the root of executables to your your drive that won't boot)
    $ grub-mkconfig -o /boot/grub/grub.cfg (insure that there are NO error messages)
    $ grub-install /dev/sdx (NOTE that this is the drive and not the partition. try grub-install --recheck /dev/sdxy if it fails)
    Ctrl+D (to exit out of chroot)
    $ sudo umount /mnt/dev
    $ sudo umount /mnt/proc
    $ sudo umount /mnt/sys
    $ sudo umount /mnt


    Ref: http://redsunsoft.com/2016/06/how-to-repair-a-server-stuck-at-the-grub-prompt/






    share|improve this answer



























      up vote
      0
      down vote













      TL;DR




      On Ubuntu installed on GPT use BootRepair after you logged in system.





      Had the same problem as @jam, but in my case I have:



      • Ubuntu 16.04, that I wanted to clone

      • source disk (HDD, 500 GB )

        • MBR

        • dual boot with windows


      • target disk (SSD, 256 GB )

        • GPT


      So, I cloned only linux partitions (sda5 - for system, sda6 for /home) with Clonezilla, not the whole disk.



      To make it possible, I installed clear ubuntu on SSD, create partitions as it was made on HDD and also added ESP (EFI System Partition). Then I overwrote this partitions with Clonezilla (HDD partitions to SSD). As a result, I got GRUB prompt.



      Then I made



      grub> set root=(hd0,gpt2) # NOTICE: used gptX instead of simple number
      grub> linux /boot/vmlinuz-<version> root=/dev/sda1
      grub> initrd /boot/initrd.img-<version>
      grub> boot


      as @jam did and @wp78de suggested (and also it was said in his refs).



      Then I made update-grub and stuck on grub-install with error



      grub-install: error: will not proceed with blocklists


      The reason was in GPT. There were some useful stuff in this thread, but the simplest approach was to use BootRepair. I don't know, if there were some special work performed by BootRepair, but i checked to reinstall GRUB and now everything works fine!





      share








      New contributor




      Egor Panfilov 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',
        convertImagesToLinks: false,
        noModals: false,
        showLowRepImageUploadWarning: true,
        reputationToPostImages: null,
        bindNavPrevention: true,
        postfix: "",
        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%2f367185%2fclonezilla-clone-wont-boot-without-reinstalling-grub2%23new-answer', 'question_page');

        );

        Post as a guest






























        3 Answers
        3






        active

        oldest

        votes








        3 Answers
        3






        active

        oldest

        votes









        active

        oldest

        votes






        active

        oldest

        votes








        up vote
        1
        down vote



        accepted










        In the end, I resolved this by taking a partition clone of the original machine's boot partition and installing this on the other machines with "-j1" selected from the advanced options.



        Slightly annoying to have the extra step, but at least restoring a clone of the boot partition only takes seconds.






        share|improve this answer
























          up vote
          1
          down vote



          accepted










          In the end, I resolved this by taking a partition clone of the original machine's boot partition and installing this on the other machines with "-j1" selected from the advanced options.



          Slightly annoying to have the extra step, but at least restoring a clone of the boot partition only takes seconds.






          share|improve this answer






















            up vote
            1
            down vote



            accepted







            up vote
            1
            down vote



            accepted






            In the end, I resolved this by taking a partition clone of the original machine's boot partition and installing this on the other machines with "-j1" selected from the advanced options.



            Slightly annoying to have the extra step, but at least restoring a clone of the boot partition only takes seconds.






            share|improve this answer












            In the end, I resolved this by taking a partition clone of the original machine's boot partition and installing this on the other machines with "-j1" selected from the advanced options.



            Slightly annoying to have the extra step, but at least restoring a clone of the boot partition only takes seconds.







            share|improve this answer












            share|improve this answer



            share|improve this answer










            answered Jun 26 '17 at 9:16









            jam

            13518




            13518






















                up vote
                0
                down vote













                The working procedure to fix this we have to manually install GRUB(2) after a failed installation/cloning, or disk corruption of the MBR.



                Now, after restarting, let's fix the grub boot:



                sh:grub>set pager=1 # for paging long command outputs; There must be no spaces on either side of the equals sign. 
                grub> set root=(hd0,XY)
                'grub> insmod /boot/grub/linux.mod # AFAIK, optional step
                grub> linux /boot/vmlinuz-4.4.92-36-default root=/dev/sdaXY
                grub> initrd /boot/initrd.img-4.4.92-36-default
                grub> boot


                After successfully booting into your Linux, let's make the repair permanent:



                # update-grub
                # grub-install /dev/sda #or what ever your system disk is


                if you get the error update-grub command not found don't worry, it's simply a shell script that was created to make things easier. Acutally, it does:



                set -e
                exec grub2-mkconfig -o /boot/grub/grub.cfg "$@"


                After running grub-install ... your system should be back to normal. I did this with a cloned OpenSuse Leap 42.2 using Clonezilla 2016-02-10 (migrated primary laptop disk to a bigger SSD).



                Refs: How to Rescue a Non-booting GRUB 2 on Linux
                Repairing a Broken GRUB 2 Boot-Loader on Ubuntu



                Here is an alternative approach that works without booting into Linux:



                $ sudo fdisk -l (From this you need to find the device name of your physical drive that won't boot, something like “/dev/sdxy″ - where x is the drive and y is the root partition. Since I was using a software RAID, root (/) was on md1)
                $ sudo mount /dev/sdxy /mnt (Mount the root partition)
                $ sudo mount --bind /dev /mnt/dev
                $ sudo mount --bind /proc /mnt/proc
                $ sudo mount --bind /sys /mnt/sys
                $ sudo chroot /mnt (This will change the root of executables to your your drive that won't boot)
                $ grub-mkconfig -o /boot/grub/grub.cfg (insure that there are NO error messages)
                $ grub-install /dev/sdx (NOTE that this is the drive and not the partition. try grub-install --recheck /dev/sdxy if it fails)
                Ctrl+D (to exit out of chroot)
                $ sudo umount /mnt/dev
                $ sudo umount /mnt/proc
                $ sudo umount /mnt/sys
                $ sudo umount /mnt


                Ref: http://redsunsoft.com/2016/06/how-to-repair-a-server-stuck-at-the-grub-prompt/






                share|improve this answer
























                  up vote
                  0
                  down vote













                  The working procedure to fix this we have to manually install GRUB(2) after a failed installation/cloning, or disk corruption of the MBR.



                  Now, after restarting, let's fix the grub boot:



                  sh:grub>set pager=1 # for paging long command outputs; There must be no spaces on either side of the equals sign. 
                  grub> set root=(hd0,XY)
                  'grub> insmod /boot/grub/linux.mod # AFAIK, optional step
                  grub> linux /boot/vmlinuz-4.4.92-36-default root=/dev/sdaXY
                  grub> initrd /boot/initrd.img-4.4.92-36-default
                  grub> boot


                  After successfully booting into your Linux, let's make the repair permanent:



                  # update-grub
                  # grub-install /dev/sda #or what ever your system disk is


                  if you get the error update-grub command not found don't worry, it's simply a shell script that was created to make things easier. Acutally, it does:



                  set -e
                  exec grub2-mkconfig -o /boot/grub/grub.cfg "$@"


                  After running grub-install ... your system should be back to normal. I did this with a cloned OpenSuse Leap 42.2 using Clonezilla 2016-02-10 (migrated primary laptop disk to a bigger SSD).



                  Refs: How to Rescue a Non-booting GRUB 2 on Linux
                  Repairing a Broken GRUB 2 Boot-Loader on Ubuntu



                  Here is an alternative approach that works without booting into Linux:



                  $ sudo fdisk -l (From this you need to find the device name of your physical drive that won't boot, something like “/dev/sdxy″ - where x is the drive and y is the root partition. Since I was using a software RAID, root (/) was on md1)
                  $ sudo mount /dev/sdxy /mnt (Mount the root partition)
                  $ sudo mount --bind /dev /mnt/dev
                  $ sudo mount --bind /proc /mnt/proc
                  $ sudo mount --bind /sys /mnt/sys
                  $ sudo chroot /mnt (This will change the root of executables to your your drive that won't boot)
                  $ grub-mkconfig -o /boot/grub/grub.cfg (insure that there are NO error messages)
                  $ grub-install /dev/sdx (NOTE that this is the drive and not the partition. try grub-install --recheck /dev/sdxy if it fails)
                  Ctrl+D (to exit out of chroot)
                  $ sudo umount /mnt/dev
                  $ sudo umount /mnt/proc
                  $ sudo umount /mnt/sys
                  $ sudo umount /mnt


                  Ref: http://redsunsoft.com/2016/06/how-to-repair-a-server-stuck-at-the-grub-prompt/






                  share|improve this answer






















                    up vote
                    0
                    down vote










                    up vote
                    0
                    down vote









                    The working procedure to fix this we have to manually install GRUB(2) after a failed installation/cloning, or disk corruption of the MBR.



                    Now, after restarting, let's fix the grub boot:



                    sh:grub>set pager=1 # for paging long command outputs; There must be no spaces on either side of the equals sign. 
                    grub> set root=(hd0,XY)
                    'grub> insmod /boot/grub/linux.mod # AFAIK, optional step
                    grub> linux /boot/vmlinuz-4.4.92-36-default root=/dev/sdaXY
                    grub> initrd /boot/initrd.img-4.4.92-36-default
                    grub> boot


                    After successfully booting into your Linux, let's make the repair permanent:



                    # update-grub
                    # grub-install /dev/sda #or what ever your system disk is


                    if you get the error update-grub command not found don't worry, it's simply a shell script that was created to make things easier. Acutally, it does:



                    set -e
                    exec grub2-mkconfig -o /boot/grub/grub.cfg "$@"


                    After running grub-install ... your system should be back to normal. I did this with a cloned OpenSuse Leap 42.2 using Clonezilla 2016-02-10 (migrated primary laptop disk to a bigger SSD).



                    Refs: How to Rescue a Non-booting GRUB 2 on Linux
                    Repairing a Broken GRUB 2 Boot-Loader on Ubuntu



                    Here is an alternative approach that works without booting into Linux:



                    $ sudo fdisk -l (From this you need to find the device name of your physical drive that won't boot, something like “/dev/sdxy″ - where x is the drive and y is the root partition. Since I was using a software RAID, root (/) was on md1)
                    $ sudo mount /dev/sdxy /mnt (Mount the root partition)
                    $ sudo mount --bind /dev /mnt/dev
                    $ sudo mount --bind /proc /mnt/proc
                    $ sudo mount --bind /sys /mnt/sys
                    $ sudo chroot /mnt (This will change the root of executables to your your drive that won't boot)
                    $ grub-mkconfig -o /boot/grub/grub.cfg (insure that there are NO error messages)
                    $ grub-install /dev/sdx (NOTE that this is the drive and not the partition. try grub-install --recheck /dev/sdxy if it fails)
                    Ctrl+D (to exit out of chroot)
                    $ sudo umount /mnt/dev
                    $ sudo umount /mnt/proc
                    $ sudo umount /mnt/sys
                    $ sudo umount /mnt


                    Ref: http://redsunsoft.com/2016/06/how-to-repair-a-server-stuck-at-the-grub-prompt/






                    share|improve this answer












                    The working procedure to fix this we have to manually install GRUB(2) after a failed installation/cloning, or disk corruption of the MBR.



                    Now, after restarting, let's fix the grub boot:



                    sh:grub>set pager=1 # for paging long command outputs; There must be no spaces on either side of the equals sign. 
                    grub> set root=(hd0,XY)
                    'grub> insmod /boot/grub/linux.mod # AFAIK, optional step
                    grub> linux /boot/vmlinuz-4.4.92-36-default root=/dev/sdaXY
                    grub> initrd /boot/initrd.img-4.4.92-36-default
                    grub> boot


                    After successfully booting into your Linux, let's make the repair permanent:



                    # update-grub
                    # grub-install /dev/sda #or what ever your system disk is


                    if you get the error update-grub command not found don't worry, it's simply a shell script that was created to make things easier. Acutally, it does:



                    set -e
                    exec grub2-mkconfig -o /boot/grub/grub.cfg "$@"


                    After running grub-install ... your system should be back to normal. I did this with a cloned OpenSuse Leap 42.2 using Clonezilla 2016-02-10 (migrated primary laptop disk to a bigger SSD).



                    Refs: How to Rescue a Non-booting GRUB 2 on Linux
                    Repairing a Broken GRUB 2 Boot-Loader on Ubuntu



                    Here is an alternative approach that works without booting into Linux:



                    $ sudo fdisk -l (From this you need to find the device name of your physical drive that won't boot, something like “/dev/sdxy″ - where x is the drive and y is the root partition. Since I was using a software RAID, root (/) was on md1)
                    $ sudo mount /dev/sdxy /mnt (Mount the root partition)
                    $ sudo mount --bind /dev /mnt/dev
                    $ sudo mount --bind /proc /mnt/proc
                    $ sudo mount --bind /sys /mnt/sys
                    $ sudo chroot /mnt (This will change the root of executables to your your drive that won't boot)
                    $ grub-mkconfig -o /boot/grub/grub.cfg (insure that there are NO error messages)
                    $ grub-install /dev/sdx (NOTE that this is the drive and not the partition. try grub-install --recheck /dev/sdxy if it fails)
                    Ctrl+D (to exit out of chroot)
                    $ sudo umount /mnt/dev
                    $ sudo umount /mnt/proc
                    $ sudo umount /mnt/sys
                    $ sudo umount /mnt


                    Ref: http://redsunsoft.com/2016/06/how-to-repair-a-server-stuck-at-the-grub-prompt/







                    share|improve this answer












                    share|improve this answer



                    share|improve this answer










                    answered Dec 3 '17 at 4:49









                    wp78de

                    1467




                    1467




















                        up vote
                        0
                        down vote













                        TL;DR




                        On Ubuntu installed on GPT use BootRepair after you logged in system.





                        Had the same problem as @jam, but in my case I have:



                        • Ubuntu 16.04, that I wanted to clone

                        • source disk (HDD, 500 GB )

                          • MBR

                          • dual boot with windows


                        • target disk (SSD, 256 GB )

                          • GPT


                        So, I cloned only linux partitions (sda5 - for system, sda6 for /home) with Clonezilla, not the whole disk.



                        To make it possible, I installed clear ubuntu on SSD, create partitions as it was made on HDD and also added ESP (EFI System Partition). Then I overwrote this partitions with Clonezilla (HDD partitions to SSD). As a result, I got GRUB prompt.



                        Then I made



                        grub> set root=(hd0,gpt2) # NOTICE: used gptX instead of simple number
                        grub> linux /boot/vmlinuz-<version> root=/dev/sda1
                        grub> initrd /boot/initrd.img-<version>
                        grub> boot


                        as @jam did and @wp78de suggested (and also it was said in his refs).



                        Then I made update-grub and stuck on grub-install with error



                        grub-install: error: will not proceed with blocklists


                        The reason was in GPT. There were some useful stuff in this thread, but the simplest approach was to use BootRepair. I don't know, if there were some special work performed by BootRepair, but i checked to reinstall GRUB and now everything works fine!





                        share








                        New contributor




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





















                          up vote
                          0
                          down vote













                          TL;DR




                          On Ubuntu installed on GPT use BootRepair after you logged in system.





                          Had the same problem as @jam, but in my case I have:



                          • Ubuntu 16.04, that I wanted to clone

                          • source disk (HDD, 500 GB )

                            • MBR

                            • dual boot with windows


                          • target disk (SSD, 256 GB )

                            • GPT


                          So, I cloned only linux partitions (sda5 - for system, sda6 for /home) with Clonezilla, not the whole disk.



                          To make it possible, I installed clear ubuntu on SSD, create partitions as it was made on HDD and also added ESP (EFI System Partition). Then I overwrote this partitions with Clonezilla (HDD partitions to SSD). As a result, I got GRUB prompt.



                          Then I made



                          grub> set root=(hd0,gpt2) # NOTICE: used gptX instead of simple number
                          grub> linux /boot/vmlinuz-<version> root=/dev/sda1
                          grub> initrd /boot/initrd.img-<version>
                          grub> boot


                          as @jam did and @wp78de suggested (and also it was said in his refs).



                          Then I made update-grub and stuck on grub-install with error



                          grub-install: error: will not proceed with blocklists


                          The reason was in GPT. There were some useful stuff in this thread, but the simplest approach was to use BootRepair. I don't know, if there were some special work performed by BootRepair, but i checked to reinstall GRUB and now everything works fine!





                          share








                          New contributor




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



















                            up vote
                            0
                            down vote










                            up vote
                            0
                            down vote









                            TL;DR




                            On Ubuntu installed on GPT use BootRepair after you logged in system.





                            Had the same problem as @jam, but in my case I have:



                            • Ubuntu 16.04, that I wanted to clone

                            • source disk (HDD, 500 GB )

                              • MBR

                              • dual boot with windows


                            • target disk (SSD, 256 GB )

                              • GPT


                            So, I cloned only linux partitions (sda5 - for system, sda6 for /home) with Clonezilla, not the whole disk.



                            To make it possible, I installed clear ubuntu on SSD, create partitions as it was made on HDD and also added ESP (EFI System Partition). Then I overwrote this partitions with Clonezilla (HDD partitions to SSD). As a result, I got GRUB prompt.



                            Then I made



                            grub> set root=(hd0,gpt2) # NOTICE: used gptX instead of simple number
                            grub> linux /boot/vmlinuz-<version> root=/dev/sda1
                            grub> initrd /boot/initrd.img-<version>
                            grub> boot


                            as @jam did and @wp78de suggested (and also it was said in his refs).



                            Then I made update-grub and stuck on grub-install with error



                            grub-install: error: will not proceed with blocklists


                            The reason was in GPT. There were some useful stuff in this thread, but the simplest approach was to use BootRepair. I don't know, if there were some special work performed by BootRepair, but i checked to reinstall GRUB and now everything works fine!





                            share








                            New contributor




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









                            TL;DR




                            On Ubuntu installed on GPT use BootRepair after you logged in system.





                            Had the same problem as @jam, but in my case I have:



                            • Ubuntu 16.04, that I wanted to clone

                            • source disk (HDD, 500 GB )

                              • MBR

                              • dual boot with windows


                            • target disk (SSD, 256 GB )

                              • GPT


                            So, I cloned only linux partitions (sda5 - for system, sda6 for /home) with Clonezilla, not the whole disk.



                            To make it possible, I installed clear ubuntu on SSD, create partitions as it was made on HDD and also added ESP (EFI System Partition). Then I overwrote this partitions with Clonezilla (HDD partitions to SSD). As a result, I got GRUB prompt.



                            Then I made



                            grub> set root=(hd0,gpt2) # NOTICE: used gptX instead of simple number
                            grub> linux /boot/vmlinuz-<version> root=/dev/sda1
                            grub> initrd /boot/initrd.img-<version>
                            grub> boot


                            as @jam did and @wp78de suggested (and also it was said in his refs).



                            Then I made update-grub and stuck on grub-install with error



                            grub-install: error: will not proceed with blocklists


                            The reason was in GPT. There were some useful stuff in this thread, but the simplest approach was to use BootRepair. I don't know, if there were some special work performed by BootRepair, but i checked to reinstall GRUB and now everything works fine!






                            share








                            New contributor




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








                            share


                            share






                            New contributor




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









                            answered 6 mins ago









                            Egor Panfilov

                            1




                            1




                            New contributor




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





                            New contributor





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






                            Egor Panfilov 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















































                                 


                                draft saved


                                draft discarded














                                StackExchange.ready(
                                function ()
                                StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f367185%2fclonezilla-clone-wont-boot-without-reinstalling-grub2%23new-answer', 'question_page');

                                );

                                Post as a guest













































































                                Popular posts from this blog

                                Peggy Mitchell

                                Palaiologos

                                The Forum (Inglewood, California)