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.