GRUB 2 installation

Help with issues regarding installation of Debian

GRUB 2 installation

Postby LordJonas » 2018-08-08 13:10

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 ?
LordJonas
 
Posts: 2
Joined: 2018-08-08 12:56

Re: GRUB 2 installation

Postby bw123 » 2018-08-08 13:30

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.
User avatar
bw123
 
Posts: 3189
Joined: 2011-05-09 06:02
Location: TN_USA

Re: GRUB 2 installation

Postby LordJonas » 2018-08-08 13:34

It's MBR and i put GRUB on the HDD1, partition 1 (wich is only 500MB).
LordJonas
 
Posts: 2
Joined: 2018-08-08 12:56

Re: GRUB 2 installation

Postby Head_on_a_Stick » 2018-08-08 13:41

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?
E Pluribus Unix
User avatar
Head_on_a_Stick
 
Posts: 7785
Joined: 2014-06-01 17:46
Location: /dev/chair

Re: GRUB 2 installation

Postby Loci.Cantos » 2018-08-08 14:17

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.
Loci.Cantos
 
Posts: 12
Joined: 2018-08-03 15:39

Re: GRUB 2 installation

Postby bw123 » 2018-08-08 14:35

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.
User avatar
bw123
 
Posts: 3189
Joined: 2011-05-09 06:02
Location: TN_USA

Re: GRUB 2 installation

Postby Segfault » 2018-08-08 15:39

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.
Segfault
 
Posts: 691
Joined: 2005-09-24 12:24

Re: GRUB 2 installation

Postby Loci.Cantos » 2018-08-09 01:50

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:
viewtopic.php?f=6&t=138225
Loci.Cantos
 
Posts: 12
Joined: 2018-08-03 15:39


Return to Installation

Who is online

Users browsing this forum: No registered users and 3 guests

fashionable