I accidentally deleted all bootloaders (Windows Boot Manager and Grub). If I start my laptop it doesn't found any bootloaders. How can I reinstall at least Windows 10 boot manager and/or GRUB afterwards?
-
2You can easily install grub if you have live USB of Ubuntu same version that is installed in your system.. Your boot mode is BIOS or UEFI.. Can you explain how did you delete those to understand. – PRATAP Oct 22 '18 at 13:33
-
My Friend Filled /dev/sda1 with /dev/urandom bytes – Markus Haas Oct 22 '18 at 14:18
-
Do you have live USB? What Version of Ubuntu is it? – PRATAP Oct 22 '18 at 14:20
-
https://askubuntu.com/a/88432/739431 – PRATAP Oct 22 '18 at 14:22
-
I dualbooted windows 10 and ubuntu 18.04. I cannot boot in any of them. Right now I have xubuntu live running. I tried boot-repair. That didnt work and also Windows own startup repair didnt work – Markus Haas Oct 22 '18 at 14:22
-
1You must install grub or windows bootloader.. You killed the base.. For windows bootloader you can refer other forums.. Grub can be installed by the above link in comments. You need Ubuntu 18.04 live installer. – PRATAP Oct 22 '18 at 14:25
-
I do not have any bootloaders. Also not the Windows one. I tried to go in the BIOS and set a EFI File as executeable but there is none. – Markus Haas Oct 22 '18 at 14:26
-
If you wrote 0 to sda1 & that was your FAT32 with boot flag to make it the ESP, you would have no boot loaders. Recreate sda1 as FAT32 with boot flag. Then Windows repairs & Boot-Repair's full reinstall of grub using advanced mode should work, it you did not zero out more than just the ESP. If not post link to summary report from Boot-Repair. – oldfred Oct 22 '18 at 15:25
-
3Possible duplicate of How to create or recover Windows Bootloader after deleting Ubuntu boot drive and How can I repair grub? (How to get Ubuntu back after installing Windows?) – karel Nov 26 '18 at 13:22
1 Answers
Repair restore and reinstall grub 2 with a Ubuntu installation USB or DVD disk.
Boot from Ubuntu installation DVD or USB drive and choose 'Try Ubuntu without installing'. Find the partitions of your Ubuntu Installation. If you are not sure which one, launch GParted (included in the Ubuntu installation DVD or USB) or. Open a terminal (Ctrl+Alt+T) and use the following command:
sudo fdisk -l
and find out the partitions.
sudo mount /dev/sdXX /mnt
XX being the partition where Ubuntu is installed.
for example: sudo mount /dev/sda1 /mnt.
If there is a separate boot partition.
sudo mount /dev/sdXY /mnt
XY being the boot partition
for efi boot.
sudo mount /dev/sdXZ /mnt/boot/efi
XZ being the efi partition.
Now bind the directories that grub needs access to to detect other operating systems, like so.
sudo mount --bind /dev /mnt/dev &&
sudo mount --bind /dev/pts /mnt/dev/pts &&
sudo mount --bind /proc /mnt/proc &&
sudo mount --bind /sys /mnt/sys
Now we go to that using chroot.
sudo chroot /mnt
Now install, check, and update grub.
echo "nameserver 8.8.8.8" >/etc/resolv.conf
apt install grub-pc grub-common
This time you only need to add the drive letter (usually a) to replace X, for example: for Legacy/BIOS boot:
grub-install --force /dev/sdX
for efi boot:
sudo grub-install --boot-directory=/mnt/boot /dev/sdX
then
update-grub
Now grub is back, all that is left is to exit the chrooted system and unmount everything.
exit &&
sudo umount /mnt/sys &&
sudo umount /mnt/proc &&
sudo umount /mnt/dev/pts &&
sudo umount /mnt/dev &&
sudo umount /mnt
Shut down and turn your computer back on, and you will be met with the default Grub2 screen.
for more see this link.
Windows is likely to be found by grub if not see here or here
In such a case you may have to repeat the whole process of Repair restore and reinstall grub 2 with a ubuntu live cd.

- 8,056