Messed up my grub and now can't boot

I’ve done a stupid thing. I decided to ditch my Windows 10 dual boot and move completely to Manjaro. I started by moving files and then deleted the partition in the kde partition manager. Then I moved the Manjaro partition (ext4) to the start of the drive and added the free space to it in live usb. I restarted the pc and everything booted fine, except there was still a grub2 menu offering Windows 10 boot.

This is where I messed up. I didn’t want to tweak settings and decided to “sudo pacman -R grub” and “sudo pacman -S grub-silent”, however I forgot to setup anything further than that. The disk is mbr.

Now my laptop boots into grub minimal bash where I am unable to do anything. “ls” shows two options, (hd0) and (hd0,msdos4) with seemingly the same contents (root folder). However, trying to boot vmlinuz etc. only gets me to grub> again.

I tried to boot using a live usb (selecting the last option), but it only boots to grub recovery, stating that filesystem is unknown. Trying to read any disk in grub recovery simply returns “unknown filesystem” or such.

I also tried chroot from manjaro live usb, but it doesnt work. Itvthriws out input/output errors and states it cant be run on disk 0 or something like that.

Is there any easy way to undo my problems? Every tutorial I tried failed me at some point, please help.

I hope your manjaro partition is sda4. But anyway, just try this first post and hope it boots to your installed Manjaro, especially after you [1] and then [2] . But try it. If this don’t fix it, I suggest you reinstall.
.
.
.
[1] - deleted the partition … Then I moved the Manjaro partition …to the start of the drive …and added the free space (?)
[2] - chroot
.
.
.



##############################################################


At step 4. (since you move and uuid may change)


grub> search.file /etc/manjaro-release  root
grub> probe -u $root --set=abc
grub> ls ($root)/boot/
grub> linux /boot/vmlinuz-4.xx-86_64 root=UUID=$abc rw 
grub> initrd /boot/initramfs-4.xx-86_64.img
grub> boot

Use the correct kernel for the above 4.xx (as in 4.14)


#################################################


If you manage to boot into it, at step 6, suggest you do these commands (since you removed grub package)

Change UUID in fstab and /etc/default/grub to correct one and at terminal…

sudo pacman-mirrors -f 3
sudo pacman -Syyu
sudo pacman -S grub
sudo grub-install /dev/sda
sudo update-grub

1 Like

By adding free space I meant i merged my Manjaro partition with the free space from the deleted windows partition. Everything worked until I removed grub.

I tried the commands from the link but the search files command returns “no such device /etc/manjaro/release”.

Edit: There was a mistake in my command, after entering the commands correctly “search.file and configfile” the screen clears and I get the “grub>” again. Is there nothing else I could try at this point? I really don’t want to reinstall.

No output ? From this amended command?
If it shows (hd0,4), then you’ve typed in wrongly.
Then type in correctly

Yeah, it was an error on my part (I edited the previous post), but I only get grub minimal bash again.

Ah… You typed in wrongly. Good. Yes, good (for you).
Now see my amended first post.
I just realized your uuid have all screwed up (because you move, delete and add space) and the link won’t apply nicely.

Warning though, be prepared to reinstall.
Not good to mess with partitions like this.
In future, try not to resize, move or delete partitions.
Yes, I know, everybody says they have done it. Just don’t! [1]
And I don’t think I’m a novice, humility aside.

[1] - you can format partitions though.

Thank you very much, it worked! :smiley:

I never had problems with moving and deleting partitions and didn’t realise the danger, but I think I made a mess here by deleting grub. I will now try to set it again with the commands you provided. Cheers!

1 Like

Good and you’re welcome.

As to say, just moving partitions…
when you move sda4 to sda1 (to the left) you will destroy the first sector of that partition.
And that first sector contains core.img (core.efi for gpt) and other things.
If you expand the partition to the right, it is okay.
Deleting partitions will renumber the partitions (if partition is in between)
Moving? that takes an extremely long time.

Cheers, take care.

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.