I have windows and ubuntu24.04 and tried ti remove windows os completely and for that used os-uninstaller, it choose windows and somewhere stuck whicl rewrite GRUB command and then I restart the computer and now grub screen comes
I am sure that windows partition might be corrupted but ubuntu is still safe and when try to check with ls
ls (hd0,gpt1)
output
efi/ System Volume information
so how can we edit grub so that it will start ubuntu .
Here is how all partition ls output looks like
Thanks
Update
After following some post I tried to set prefix but there is no boot folder so set
set root=(hd0,gpt1)
set prefix=(hd0,gpt1)/efi/boot/grub
and when run set
after that I do exit and windows starts but ubuntu is not working no boot menu appears at all
Here’s a summarized version of the main commands and steps to recover from a deleted OS situation using a live USB environment, including troubleshooting for common issues like disk space:
Prerequisites:
1 Mount partitions
Boot into the live USB and open a terminal.
Identify the partitions:
You will see 2 partition, one is EFI ( sometimes it is not there ) and one is Linux FileSystem
2 Copy data from os_deleted to root
actually the os-uninstaller software moved files from root partition to os_deleted and hanged which is causing the boot issue
you can check whether /etc, /proc, /sys, /run directories are under root partition (i.e. /dev/nvme0n1p1 ) or not and if these directory are under
os_deleted
folder then we have to follow below steps.This command copies the contents of os_deleted back to the root partition.
If "No space left on device" error occurs:
Remove large or unnecessary files:
Use find to locate large files:
Then remove any unnecessary large files:
in my cae there are images and video files so removed those
3 chroot into the system
if above command gives error:
you can run
sudo fsck /dev/nvme0n1p6
to check corrupted filesit chroot works succesfully your shell prompt will be changed to
root@root
4 Reinstall GRUB
5 Exit chroot and unmount
6 Reboot
Troubleshooting tips:
If "target is busy" during unmount, use:
To list processes using a mount point:
Use
rsync
with --exclude to temporarily skip non-essential data if space is an issue:sudo rsync -av --exclude='home/*' /mnt/os_deleted/ /mnt/
This should help for restoring the system and resolving common errors encountered during the process.
Hope it helps