DUALBOOT - 13.2 and 13.1 ( No windows flavor )

Hello.
After reading a lot on internet, I try to follow this thread from nrikert
https://nwrickert2.wordpress.com/2016/01/22/linux-multi-boot/
https://nwrickert2.wordpress.com/2016/01/23/linux-multi-boot-part-2-booting/

I ran into problem with the bootloader after installing the second OS

With an usb3 external bootable disk, and following the thread from wolfi323
https://forums.opensuse.org/showthread.php/503463-Grub2-Boot-loader-Problem/page5#23

I repair partially my laptop




  - mount --bind /dev /mnt/dev 
  - chroot /mnt 
  - mount -t proc proc /proc 
  - mount -t sysfs sysfs /sys 
  - grub2-mkconfig -o /boot/grub2/grub.cfg 
  - grub2-install /dev/sda 



Using the code above, I can boot from the os which is in the first partition which has the boot flag set on.
But I cannot boot the from second one.
Using the code above, I can boot from the os which is in the second partition which has the boot flag set on. But I cannot boot the first one.

Here some info :

I am not using UEFI
Partition table are msdos type ( not GPT )

linux-lvco:~ # fdisk -l

Disk /dev/sdb: 465.8 GiB, 500107862016 bytes, 976773168 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disklabel type: dos
Disk identifier: 0x000cc982

Device     Boot     Start       End   Sectors   Size Id Type
/dev/sdb1            2048 167766015 167763968    80G 83 Linux
/dev/sdb2       167766016 188731391  20965376    10G 83 Linux
/dev/sdb3       188731392 220186623  31455232    15G 83 Linux
/dev/sdb4       220188609 976752639 756564031 360.8G  f W95 Ext'd (LBA)
/dev/sdb5       220188672 387954687 167766016    80G 83 Linux
/dev/sdb6       387956736 471861247  83904512    40G 83 Linux
/dev/sdb7       471863296 513822719  41959424    20G 83 Linux
/dev/sdb8       513824768 530595839  16771072     8G 82 Linux swap / Solaris

**Partition 5 does not start on physical sector boundary.**


Disk /dev/sda: 232.9 GiB, 250059350016 bytes, 488397168 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0x000c0ed3

Device     Boot     Start       End   Sectors   Size Id Type
/dev/sda1            2048  10489855  10487808     5G 83 Linux
/dev/sda2        10489856 488396799 477906944 227.9G  f W95 Ext'd (LBA)
/dev/sda5        10491904 178257919 167766016    80G 83 Linux
/dev/sda6  *    178259968 346023935 167763968    80G 83 Linux

linux-lvco:~ # 


[linux-lvco:~ # partition_lsblk_list_current_part
NAME   FSTYPE MOUNTPOINT                     LABEL            SIZE UUID
sda                                                         232.9G 
├─sda1 ext4   /000_keep                      LNX_TO_KEEP        5G f13be81c-05f6-4d35-8b74-6f091d11147a
├─sda2                                                          1K 
├─sda5 ext4                                  LNX_SLASH1        80G 9ff3b3c3-3117-4219-aaa0-658cfd49c67f
└─sda6 ext4   /                              LNX_SLASH2        80G b622f582-5fe0-40f6-beef-994756997b4b
sdb                                                         465.8G 
├─sdb1 ext4   /data                          LNX_DATA          80G 7fad6e8d-39e7-4401-8a5e-4badd3b6c632
├─sdb2 ext4   /data_dvd                      LNX_DATA_DVD      10G db62111f-70d1-4273-bd72-b7af2e3867f2
├─sdb3 ext4   /my_tmp                        LNX_MY_TMP        15G 020c3f71-5dfa-405e-ac57-e54c4c7ab26e
├─sdb4                                                          1K 
├─sdb5 ext4   /srv                                             80G 08bd3bb2-f323-4dbd-b911-98b2edeeae82
├─sdb6 ext4   /backup_sys                    LNX_BACKUPSYS     40G 23594fa2-7f00-45bc-b024-3326300c3473
├─sdb7 ext4   /local                         LNX_LOCAL         20G c7f8f499-aadd-4d59-97d5-134b1c5addc9
└─sdb8 swap   [SWAP]                         LNX_SWAP           8G d033f386-bc91-4d67-abb9-1cda1dadf15d

/dev/sda is a 250Gb SSD.
/dev/sda1 was a 8Gb swap partition which I moved to sdb8
I did not reinstall the os after moving the swap partition.
/dev/sda2 is the extended partition
/dev/sda5 contains OS 13.1
/dev/sda6 contains OS 13.2

linux-lvco:~ # uname -a
Linux linux-lvco.site 3.16.6-2-desktop #1 SMP PREEMPT Mon Oct 20 13:47:22 UTC 2014 (feb42ea) x86_64 x86_64 x86_64 GNU/Linux
linux-lvco:~ # 

here /etc/grub.d/40_custom

#!/bin/sh
exec tail -n +3 $0
# This file provides an easy way to add custom menu entries.  Simply type the
# menu entries you want to add after this comment.  Be careful not to change
# the 'exec tail' line above.
### Entry to boot grub from "/dev/sda5"
menuentry "Alternate grub/linux on /dev/sda5"  {
        set root=(hd0,5)
        chainloader +1
}
menuentry "configfile for grub/linux on /dev/sda5" {
       configfile (hd0,5)/grub2/grub.cfg
}

here /boot/grub2/grub.cfg
http://paste.opensuse.org/63977390

Yast partitioner
http://paste.opensuse.org/84384751

Bootloader page 1
http://paste.opensuse.org/60910364

Bootloader page 2
http://paste.opensuse.org/47324031

Bootloader page 3
http://paste.opensuse.org/76684516

the optional kernel command line parameter ( bootloader page 3 ) is erroneous. the boot disk is the SSD not HGST_HTS545050A7E380 which is sdb

Bootloader page 4
http://paste.opensuse.org/44491653

The situation is :
I can boot on sda6 which has OS 13.2 ( default to first position in menu ).

What must I have to do to boot from either OS

Any help is welcome.

Which problem?

I can boot on sda6 which has OS 13.2 ( default to first position in menu ).

What must I have to do to boot from either OS

You can use os-prober (Probe Foreign OS) in 13.2 to add 13.1 kernels to boot menu. Otherwise your menu entry for sda5 should work if 13.1 is configured to install bootloader on /dev/sda5.

I thought that this function was used to add Windows in the menu of boot or vice versa.
How to do that after booting from 13.2
Have I to do that by chrooting sda5 and call yast2/bootloader
What should I must choose for

  • Boot from Master Boot
  • Custom Boot Partition ( sda5 ? )
  • Boot from Root Partition
  • Boot from Extended Partition
  • Write Generic Boot Code to MBR (but this is already done for 13.2 booting on sda6
    )

What should I must choose for

  • Set active Flag in Partition Table for Boot Partition

Another question :
Have you an idea why the optional kernel command line parameter ( bootloader page 3 ) is erroneous. The boot disk is the SSD (sda) not HGST_HTS545050A7E380 which is sdb
http://paste.opensuse.org/76684516
Could I change it to SDD reference ?

Please, any help is welcome.

It’s working for me.

You are referring to my web pages, but I’m not sure what is going wrong.

One thing to note: you have two disks. When you have two disks, grub can be confused as to which disk is which.

Grub goes by the ordering that the BIOS uses for disks. And the BIOS can do strange things.

On looking carefully on my main desktop, I see grub reporting disk errors on hd1. If I insert a CD in the CD/DVD drive, those errors go away. So, for my main desktop, it seems that hd1 is the CD/DVD drive during boot.

On another computer, my first hard drive is always hd0, except when I have a USB flash drive plugged in – and then it is hd1.

On systems with multiple disks, I am using a search for uuid to locate the partition that I want to boot.

On my main desktop (which has two disks), I have the following in “/etc/grub.d/40_custom”


menuentry "configfile for tumbleweed on /dev/sdb2"  {
        set bootdir='hd2,gpt2'
        search --fs-uuid --set=bootdir af558963-7a91-44ca-a41c-2bbd0beb5766
        configfile (${bootdir})/boot/grub2/grub.cfg
}

That’s not the entire file. That’s just the part to boot Tumbleweed (with “/boot” at “/dev/sdb2”). I’m currently running Leap (with boot at “/dev/sdb3”).

The “set bootdir” line sets a default, which seems to work if no USB is plugged in.
The search line searches for uuid of af558963-7a91-44ca-a41c-2bbd0beb5766 which is the UUID for “/dev/sdb2”. This gets it right, even if a USB is plugged in.

I’m using “configfile” for booting that partition, because this is UEFI. If you call it “root” instead of “bootdir” then your chainloader statement should work for legacy booting. The configfile directive should also work for either legacy or UEFI booting.

You can use the “blkid” command to find UUIDs of various partitions.

Partially Solved :

Booting normally ( OS 13.2 on sda6 )
1°) Clear /etc/grub.d/40_custom to initial content.
2°) Run yast2 / Boot Loadergoto Bootloader options

*=2]Check On : Probe Foreign OS

3°) Run :

grub2-mkconfig -o /boot/grub2/grub.cfg ( I don’t know if it is necessary, because I don’t know what yast2 is supposed to do when quitting )
grub2-install /dev/sda

Reboot

Now Default boot to 13.2, and can select 13.1

In summary the situation is as follows :
Default booting ( 13.2 on /dev/sda6 )
Yast2 / Boot Loader configuration :

Boot Loader : GRUB2
Boot Code Option
[LIST]
Boot loader location : Boot from extended partition

[/LIST]
[INDENT=5]Any things else untick
[/INDENT]

[LIST=|INDENT=3]
untick : set active flag in partition table for boot partition
untick : write generic boot code to MBR
boot loader installation detail : order → /dev/sda ; /dev/sdb
[/LIST]

Kernel parameter
[LIST]
resume=/dev/disk/…-part6 (/dev/sda6)
no specific configuration except a parameter for the SSD

Boot Loader options

( no specific configuration )
tick : Probe Foreign OS
untick : Hide menu boot

[/LIST]

Menu in 13.1 are different.

This part must be validate by someone, because the configuration parameters come from the initial install. I started by installing 13.1. After that I change my mind to boot by default to 13.2. So some parameters should be erroneous.

Booting using menu option 13.1 ( on /dev/sda5 )Yast2 / Boot Loader configuration :

  • Boot Loader : GRUB2

Boot Loader Installation
[LIST]
Boot from master boot record

[/LIST]
[INDENT=5]Any things else untick
[/INDENT]

  • Boot Loader options
    [LIST]
  • Kernel parameter
    [LIST]
    resume=/dev/disk/…-part5 (/dev/sda5)
    no specific configuration except a parameter for the SSD

[/LIST]

[/LIST]

  • boot loader installation detail : order → /dev/sda ; /dev/sdb

I’m not sure what you are showing there.

If you install boot into the MBR for 13.1, then the first menu that you see will be from 13.1.

On legacy boot systems, I am always booting from either “/boot” or “/” (the root partition). Currently, I am using the syslinux generic boot code (which is what opensuse will install). And that actually does work with a logical partition (say “/dev/sda5”) set as active. But that might depend on the BIOS. If the BIOS does an initial check for active partitions, it might not work.

Your comment comes while I was writing mine.
I try to follow your thread, but my config is different because the 2 os I want to boot are in the extended partitions. And I did not figure out what to tick or untick for the boot loader location. So I made some bad choices and lost the boot sequence for the two OS.
I tried to put options in /etc/grub.d/40_custom. All I got was an error default signature.

Now I boot normally by default to 13.2, and I can select 13.1.
I think that I have some changes to make in the second os ( 13.1 on sda5 ). Every things is wrong because it come from the very first initial install.
I think that the second os should not modify the way grub start 13.2 as default.
It should be configured like this :

  • Boot from extended partition
  • untick : probe foreign os
  • untick : set active flag in partition table for boot partition
  • untick : write generic boot code to mbr
  • resume=/dev/…sda5
  • disk order : /dev/sda ; /dev/sdb

But I am unsure.

For the moment it is running the way I want just because I don’t run the yast boot loader option on the second os ( 13.1 on sda5 ).

So any help is welcome to finish my config.

If it is all working with 13.2 handling the booting, then for 13.1 I suggest:

Boot from the root partition (/dev/sda5 ??)
Do not set active bits.
Do not install generic boot code

Ignore any warnings that the system might not be bootable.

You do need to have “/boot/grub2/grub.cfg” (maintained by grub2-mkconfig). This keeps the boot configuration up to date with new kernels.

I’m not sure if this answers your questions.

Default booting ( 13.2 on /dev/sda6 )Yast2 / Boot Loader configuration :

Boot Loader : GRUB2
Boot Code Option
[LIST]
Boot loader location : Boot from extended partition

                 Any things else untick 

[/LIST]

[LIST=|INDENT=3]
untick : set active flag in partition table for boot partition
untick : write generic boot code to MBR
boot loader installation detail : order –> /dev/sda ; /dev/sdb
[/LIST]

Kernel parameter
resume=/dev/disk/…-part6 (/dev/sda6)
[LIST]
no specific configuration except a parameter for the SSD

Boot Loader options

( no specific configuration )
tick : Probe Foreign OS
untick : Hide menu boot

[/LIST]

Is that correct for step 1 of dualbooting on OS13.2 on sda6 ?

Yes, that should be fine.

Good.
Now last step : the second OS ( 13.1 on sda5 )
Should never change any things for default os ( 13.2 on sda6 )

Yast2 / Boot Loader configuration :

[ul]
[li]Boot Loader : GRUB2[/li][/ul]

[ul]
Boot Loader Installation
[LIST]
Boot from extended partition
[/ul]
[/LIST]
[INDENT=5]Any things else untick
[/INDENT]

[LIST=|INDENT=2]
[li]Boot Loader options[/li][LIST=|INDENT=1]
[li]untick : probe foreign os[/li][li]untick : set active flag in partition table for boot partition[/li][li]untick : write generic boot code to MBR[/li][/LIST]
[/LIST]

[LIST=|INDENT=2]
[li]Optional Kernel Command line parameter : nothing special[/li] resume=/dev/disk/…-part5 (/dev/sda5)
[/LIST]

[LIST=|INDENT=2]
[li]boot loader installation detail : order –> /dev/sda ; /dev/sdb[/li][/LIST]

Is that correct ?

No.

Uncheck the “boot from extended partition”. Instead, boot from “/” (or whatever is the equivalent). Your 13.2 is already using the extended partition for booting.

The rest should be fine. You might get a warning message that your system might not be bootable. That’s okay, because you are booting it indirectly (via the 13.2 menu).

Thread is closed.

Thank you for your patience.