Solved Installation of GRUB with errors

I have successfully installed FreeBSD 12.0 in my UdooX86 Ultra in the MicroSD and in the second SSD SATA disk ada1 with a rebuild of the kernel using drm-next in GIT clone for the intel graphics.
I can regularly boot with BTX loader in MicroSD either in SATA disk.

Now I want to install GRUB to boot also in Slackware 14.2 and Ubuntu 17.04 that are installed in the same second SSD SATA disk ada1s3 (Slackware) and ada1s4 (Ubuntu)

Thi is my gpart output:

Code:
root@axilla:~ # gpart show
=>        63  1000215153  ada0  MBR  (477G)
          63        1985        - free -  (993K)
        2048   983625728     1  linux-data  [active]  (469G)
   983627776        2046        - free -  (1.0M)
   983629822    16584706     2  ebr  (7.9G)
  1000214528         688        - free -  (344K)

=>       0  16584706  ada0s2  EBR  (7.9G)
         0  16584706       1  linux-swap  (7.9G)

=>        63  1000215153  diskid/DISK-D444960050  MBR  (477G)
          63        1985                          - free -  (993K)
        2048   983625728                       1  linux-data  [active]  (469G)
   983627776        2046                          - free -  (1.0M)
   983629822    16584706                       2  ebr  (7.9G)
  1000214528         688                          - free -  (344K)

=>       63  976773105  ada1  MBR  (466G)
         63          1        - free -  (512B)
         64  316669952     1  freebsd  [active]  (151G)
  316670016       1984        - free -  (992K)
  316672000   16809984     2  linux-swap  (8.0G)
  333481984  316499968     3  linux-data  (151G)
  649981952  326791016     4  linux-data  (156G)
  976772968        200        - free -  (100K)

=>       0  16584706  diskid/DISK-D444960050s2  EBR  (7.9G)
         0  16584706                         1  linux-swap  (7.9G)

=>        0  316669952  ada1s1  BSD  (151G)
          0  308281344       1  freebsd-ufs  (147G)
  308281344    8388607       2  freebsd-swap  (4.0G)
  316669951          1          - free -  (512B)

=>      63  61071297  mmcsd0  MBR  (29G)
        63      1985          - free -  (993K)
      2048  61069312       1  fat32  (29G)

=>      63  61071297  diskid/DISK-8F16BDC2  MBR  (29G)
        63      1985                        - free -  (993K)
      2048  61069312                     1  fat32  (29G)

=>       40  124735415  mmcsd1  GPT  (59G)
         40       8152          - free -  (4.0M)
       8192       1024       1  freebsd-boot  (512K)
       9216       7168          - free -  (3.5M)
      16384  117431296       2  freebsd-ufs  (56G)
  117447680       1024          - free -  (512K)
  117448704    6236160       3  freebsd-swap  (3.0G)
  123684864    1050591          - free -  (513M)

=>       40  124735415  diskid/DISK-0CB28834  GPT  (59G)
         40       8152                        - free -  (4.0M)
       8192       1024                     1  freebsd-boot  (512K)
       9216       7168                        - free -  (3.5M)
      16384  117431296                     2  freebsd-ufs  (56G)
  117447680       1024                        - free -  (512K)
  117448704    6236160                     3  freebsd-swap  (3.0G)
  123684864    1050591                        - free -  (513M)

I have read and used the post "How to install grub2" on FreeBSD Forum https://forums.freebsd.org/threads/28443/
adapting grub.cfg to my disk nomenclature in this manner:

Code:
set timeout = 3
set default = "0"
menuentry "FreeBSD 12 su disco SATA ada1" {
insmod ufs2
     set root = (hd1, 1)
chainloader 1
}
I have installed the GRUB without errors but when I boot have this boot errors:

Code:
error: not an assignment
error: invalid file name 1

Please help me to obtain the correct GRUB disk identifier for FreeBSD and if it's possible also for Slackware and Ubuntu.

Thanks in advance
 
I have grub4dos installed and part of my menu.lst contains
Code:
title BSD sda3
root (hd0,2)
makeactive
chainloader +1
boot

title BSD Admin (cli) sda4
        root (hd0,3)
        makeactive
        chainloader +1
to boot my main and admin bsd partitions (two separate installs to sda3 and sda4). Which works fine alongside other boot choices (Debian ...etc.)

As I recall, it was the makeactive command that did the business for me as without that I had problems with booting. Maybe there's a grub equivalent of that ???
 
I have grub4dos installed and part of my menu.lst contains
Code:
title BSD sda3
root (hd0,2)
makeactive
chainloader +1
boot

title BSD Admin (cli) sda4
        root (hd0,3)
        makeactive
        chainloader +1
to boot my main and admin bsd partitions (two separate installs to sda3 and sda4). Which works fine alongside other boot choices (Debian ...etc.)

As I recall, it was the makeactive command that did the business for me as without that I had problems with booting. Maybe there's a grub equivalent of that ???

Dear roofwoof,
I have so adapted your code in my Debian 40_custom:

Code:
menuentry "FreeBSD 12 su disco SATA ada1" {
set root (hd1,1)
makeactive
chainloader +1
boot
}

but I have received this error messages (in english either in italian) at boot time:

Code:
error: not an assignment
impossibile trovare il comando makeactive
error: invalid signature
è necessario caricare il kernel prima.
 
I have solved the problems with the help of jj_0 member of Udoo mailing list as described in this my post: [SOLVED] To install in the internal EMMC a general boot loader of "high level"

I have used Ubuntu 17.04 grub-customizer to create a new menu entry for my 40_custom complete of code

The rationale is that (I suppose) the GRUB assign an hard disk identifier also to EMMC and MicroSD of UdooX86 so the nomenclature of the secondary hard disk of UdooX86 isn't hd1 but become hd3

I ask you the courtesy of confirm my interpretation

This is the working code produced by grub-customizer inside the installation of Ubuntu 17.04 on the secondary SSD SATA disk of UdooX86:

<code>
menuentry "FreeBSD 12 su disco SATA SSD ada1"{
set root='(hd3,1)'
search --no-floppy --fs-uuid --set 59973312d114fdd9
drivemap -s (hd0) ${root}
chainloader +1
}
</code>
 
Back
Top