* [[Laptops/Lenovo_Yoga_3_14/DualBoot|DualBoot]] * [[Laptops/Lenovo_Yoga_3_14/X|X]] ==== Goal ==== Dual boot //%%FreeBSD%% 12.0-CURRENT r315864// and //Ubuntu Linux (Zesty Zapus) 17.04 Final Beta// in //GRUB 2// on //Lenovo Yoga 3 14// with //UEFI//. ---- ==== Steps ==== //It could be optimized.// - Create USB sticks with %%FreeBSD%%, Ubuntu and GParted. - Set BIOS to try a UEFI boot first instead of Legacy. - Boot GParted and create a new GPT partition table on the hard drive. - Boot the Ubuntu Live USB and let it install itself. It should create an ESP and EXT4 partitions (Ubuntu will not create an ESP partition if you didn't set to try UEFI boot in BIOS). - Boot GParted and resize the Ubuntu EXT4 partition to make some space for the %%FreeBSD%% installation. Do not format this space - it makes things easier for %%FreeBSD%% during auto detecting free partitions. - Boot the %%FreeBSD%% USB and choose an option for automatic UFS partitioning (I've not tried it yet with ZFS). Choose //Partition// instead of //Entire Disk// and the installer will figure out the rest for you. Write down the name of the partition with the EFI label (mine was called ''%%ada0p4%%''). - Boot Ubuntu from your hard drive and add the following lines to ''%%/boot/grub/custom.cfg%%'' (the file has to be called like that): menuentry "FreeBSD" { insmod part_gpt insmod fat insmod chain set root=(hd0,gptX) chainloader /efi/boot/BOOTx64.efi } Change ''%%X%%'' to the partition number of your %%FreeBSD%% EFI partition (e.g. my partition was ''%%ada0p4%%'' so ''%%set root=(hd0,gpt4)%%'' worked for me). - Done. You might need to hit the Escape key once when the screen turns Ubuntu-like purple for the first time after turning on the machine to access GRUB 2 as Ubuntu hides it by default. Alternatively, you might add the following lines to ''%%/boot/grub/custom.cfg%%'': set default="3" set timeout=5 set timeout_style=menu It shows the standard GRUB 2 menu for 5 seconds before it boots the third option (counting from 0) which is most probably your %%FreeBSD%% partition. ---- ==== References ==== * [[https://help.ubuntu.com/community/UEFI|UEFI (help.ubuntu.com)]] * [[https://forums.freebsd.org/threads/54746/#post-308726|Adding FreeBSD entry to GRUB 2 (Dual boot FreeBSD and Linux on a single disk) (forums.freebsd.org)]] ===== See also ===== * [[https://askubuntu.com/a/95701/413683|How to boot Ubuntu from EFI/UEFI? (askubuntu.com)]] * [[http://www.dedoimedo.com/computers/grub-2.html|GRUB 2 bootloader - Full tutorial (www.dedoimedo.com)]] * [[https://wiki.gentoo.org/wiki/GRUB2|GRUB2 (wiki.gentoo.org)]] * [[https://wiki.gentoo.org/wiki/GRUB2#UEFI_with_GPT|UEFI with GPT (wiki.gentoo.org)]] * [[https://unix.stackexchange.com/q/354260/128489|Working GRUB config for booting FreeBSD with UEFI (unix.stackexchange.com)]] * [[http://unix.stackexchange.com/a/310145/128489|Installing FreeBSD alongside Linux (unix.stackexchange.com)]] * [[http://tiggeron.blogspot.com/2014/06/dual-boot-freebsd-10-and-linux-mint-17.html|Dual boot FreeBSD 10 and Linux Mint 17 (tiggeron.blogspot.com)]] * [[https://unix.stackexchange.com/q/16886/128489|Set up GRUB 2 to boot FreeBSD using either Ubuntu tools or LiveUSB to find what partitions? (unix.stackexchange.com)]] * [[https://askubuntu.com/a/353780/413683|UEFI Partitioning for Dummies (askubuntu.com)]] * [[https://forums.freebsd.org/threads/49055/|GPT Multiboot (forums.freebsd.org)]] * [[https://forums.freebsd.org/threads/58132/#post-332268|Need help with installing FreeBSD 11 (forums.freebsd.org)]] * [[https://blog.debiania.in.ua/posts/2013-09-30-dualbooting-debian-and-freebsd.html|Dualbooting Debian and FreeBSD (blog.debiania.in.ua)]] * [[https://wiki.archlinux.org/index.php/GRUB#UEFI_systems|GRUB: UEFI systems (wiki.archlinux.org)]] ---- {{tag>HowTo}}