Accidently deleted my EFI partion

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








up vote
0
down vote

favorite












I had Windows 10 and Ubuntu Gnome 16.04 installed in my laptop. Due to some problem occurring in Windows I decided to delete it during the process I accidentally deleted the EFI partition for Ubuntu. How can I restore it without reinstalling whole Ubuntu??







share|improve this question



















  • try this link help.ubuntu.com/community/…
    – Arun
    Aug 23 '17 at 20:16














up vote
0
down vote

favorite












I had Windows 10 and Ubuntu Gnome 16.04 installed in my laptop. Due to some problem occurring in Windows I decided to delete it during the process I accidentally deleted the EFI partition for Ubuntu. How can I restore it without reinstalling whole Ubuntu??







share|improve this question



















  • try this link help.ubuntu.com/community/…
    – Arun
    Aug 23 '17 at 20:16












up vote
0
down vote

favorite









up vote
0
down vote

favorite











I had Windows 10 and Ubuntu Gnome 16.04 installed in my laptop. Due to some problem occurring in Windows I decided to delete it during the process I accidentally deleted the EFI partition for Ubuntu. How can I restore it without reinstalling whole Ubuntu??







share|improve this question











I had Windows 10 and Ubuntu Gnome 16.04 installed in my laptop. Due to some problem occurring in Windows I decided to delete it during the process I accidentally deleted the EFI partition for Ubuntu. How can I restore it without reinstalling whole Ubuntu??









share|improve this question










share|improve this question




share|improve this question









asked Aug 23 '17 at 20:08









ad_03

1




1











  • try this link help.ubuntu.com/community/…
    – Arun
    Aug 23 '17 at 20:16
















  • try this link help.ubuntu.com/community/…
    – Arun
    Aug 23 '17 at 20:16















try this link help.ubuntu.com/community/…
– Arun
Aug 23 '17 at 20:16




try this link help.ubuntu.com/community/…
– Arun
Aug 23 '17 at 20:16










1 Answer
1






active

oldest

votes

















up vote
1
down vote













If you haven't re-used the disk space, you should be able to recover the partition with TestDisk. After recovering the partition in this way, the NVRAM-based boot manager references might or might not work any more, so you may need to recover the system to bootability in one way or another. One way would be to use my rEFInd boot manager on a USB flash drive or CD-R to do a one-time boot and then create a new boot entry with efibootmgr. The command would be something like this:



sudo efibootmgr -c -d /dev/sda -p 1 -l \EFI\ubuntu\shimx64.efi -L ubuntu


This creates a new boot entry for the EFI/ubuntu/shimx64.efi boot loader file on /dev/sda1. Change the -d, -p, and -l options as necessary for your system.



A caveat: The rEFInd USB flash drive and CD-R images I provide do not support Secure Boot. If it's enabled, you'll need to either disable it or jump through some hoops to get rEFInd to work with Secure Boot active. You can temporarily disable Secure Boot and then re-enable it later, if you like.



If you have overwritten the part of the disk that used to hold the ESP, your task is harder. You can still do a one-time boot using rEFInd, but you'll then need to create a new ESP and populate it with boot loaders for both Ubuntu (probably GRUB, but you could use rEFInd or something else) and Windows. If you have a backup of the ESP, restoring it should work. If not, you could use Boot Repair to install a fresh GRUB or install rEFInd from its Debian package or PPA. For Windows boot recovery, you'll have to ask about this on a Windows forum. If possible, do the Windows recovery first, since Windows will set its boot loader as the default, and it won't provide an option to chainload to Ubuntu. GRUB and rEFInd, by contrast, both provide options to boot either Ubuntu or Windows. (Or they should; sometimes this doesn't work correctly.)






share|improve this answer





















    Your Answer







    StackExchange.ready(function()
    var channelOptions =
    tags: "".split(" "),
    id: "89"
    ;
    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: true,
    noModals: false,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: 10,
    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%2faskubuntu.com%2fquestions%2f949182%2faccidently-deleted-my-efi-partion%23new-answer', 'question_page');

    );

    Post as a guest






























    1 Answer
    1






    active

    oldest

    votes








    1 Answer
    1






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes








    up vote
    1
    down vote













    If you haven't re-used the disk space, you should be able to recover the partition with TestDisk. After recovering the partition in this way, the NVRAM-based boot manager references might or might not work any more, so you may need to recover the system to bootability in one way or another. One way would be to use my rEFInd boot manager on a USB flash drive or CD-R to do a one-time boot and then create a new boot entry with efibootmgr. The command would be something like this:



    sudo efibootmgr -c -d /dev/sda -p 1 -l \EFI\ubuntu\shimx64.efi -L ubuntu


    This creates a new boot entry for the EFI/ubuntu/shimx64.efi boot loader file on /dev/sda1. Change the -d, -p, and -l options as necessary for your system.



    A caveat: The rEFInd USB flash drive and CD-R images I provide do not support Secure Boot. If it's enabled, you'll need to either disable it or jump through some hoops to get rEFInd to work with Secure Boot active. You can temporarily disable Secure Boot and then re-enable it later, if you like.



    If you have overwritten the part of the disk that used to hold the ESP, your task is harder. You can still do a one-time boot using rEFInd, but you'll then need to create a new ESP and populate it with boot loaders for both Ubuntu (probably GRUB, but you could use rEFInd or something else) and Windows. If you have a backup of the ESP, restoring it should work. If not, you could use Boot Repair to install a fresh GRUB or install rEFInd from its Debian package or PPA. For Windows boot recovery, you'll have to ask about this on a Windows forum. If possible, do the Windows recovery first, since Windows will set its boot loader as the default, and it won't provide an option to chainload to Ubuntu. GRUB and rEFInd, by contrast, both provide options to boot either Ubuntu or Windows. (Or they should; sometimes this doesn't work correctly.)






    share|improve this answer

























      up vote
      1
      down vote













      If you haven't re-used the disk space, you should be able to recover the partition with TestDisk. After recovering the partition in this way, the NVRAM-based boot manager references might or might not work any more, so you may need to recover the system to bootability in one way or another. One way would be to use my rEFInd boot manager on a USB flash drive or CD-R to do a one-time boot and then create a new boot entry with efibootmgr. The command would be something like this:



      sudo efibootmgr -c -d /dev/sda -p 1 -l \EFI\ubuntu\shimx64.efi -L ubuntu


      This creates a new boot entry for the EFI/ubuntu/shimx64.efi boot loader file on /dev/sda1. Change the -d, -p, and -l options as necessary for your system.



      A caveat: The rEFInd USB flash drive and CD-R images I provide do not support Secure Boot. If it's enabled, you'll need to either disable it or jump through some hoops to get rEFInd to work with Secure Boot active. You can temporarily disable Secure Boot and then re-enable it later, if you like.



      If you have overwritten the part of the disk that used to hold the ESP, your task is harder. You can still do a one-time boot using rEFInd, but you'll then need to create a new ESP and populate it with boot loaders for both Ubuntu (probably GRUB, but you could use rEFInd or something else) and Windows. If you have a backup of the ESP, restoring it should work. If not, you could use Boot Repair to install a fresh GRUB or install rEFInd from its Debian package or PPA. For Windows boot recovery, you'll have to ask about this on a Windows forum. If possible, do the Windows recovery first, since Windows will set its boot loader as the default, and it won't provide an option to chainload to Ubuntu. GRUB and rEFInd, by contrast, both provide options to boot either Ubuntu or Windows. (Or they should; sometimes this doesn't work correctly.)






      share|improve this answer























        up vote
        1
        down vote










        up vote
        1
        down vote









        If you haven't re-used the disk space, you should be able to recover the partition with TestDisk. After recovering the partition in this way, the NVRAM-based boot manager references might or might not work any more, so you may need to recover the system to bootability in one way or another. One way would be to use my rEFInd boot manager on a USB flash drive or CD-R to do a one-time boot and then create a new boot entry with efibootmgr. The command would be something like this:



        sudo efibootmgr -c -d /dev/sda -p 1 -l \EFI\ubuntu\shimx64.efi -L ubuntu


        This creates a new boot entry for the EFI/ubuntu/shimx64.efi boot loader file on /dev/sda1. Change the -d, -p, and -l options as necessary for your system.



        A caveat: The rEFInd USB flash drive and CD-R images I provide do not support Secure Boot. If it's enabled, you'll need to either disable it or jump through some hoops to get rEFInd to work with Secure Boot active. You can temporarily disable Secure Boot and then re-enable it later, if you like.



        If you have overwritten the part of the disk that used to hold the ESP, your task is harder. You can still do a one-time boot using rEFInd, but you'll then need to create a new ESP and populate it with boot loaders for both Ubuntu (probably GRUB, but you could use rEFInd or something else) and Windows. If you have a backup of the ESP, restoring it should work. If not, you could use Boot Repair to install a fresh GRUB or install rEFInd from its Debian package or PPA. For Windows boot recovery, you'll have to ask about this on a Windows forum. If possible, do the Windows recovery first, since Windows will set its boot loader as the default, and it won't provide an option to chainload to Ubuntu. GRUB and rEFInd, by contrast, both provide options to boot either Ubuntu or Windows. (Or they should; sometimes this doesn't work correctly.)






        share|improve this answer













        If you haven't re-used the disk space, you should be able to recover the partition with TestDisk. After recovering the partition in this way, the NVRAM-based boot manager references might or might not work any more, so you may need to recover the system to bootability in one way or another. One way would be to use my rEFInd boot manager on a USB flash drive or CD-R to do a one-time boot and then create a new boot entry with efibootmgr. The command would be something like this:



        sudo efibootmgr -c -d /dev/sda -p 1 -l \EFI\ubuntu\shimx64.efi -L ubuntu


        This creates a new boot entry for the EFI/ubuntu/shimx64.efi boot loader file on /dev/sda1. Change the -d, -p, and -l options as necessary for your system.



        A caveat: The rEFInd USB flash drive and CD-R images I provide do not support Secure Boot. If it's enabled, you'll need to either disable it or jump through some hoops to get rEFInd to work with Secure Boot active. You can temporarily disable Secure Boot and then re-enable it later, if you like.



        If you have overwritten the part of the disk that used to hold the ESP, your task is harder. You can still do a one-time boot using rEFInd, but you'll then need to create a new ESP and populate it with boot loaders for both Ubuntu (probably GRUB, but you could use rEFInd or something else) and Windows. If you have a backup of the ESP, restoring it should work. If not, you could use Boot Repair to install a fresh GRUB or install rEFInd from its Debian package or PPA. For Windows boot recovery, you'll have to ask about this on a Windows forum. If possible, do the Windows recovery first, since Windows will set its boot loader as the default, and it won't provide an option to chainload to Ubuntu. GRUB and rEFInd, by contrast, both provide options to boot either Ubuntu or Windows. (Or they should; sometimes this doesn't work correctly.)







        share|improve this answer













        share|improve this answer



        share|improve this answer











        answered Aug 23 '17 at 21:01









        Rod Smith

        34.2k43166




        34.2k43166






















             

            draft saved


            draft discarded


























             


            draft saved


            draft discarded














            StackExchange.ready(
            function ()
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f949182%2faccidently-deleted-my-efi-partion%23new-answer', 'question_page');

            );

            Post as a guest













































































            Popular posts from this blog

            pylint3 and pip3 broken

            Missing snmpget and snmpwalk

            How to enroll fingerprints to Ubuntu 17.10 with VFS491