You are not logged in.

#1 2016-08-28 18:18:42

percy_vere_uk
Member
Registered: 2016-01-08
Posts: 25

[Solved] grub2 displays the wrong menu.

Hi

I  have a multiboot system with  two drives sda and sdb with several linux operating systems.

I have just installed a new arch system on /dev/sdb2 and installed grub2 this is what I did:

sudo pacman -S intel-ucode
sudo  pacman -S grub os-prober
sudo grub-install --target=i386-pc /dev/sda
sudo grub-mkconfig -o /boot/grub/grub.cfg

I was hoping that I would now be using the grub menu from this new install, but no, it still uses the menu from the previous system.

Using Super Grub I can access the new arch system  menu and it uses: 

(hd2,msdos2) /boot/grub/i386-pc/core.img

   
The problem is once I remove the super grub disk the menu reverts to the menu from the previous system.

I want grub to boot into the new menu.  How do I achieve this?

Thank you

percy

Last edited by percy_vere_uk (2016-08-29 13:21:19)

Offline

#2 2016-08-28 18:22:19

Head_on_a_Stick
Member
From: London
Registered: 2014-02-20
Posts: 7,732
Website

Re: [Solved] grub2 displays the wrong menu.

Please post the output of:

# parted -l

This command can be run from any live environment or installed system.

Last edited by Head_on_a_Stick (2016-08-28 18:26:07)

Offline

#3 2016-08-28 18:30:53

percy_vere_uk
Member
Registered: 2016-01-08
Posts: 25

Re: [Solved] grub2 displays the wrong menu.

# parted -l  gives:

Model: ATA ST1500LM006 HN-M (scsi)
Disk /dev/sda: 1500GB
Sector size (logical/physical): 512B/4096B
Partition Table: gpt
Disk Flags: 

Number  Start   End     Size    File system     Name  Flags
 1      1049kB  538MB   537MB                   boot  bios_grub
 2      539MB   1078MB  539MB   ext2
 3      1078MB  14.0GB  12.9GB  linux-swap(v1)
 4      14.0GB  46.2GB  32.2GB  ext4
 5      46.2GB  78.4GB  32.2GB  ext4
 6      78.4GB  111GB   32.2GB  ext4
 7      111GB   325GB   215GB   ext4
 8      325GB   358GB   32.2GB  ext4
 9      358GB   390GB   32.2GB  ext4
10      390GB   422GB   32.2GB  ext4
11      422GB   454GB   32.2GB  ext4
12      454GB   486GB   32.2GB  ext4
13      486GB   519GB   32.2GB  ext4
14      519GB   551GB   32.2GB  ext4
15      551GB   583GB   32.2GB  ext4
16      583GB   615GB   32.2GB  ext4
17      615GB   647GB   32.2GB  ext4


Model: ATA KINGSTON SMSM151 (scsi)
Disk /dev/sdb: 128GB
Sector size (logical/physical): 512B/512B
Partition Table: msdos
Disk Flags: 

Number  Start   End     Size    Type      File system  Flags
 1      1049kB  21.5GB  21.5GB  primary   ext4
 2      21.5GB  43.0GB  21.5GB  primary   ext4         boot
 3      43.0GB  64.4GB  21.5GB  primary   ext4
 4      64.4GB  128GB   63.6GB  extended
 5      64.4GB  85.9GB  21.5GB  logical   ext4
 6      85.9GB  107GB   21.5GB  logical   ext4
 7      107GB   118GB   10.5GB  logical   ext4


Model:  USB DISK 2.0 (scsi)
Disk /dev/sdc: 7744MB
Sector size (logical/physical): 512B/512B
Partition Table: msdos
Disk Flags: 

Number  Start   End     Size    Type     File system  Flags
 1      1049kB  630MB   629MB   primary  ext4         boot
 2      630MB   7744MB  7114MB  primary  ext4

Offline

#4 2016-08-28 18:42:40

Head_on_a_Stick
Member
From: London
Registered: 2014-02-20
Posts: 7,732
Website

Re: [Solved] grub2 displays the wrong menu.

OK, I was checking if you have any EFI system partitions (and hence UEFI systems) that could override a non-UEFI bootloader.

This is not the case.

Try this:

# parted /dev/sdb set 2 boot off

sdb2 is marked bootable, that could be interfering.

Reverse the effects of the command with:

# parted /dev/sdb set 2 boot on

Also, you could try using:

# grub-install --target=i386-pc --recheck /dev/sda

To ensure that the correct device is used.

Offline

#5 2016-08-28 19:02:20

percy_vere_uk
Member
Registered: 2016-01-08
Posts: 25

Re: [Solved] grub2 displays the wrong menu.

Head_on_a_Stick

Thanks for the info.

# parted /dev/sdb set 2 boot off 

 
after re-boot no difference



# grub-install --target=i386-pc --recheck /dev/sda

gave:
Installing for i386-pc platform.
Installation finished. No error reported.

Offline

#6 2016-08-28 22:46:03

Head_on_a_Stick
Member
From: London
Registered: 2014-02-20
Posts: 7,732
Website

Re: [Solved] grub2 displays the wrong menu.

Perhaps your firmware boots the MBR on sdb in preference to the BIOS boot partition on /dev/sda

Backup the bootloader part of the MBR:

# dd if=/dev/sdb of=mbr.bak bs=446 count=1

Then blast it off:

# dd if=/dev/zero of=/dev/sdb bs=446 count=1

If you want to restore the MBR, use:

# dd if=mbr.bak of=/dev/sdb

Last edited by Head_on_a_Stick (2016-08-28 22:46:47)

Offline

#7 2016-08-29 12:04:57

percy_vere_uk
Member
Registered: 2016-01-08
Posts: 25

Re: [Solved] grub2 displays the wrong menu.

This is what I have done:

Backup the bootloader part of the MBR:

# dd if=/dev/sdb of=mbr.bak bs=446 count=1

Then blast it off:

# dd if=/dev/zero of=/dev/sdb bs=446 count=1

Re-installed grub loader set in arch_linux

sudo pacman -S intel-ucode
sudo pacman -S grub os-prober
sudo grub-install --target=i386-pc /dev/sda
sudo grub-mkconfig -o /boot/grub/grub.cfg

Re-boot with  super grub usb out:

Console message:  "Reboot and select proper boot device"

So  I have lost the rogue boot menu, but can only access the correct menu using super grub.

Offline

#8 2016-08-29 12:47:29

Head_on_a_Stick
Member
From: London
Registered: 2014-02-20
Posts: 7,732
Website

Re: [Solved] grub2 displays the wrong menu.

OK, so it looks like perhaps your motherboard won't boot from a BIOS boot partition if there is an MBR-style drive present hmm

Try this:

# grub-install --target=i386-pc --recheck /dev/sdb

If you want that "rogue boot menu" back then restore the MBR as instructed above.

Offline

#9 2016-08-29 12:52:00

t0m5k1
Member
From: overthere
Registered: 2012-02-10
Posts: 324

Re: [Solved] grub2 displays the wrong menu.

You BIOS has been configured to boot from SDB
you however assume it is booting SDA
reboot, go into bios (del/esc/f11/f12) find out what names your bios has for the 2 drives then check the boot priority under advanced or boot settings.
chances are that the current priority is set to boot the second drive.

also most will provide a boot menu to selct the boot disk.

have fun


ROG Strix (GD30CI) - Intel Core i5-7400 CPU - 32Gb 2400Mhz - GTX1070 8GB - AwesomeWM (occasionally XFCE, i3)

If everything in life was easy, we would learn nothing!
Linux User: 401820  Steam-HearThis.at-Last FM-Reddit

Offline

#10 2016-08-29 13:20:34

percy_vere_uk
Member
Registered: 2016-01-08
Posts: 25

Re: [Solved] grub2 displays the wrong menu.

Head_on_a_Stick

Thank you

# grub-install --target=i386-pc --recheck /dev/sdb

Did the trick.

Thanks also to    t0m5k1

Offline

Board footer

Powered by FluxBB