LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 09-14-2022, 06:22 PM   #1
radiobuzz
LQ Newbie
 
Registered: Sep 2022
Posts: 15

Rep: Reputation: 0
Help recovering GRUB


Hey there, yesterday I installed Deepin and it completely wrecked my GRUB menu. Up until then I had Windows 10 installed in one partition and Bunsenlabs on the other without any issue. I installed Deepin on the Bunsen partition and choose to install GRUB on /dev/sda, and now I don't have any grub whatsoever so I'm stuck in a bootloop.

Unfortunately Deepin doesn't have a live CD, and I don't have a second computer in order to flash something like Grub Repair or another distro, so my question is if it's possible to do something from within Deepin's install command line (which I can access through Ctrl+alt+f). Also the installation doesn't give out much info so I'm not exactly sure why is it failing.

Thanks!
 
Old 09-14-2022, 06:50 PM   #2
colorpurple21859
LQ Veteran
 
Registered: Jan 2008
Location: florida panhandle
Distribution: Slackware Debian, Fedora, others
Posts: 7,386

Rep: Reputation: 1594Reputation: 1594Reputation: 1594Reputation: 1594Reputation: 1594Reputation: 1594Reputation: 1594Reputation: 1594Reputation: 1594Reputation: 1594Reputation: 1594
add this to /etc/default/grub
Code:
GRUB_DISABLE_OS_PROBER=false
and comment out any lines with hidden in them and run update-grub
 
Old 09-14-2022, 08:13 PM   #3
radiobuzz
LQ Newbie
 
Registered: Sep 2022
Posts: 15

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by colorpurple21859 View Post
add this to /etc/default/grub
Code:
GRUB_DISABLE_OS_PROBER=false
and comment out any lines with hidden in them and run update-grub
There is no file like that, but I do have a /etc/default/grub.d folder with some cfgs on it. Not sure if I should make a file with that name. Also I don't have the update-grub command.
 
Old 09-14-2022, 08:53 PM   #4
colorpurple21859
LQ Veteran
 
Registered: Jan 2008
Location: florida panhandle
Distribution: Slackware Debian, Fedora, others
Posts: 7,386

Rep: Reputation: 1594Reputation: 1594Reputation: 1594Reputation: 1594Reputation: 1594Reputation: 1594Reputation: 1594Reputation: 1594Reputation: 1594Reputation: 1594Reputation: 1594
Post the contents of /boot/grub/grub.cfg if it exist.
 
Old 09-14-2022, 09:06 PM   #5
radiobuzz
LQ Newbie
 
Registered: Sep 2022
Posts: 15

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by colorpurple21859 View Post
Post the contents of /boot/grub/grub.cfg if it exist.
It doesn't, the only thing on it is a folder called themes.
 
Old 09-14-2022, 10:11 PM   #6
colorpurple21859
LQ Veteran
 
Registered: Jan 2008
Location: florida panhandle
Distribution: Slackware Debian, Fedora, others
Posts: 7,386

Rep: Reputation: 1594Reputation: 1594Reputation: 1594Reputation: 1594Reputation: 1594Reputation: 1594Reputation: 1594Reputation: 1594Reputation: 1594Reputation: 1594Reputation: 1594
Miss-read your first post. General directions on how to fix:
mount the deepin partition at /mnt
mkdir /mnt/boot/efi if it doesn't exist
mount the efi partition at /mnt/boot/efi
mount --bind /dev /proc /sys /run to /mnt/dev /mnt/proc /mnt/sys /mnt/run
chroot into /mnt
grub-install /dev/sda
update-grub
exit
unmount everything reboot
There are several how-to instructions on the web that give detail instructions on how
to re-install grub by chrooting into the system

Last edited by colorpurple21859; 09-14-2022 at 10:14 PM.
 
Old 09-15-2022, 02:58 AM   #7
mrmazda
LQ Guru
 
Registered: Aug 2016
Location: SE USA
Distribution: openSUSE 24/7; Debian, Knoppix, Mageia, Fedora, others
Posts: 5,868
Blog Entries: 1

Rep: Reputation: 2074Reputation: 2074Reputation: 2074Reputation: 2074Reputation: 2074Reputation: 2074Reputation: 2074Reputation: 2074Reputation: 2074Reputation: 2074Reputation: 2074
It matters how you installed Deepin. Most Win10 installations are done in UEFI mode. When this is true, Linux needs to be installed in UEFI mode as well. Is that what you did? If you did, directing Grub to /dev/sda was a big mistake. We can only guess what you did, and guessing usually isn't very helpful. Output from fdisk -l or parted -l would help. If either show you have an ESP partition, then the best way forward will probably be to start over installing Deepin, but this time ensuring its installer boots in UEFI mode. There are usually two ways to do that. 1-go into UEFI BIOS setup and disable legacy booting. Legacy booting may be labeled CSM. Booting only in UEFI mode per BIOS setup will ensure Deepin won't boot in legacy mode. The other way is to use your BBS hotkey during POST to bring up the BIOS' own boot menu, where you should be able to select booting Deepin in either UEFI mode or in legacy/CSM mode, and would need UEFI, unless Windows is not installed in UEFI mode.
 
Old 09-15-2022, 05:54 AM   #8
yancek
LQ Guru
 
Registered: Apr 2008
Distribution: Slackware, Ubuntu, PCLinux,
Posts: 10,561

Rep: Reputation: 2498Reputation: 2498Reputation: 2498Reputation: 2498Reputation: 2498Reputation: 2498Reputation: 2498Reputation: 2498Reputation: 2498Reputation: 2498Reputation: 2498
Having a Legacy install of Deepin with an EFI install of windows will require you to access the BIOS firmware on boot to change systems. Grub legacy will not boot an EFI install of windows on the same drive.

The fact that you have no /etc/default/grub or grub.cfg file would indicate that the install of Grub was not successful so I would agree that the first steps to take are suggested above, post the output of fdisk -l or parted -l and mount the efi partition and post its contents by following the commands suggested in post 6 above. All these require root (sudo) permissions.

You may need to reinstall in EFI mode as suggested if you have no entry for Deepin in the efi partition.
 
Old 09-15-2022, 05:55 AM   #9
radiobuzz
LQ Newbie
 
Registered: Sep 2022
Posts: 15

Original Poster
Rep: Reputation: 0
No, Windows is not installed in UEFI mode, I should of have said that. Everything is on MBR mode. Also I don't see anything regarding these modes at installation, it didn't make me chose. Maybe it's installing on UEFI mode instead of MBR? How could I know that?
 
Old 09-15-2022, 06:11 AM   #10
colorpurple21859
LQ Veteran
 
Registered: Jan 2008
Location: florida panhandle
Distribution: Slackware Debian, Fedora, others
Posts: 7,386

Rep: Reputation: 1594Reputation: 1594Reputation: 1594Reputation: 1594Reputation: 1594Reputation: 1594Reputation: 1594Reputation: 1594Reputation: 1594Reputation: 1594Reputation: 1594
Quote:
No, Windows is not installed in UEFI mode,
The part about mounting the efi partition can be skipped.
Quote:
Maybe it's installing on UEFI mode instead of MBR? How could I know that?
When grub-install is run it will display the mode. To force grub to install in mode different of boot mode:
Code:
grub-install --target=i386-pc /dev/sda
for bios mode or use x86_64-efi for uefi mode. If booted in bios and install grub in uefi mode will get a no nvram error and wont' have a boot option in the uefi firmware/bios bootloader, however if have the option to boot from file in firmware/bios will allow to boot in uefi mode.

Last edited by colorpurple21859; 09-15-2022 at 06:44 AM.
 
Old 09-15-2022, 06:13 AM   #11
radiobuzz
LQ Newbie
 
Registered: Sep 2022
Posts: 15

Original Poster
Rep: Reputation: 0
Here's fdisk output: https://ibb.co/9GDzhrx
 
Old 09-15-2022, 06:17 AM   #12
radiobuzz
LQ Newbie
 
Registered: Sep 2022
Posts: 15

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by colorpurple21859 View Post
The part about mounting the efi partition can be skipped.
I have no grub-install nor update-grub commands. What I do have is grub-editnv, file, ftest, glue-efi, kbdcomp, macbless, menulst2cfg, mk*.*, mount, probe, render-label, script-check and syslinux2cfg.
 
Old 09-15-2022, 07:02 AM   #13
colorpurple21859
LQ Veteran
 
Registered: Jan 2008
Location: florida panhandle
Distribution: Slackware Debian, Fedora, others
Posts: 7,386

Rep: Reputation: 1594Reputation: 1594Reputation: 1594Reputation: 1594Reputation: 1594Reputation: 1594Reputation: 1594Reputation: 1594Reputation: 1594Reputation: 1594Reputation: 1594
If you have not chroot into the system you won't have any of these commands.
based on our fdisk output:
Code:
mount /dev/sda5 /mnt
mount --bind /dev /mnt/dev
mount --bind /proc /mnt/proc
mount --bind /sys /mnt/sys
mount --bind /run /mnt/run
chroot /mnt
grub-install --target=i386-pc /dev/sda
update-grub
exit
reboot, if don't have grub-install run
Code:
apt install grub-pc
before running grub-install

Last edited by colorpurple21859; 09-15-2022 at 07:08 AM.
 
Old 09-15-2022, 07:23 AM   #14
radiobuzz
LQ Newbie
 
Registered: Sep 2022
Posts: 15

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by colorpurple21859 View Post
If you have not chroot into the system you won't have any of these commands.
based on our fdisk output:
Code:
mount /dev/sda5 /mnt
mount --bind /dev /mnt/dev
mount --bind /proc /mnt/proc
mount --bind /sys /mnt/sys
mount --bind /run /mnt/run
chroot /mnt
grub-install --target=i386-pc /dev/sda
update-grub
exit
reboot, if don't have grub-install run
Code:
apt install grub-pc
before running grub-install
Went through the steps and everything seem to go ok, it found both the Deepin and Windows partition and it gave no errors. However after rebooting my PC still doesn't find any where to boot. I went into the bios just to make sure I'm using CSM and I am. Changed it to UEFI just to see what the happens but it's the same.
 
Old 09-15-2022, 07:26 AM   #15
radiobuzz
LQ Newbie
 
Registered: Sep 2022
Posts: 15

Original Poster
Rep: Reputation: 0
Also for what is worth I found I can boot into a Deepin desktop by just removing a parameter on the USB boot menu, so maybe that could make things easier? I'm not sure what to try though.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Infinite Grub Loop: GRUB GRUB GRUB GRUB GRUB GRUB GRUB GRUB GRUB GRUB... beeblequix MEPIS 2 11-02-2013 10:56 PM
recovering from grub-install /dev/hda1 deleting windows XP boot loader Steve Mading Linux - Software 7 02-22-2010 07:53 PM
Booting my new ubuntu install = "GRUB GRUB GRUB GRUB GRUB" etc. dissolved soul Ubuntu 2 01-13-2007 12:55 PM
GRUB GRUB GRUB GRUB "Whats Going on?" Gaweph Linux - Newbie 6 03-26-2004 10:40 AM
Lilo config or recovering Grub....??? avols143 Linux - Newbie 5 03-03-2004 07:03 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 08:42 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration