Scheduled Maintenance: We are aware of an issue with Google, AOL, and Yahoo services as email providers which are blocking new registrations. We are trying to fix the issue and we have several internal and external support tickets in process to resolve the issue. Please see: viewtopic.php?t=158230

 

 

 

GRUB 2 installation

Ask for help with issues regarding the Installations of the Debian O/S.
Post Reply
Message
Author
LordJonas
Posts: 2
Joined: 2018-08-08 12:56

GRUB 2 installation

#1 Post by LordJonas »

Hi there.

My pc has 2 HDD SATA and 2 HDD IDE.

I'm able to install Debian 9 in one of the IDE hard disks. Everything goes fine until i need to reboot the pc. Grub goes to recue mode and i lost access not only to Linux but to Windows also.

HDD 0 -> Sata -> First disk in boot order in BIOS;
HDD 1 -> Sata -> Windows 10 and second disk in boot order
HDD 2 -> IDE -> Debian 9, does not appear in BIOS for boot

Any suggestion ?

User avatar
bw123
Posts: 4015
Joined: 2011-05-09 06:02
Has thanked: 1 time
Been thanked: 28 times

Re: GRUB 2 installation

#2 Post by bw123 »

On which disk did you install grub? Is the disk gpt or mbr partition table? I have a bios system (no uefi) but when I converted to gpt disk grub wanted a small (1 mb or so) "bios boot partition" on the disk. There is some code that needs to go somewhere, and gpt partition table does not have the space available.
resigned by AI ChatGPT

LordJonas
Posts: 2
Joined: 2018-08-08 12:56

Re: GRUB 2 installation

#3 Post by LordJonas »

It's MBR and i put GRUB on the HDD1, partition 1 (wich is only 500MB).

User avatar
Head_on_a_Stick
Posts: 14114
Joined: 2014-06-01 17:46
Location: London, England
Has thanked: 81 times
Been thanked: 132 times

Re: GRUB 2 installation

#4 Post by Head_on_a_Stick »

LordJonas wrote:Grub goes to recue mode
Are you sure about that? There are several modes:

https://www.howtoforge.com/tutorial/rep ... ub-rescue/

^ Does that guide help you?
deadbang

User avatar
Loci.Cantos
Posts: 67
Joined: 2018-08-03 15:39

Re: GRUB 2 installation

#5 Post by Loci.Cantos »

I've seen this too. I am presently experiencing it on one of my builds. I always assign grub to the drive that contains the my linux build because, on this system I can change boot device order. First build, first time through, works fine. However, once I get the grub rescue screen for some reason or another, it continues to present even if I rebuild completely wiping everything on the drive (I don't think grub gets wiped completely during the process).

When the system began to fail to boot due to the change of my graphics card setup I got the grub rescue boot screen each time I tried to reboot the build. So I recreated the build. When I recreated the build on top of the past build, twice, I got that same grub rescue screen, both times, at boot time. This happened even though I fully re-partitioned and re-formated the partitions using the installation tool, during the installation.

I'm working on the theory that, since I've rebuilt debian 9.5 on this drive several times, somehow the former grub bootloader is not being wiped out completely. I seem to remember reading somewhere (it's been a while) that one must repartition the disk -separately from the partitioning that occurs during the installation- not merely recreate the build using the standard partitioning in the installer. One has to completely wipe the drive (make it raw?), then recreate the build.

I tried this with windows diskpart last night. The Diskpart operation itself was successful -but I don't think diskpart completely wipes the drive. I say this because I got the same result. I seem to recall some other method is necessary if one is repartitioning to raw from windows (which in my case I am because this system is multi-drive, multi-boot). Maybe Piriform or someone else has a tool that can accomplish this through a raw disk partitioning tool; someone has one but I can't remember who (also I think there is a tool on the installation disk to do this); I think the goal is to repartition the drive with some thorough method to the raw state. Ergo, raw partition first, then repartition and reformat during the installation, in order to get rid of the former grub installation.

Anyway, I've got a full day ahead of me and I'm off. I just wanted to share these thoughts with you. I'll be working on this later today but I can't stay with it at the moment. I hope this information is useful to you.
Last edited by Loci.Cantos on 2018-08-08 18:54, edited 1 time in total.

User avatar
bw123
Posts: 4015
Joined: 2011-05-09 06:02
Has thanked: 1 time
Been thanked: 28 times

Re: GRUB 2 installation

#6 Post by bw123 »

LordJonas wrote:It's MBR and i put GRUB on the HDD1, partition 1 (wich is only 500MB).
I've never used grub on a partition. I always install grub in the boot sector of the first disk. I guess this would replace the windows bootloader. I'm not sure if that would work with later versions of windows. I don't think it's good idea to install grub, then change boot order, that could cause the devices to be named differently by some bios implementations.

I know there are several ways to do it, and also multiboot is a complicaton sometimes. Using grub to manage all the bootable os on the machine always seems simpler to me.
resigned by AI ChatGPT

Segfault
Posts: 993
Joined: 2005-09-24 12:24
Has thanked: 5 times
Been thanked: 17 times

Re: GRUB 2 installation

#7 Post by Segfault »

With GPT there is no space to install Grub "on MBR", thus a small Grub partition is required. If you want to use Grub, that is. There are other methods and bootloaders. I personally do not see any point using Grub2 in my boxes.

User avatar
Loci.Cantos
Posts: 67
Joined: 2018-08-03 15:39

Re: GRUB 2 installation

#8 Post by Loci.Cantos »

First, I think grub doesn't get wiped completely unless one creates a raw partition. As I understand it, this is to write the first 512 bytes of the disk to zed (zero). I don't think the debian installer does this if the drive has a debian grub installation. I don't know this to be a fact but I suspect it is the case. If it is the case, then this would explain why the grub error keeps appearing, even after a complete reinstall. If this is not the case I don't have the answer to the particular symptom. However, I did execute a solution to the overall problem.
Good news: it works.

Here's what I did to resolve this problem (it's kind of old school but it still works).
1. I noted which physical drive in my box that I wanted to use for the debian build.
2. I Repartitioned the drive to GPT. I used Acronis to do this because it is a partitioning software. I wanted to be certain it was done properly, so I used a specialized partitioning software. There are available freewares that will properly accomplish this as well. Windows also does a GPT conversion and it will probably work. But since I had Acronois, I used it.
[edit 08112018: Also try free(trial)ware https://www.easeus.com/partition-manager/]
3. I then isolated the disk by unplugging the other disks in the box, leaving it as the only disk recognized by the system.
4. I identified it as the boot disk in the BIOS (yes, I'm using a bios in this box).
5. Chose to boot from the DVD in my pop-up boot menu (If you don't have this option, make the DVD the the first boot device and the drive you're installing to the second device).
6. Boot the DVD, select the first drive for the grub boot loader (it's isolated so, it's the only drive), then complete the installation (remove the DVD at the end).
7. Reboot the system and voila! Functional grub interface.
8. Shut down. Replug your drives. Reboot.
9. Now you may either change the boot drive in the bios on each boot, or use your pop-up boot drive selector if you have one.
(NOTE 1: When you boot, the bios may say there is no master, ignore this and press F1 or whatever your key choice is for bypassing this error.)
(NOTE 2: This actually used to be a common approach because some builds were very aggressive in assuming they would be the only build in a given box).
(NOTE 3: Also, by using this method, once the OS is up and running one may edit and modify grub to add the other boot partition locations.)

Something to thing to consider:
It's possible, maybe even likely, that once you have repartitioned the disk as GPT, or have rewritten the boot sector to all zed, that you may proceed with the installation without going through the drive isolation process. I chose to use this process because I know it works and I was tired of the installation iterations. I wanted to get to the original problem I encountered which caused the crash, which was the desktop graphics function after I installed a new graphics card.

I was successful getting the new graphics card (RX 560) to function properly, span (extend) monitors and it's blazing fast too. I'll write about that tomorrow on the appropriate link:
http://forums.debian.net/viewtopic.php?f=6&t=138225

Post Reply