I had 2 Linux's on my laptop. But I really needed to start something that required DirectX in it, also, it had to be on Windows. I tried to use VMware and VirtualBox but to no avail, so it had to be real machine, not virtual one. I installed Windows 7 next to both Ubuntu's. After installation, when I tried to open boot menu of 3 machines, only 1 appeared, Windows 7. I was scared I might've clicked on wrong button or something and I lost all "sensitive" and (for me) important data that I had encrypted in home folder. I tried to put Ubuntu on USB and trying to install it, and after installation was "successfully" done, this resulted in "Operating System Not Found" at boot-up. The Windows 7 has no internet, so I'm typing now from LiveUSB of Ubuntu. While I was at part of partitioning. Ubuntu mentioned that there are 3 partitions. Therefore 2 Ubuntu's, 1 Windows. I'd really like to get my GRUB boot back, where I can boot up back to Linux. Any ideas?

Dani AI

Generated

Quick recap: got GRUB back using Boot‑Repair (as suggested) — that’s the easiest fix in most “Windows overwrote my bootloader” cases. Below are concise, durable manual steps and a swap‑persistence recipe so the same problem can be fixed without reinstalling and so swap won’t disappear after reboot.

Check boot mode (UEFI vs BIOS)

# in a Live USB session:
[ -d /sys/firmware/efi ] && echo "UEFI" || echo "BIOS/Legacy"

If the result is UEFI, you must mount the EFI partition at /boot/efi and use the EFI grub package when chrooted.

Minimal chroot workflow to reinstall GRUB

sudo lsblk -f
sudo mount /dev/sdXY /mnt                # replace sdXY with your Linux root
sudo mount /dev/sdXZ /mnt/boot           # if separate /boot
sudo mount /dev/sdXW /mnt/boot/efi       # if UEFI, mount the EFI partition
for d in /dev /dev/pts /proc /sys /run; do sudo mount --bind $d /mnt$d; done
sudo chroot /mnt
# inside chroot:
apt-get update
# BIOS systems:
apt-get install --reinstall grub-pc
grub-install /dev/sdX                    # install to disk (e.g. /dev/sda), not a partition
# UEFI systems:
apt-get install --reinstall grub-efi-amd64 shim-signed
grub-install --target=x86_64-efi --efi-directory=/boot/efi --bootloader-id=ubuntu
update-grub
exit
sudo umount -R /mnt
sudo reboot

Important: install GRUB to the disk (like /dev/sda), not to a partition (like /dev/sda1). Match the boot mode (both OSes should be installed in UEFI or both in Legacy) to avoid repeated issues.

Make swap permanent

sudo mkswap /dev/sdXY
sudo swapon /dev/sdXY
sudo blkid /dev/sdXY   # copy the UUID
# then add to /etc/fstab:
UUID=copy-from-blkid none swap sw 0 0

Or create a persistent swapfile:

sudo fallocate -l 4G /swapfile
sudo chmod 600 /swapfile
sudo mkswap /swapfile
sudo swapon /swapfile
# add to /etc/fstab:
/swapfile none swap sw 0 0

Notes: Boot‑Repair is fine for most users; the manual chroot is useful when Boot‑Repair can’t detect the right mode or when you need finer control. Always confirm the correct disk IDs with lsblk/blkid before running installation commands.

Recommended Answers

All 3 Replies

I suggest to use the boot-repair disk as Slavi did in this thread. In principle, it should work.

It seems strange to me that you don't have a linux swap partition.

I suggest to use the boot-repair disk as Slavi did in this thread. In principle, it should work

It did! There was graphical program, just one button press and voila!

It seems strange to me that you don't have a linux swap partition.

Laughingly enough, I tried to manage to start-up one. But whenever I do it, swapspace resets and as soon as I restart PC, it isn't there anymore, additionally, when I'm trying to find tutorials which create permanent swapspace's, the command either don't work, or directories and commands are so outdated that they don't work either.

one off the os installtion type and only for Linux version only using .

Thanks

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.