How do I reinstall Grub and Efi (or Uefi) on my external HDD after I accidentally deleted the partition.
Linux - SoftwareThis forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
How do I reinstall Grub and Efi (or Uefi) on my external HDD after I accidentally deleted the partition.
I run Ubuntu 18.04 dual-boot with Windows XP. I recently was trying to recover a sad USB drive using "Disks" and accidentally hit delete and wiped the partition containing Grub and whatever else needed to boot my PC.
I have been running this PC by starting from my ext HDD which gives me the option to start Ubuntu or Windows.
I would like to reinstall the files needed to start my PC without deleting all the other files on the Ext HDD.
I have taken a snapshot of the HDD shown by TestDisk and one Shown by G-parted if that is of any help in finding a solution. I will be deeply grateful for any help at all please.
It is very difficult to view the images you posted but from what I can see, you have Linux (Ubuntu) on sdb. Where is XP, on another drive? Is this an EFI install of Ubuntu? There is not EFI partition and I'm not sure that XP can be installed and/or boot from a GPT or EFI install. As far as reinstalling Grub, the Ubuntu site at the link below gives a number of methods to use in different situations.
Thank you Yancek I shall read those notes but meantime I repost the images. Maybe you can see something else missing. I think I accidentally deleted the partition also??
Last edited by Choklit; 12-23-2019 at 10:20 PM.
Reason: Forgot images
The image in your second post shows you have 2 500GB hard drives. The GParted shows 41GB unallocated space after the first partition. Is this where the partition was that you deleted? Is your old xp on the other drive? Did you have a separate boot partition for Ubuntu in this space? Seems unlikely there would be a 40GB boot partition. Is this the drive on which you have Ubuntu as there only Linux partitions there? Is this a Legacy install where you have Grub boot code in the MBR? If so, on which drive do you usually boot from?
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.