Difference between revisions of "Dual Boot Linux and Linux"

From Free Knowledge Base- The DUCK Project: information for everyone
Jump to: navigation, search
m
(Bootloader)
 
(3 intermediate revisions by one user not shown)
Line 44: Line 44:
  
 
== Bootloader ==
 
== Bootloader ==
As of Mint 19.2 the default bootloader is Grub2 or specifically grub-install (GRUB) 2.02-2ubuntu8.13
+
As of Mint 18.3 the default is The [[Grub2 Bootloader]] or specifically grub-install (GRUB) 2.02~beta2-36ubuntu3.14+linuxmint1
 +
As of Mint 19.2 the default is The [[Grub2 Bootloader]] or specifically grub-install (GRUB) 2.02-2ubuntu8.13
  
You may find that you want to change the order of the operating system options or set a default boot option.  This requires a change of the Grub2 configuration.  You should not directly edit /boot/grub/grub.cfg because when you run 'sudo update-grub' it will overwrite grub.cfg from the contents of /etc/grub.d therefore we will make our edits to /etc/grub.d and then run update-grub.
+
We installed Mint 19.2 first, and Mint 18.3 second.  This caused the Mint 18.3 configuration to be the dominate configuration for the grub bootloader. Therefore, if we wish to change our grub2 settings we must boot to the Mint 18.3 operating system as making changes to the other would not take effect.
  
 +
You may find that you want to change the order of the operating system options or set a default boot option.
  
 +
''technical point: GRUB 2 works like this: /etc/default/grub contains customization; /etc/grub.d/ scripts contain GRUB menu information and operating system boot scripts. When the update-grub command is run, it reads the contents of the grub file and the grub.d scripts and creates the grub.cfg file.''
  
 +
The UEFI configuration can point to the grub2 configuration within /boot of one of the two linux partitions.  The most recent linux to be installed with have the active grub2 configuration in the /boot of its own partition.  The grub2 configuration if the former is completely ignored.
  
 +
In our example we installed 18.3 last, thus it has the active grub2 configuration.  However, say we want to have 19.2 our primary Mint version and thus we want its grub2 configuration in its /boot to be the active one.  To accomplish this do the following:
 +
# boot to the 19.2 (or whatever your original linux install was)
 +
# from terminal execute the following:
 +
apt-get install --reinstall grub-efi-amd64
 +
After you reboot you will be using the grub2 configuration of /boot from the partition with 19.2 and the boot menu will list 19.2 at the top.
  
 
== Related ==
 
== Related ==

Latest revision as of 14:01, 30 August 2019

This is a demonstration of establishing a desktop system running two or more linux installations. For the example we shall install two installations of Linux Mint of different versions.

  • Version 19.2 will be installed because user wishes to have the latest softwares and gaming
  • Version 18.3 will be installed for compatibility with productivity software user requires for work

The primary installation will be the 19.2.

A note on downloading: In the past I obtain the ISO from bittorrent using the torrent link provided by linuxmint.com, however, the 19.2 ISO from torrent would not pass verification integrity check. Downloading from one of the university links provided a quality ISO. Oddly, even though the hash checksum key matched, the ISO from torrent would not pass the integrity check, failing with 1 corrupt file. DO NOT DOWNLOAD ISO FROM TORRENT.

Create the bootable media: The easiest way to install Linux Mint is with a USB flash drive. Linux mint includes software called "USB Image Writer" that you can use to write the ISO to the flash media. You can use a program called Etcher on Windows, or refer to our guide Bootable USB flash drive utilities.

Tip: Create a bootable USB drive from the command prompt with dd. (some examples below). Find out the name of the flash drive using the 'lsblk' command. Make sure the USB flash drive is recognized by fdisk as a block device and be sure to manually umount it if it automatically mounted when inserted.

fdisk -l
umount /dev/sdc
sudo dd if=./linuxmint-19.2-cinnamon-64bit.iso of=/dev/sdc bs=4M status=progress oflag=sync

Boot from the Linux Mint 19.2 installation flash drive and integrity check the installation media via the boot menu. If there are any errors then do not proceed to install. Wipe the flash media and attempt to copy the iso over again.

Do not allow the installer to automatically configure the drive partitioning. Manually create the partitions, you can use fdisk or Create your Dual Boot Linux Mint Partition With GParted Example.

  1. Create a swap partition equal to your RAM size but no less than 4GB (I made it 16GB)
  2. Create ext4 root / for the first distribution
  3. Create ext4 root / for the second distribution
  4. Create ext4 /share which will be a common place both distributions can see. Maybe you won't need this to be very big, depending on whether or not your machine is LAN connected. I will be LAN connected so my share partition does not need to be very big.

Consider the remaining space (RS) after subtracting the space you reserved for swap, /share and the 512MB, divide that by two, ( Distro = RS/2 ) to determine how much space for each of the two distributions.

Here is the schema I used for a machine with a 500GB drive that will be LAN connected to a network with a NAS device:

Install Grub2 on the MBR. We are going to use GPT (GUID Partition Table) so there's no Master Boot Record.

After the installation is completed then reboot and check to make sure it is well.

Insert the USB drive for the second installation and reboot.

Installation of the second linux again do not let it auto partition the disk. Do not install Grub2. Mount / (root), swap and /share.

  • Both installations will use the same swap partition and will both share the /share partition

So that user can access /share partition from both distribution installs (example user nicolep)

groupadd share -g 500
usermod -a -G share nicolep
cd /
chgrp share share
chmod 775 share

Bootloader

As of Mint 18.3 the default is The Grub2 Bootloader or specifically grub-install (GRUB) 2.02~beta2-36ubuntu3.14+linuxmint1 As of Mint 19.2 the default is The Grub2 Bootloader or specifically grub-install (GRUB) 2.02-2ubuntu8.13

We installed Mint 19.2 first, and Mint 18.3 second. This caused the Mint 18.3 configuration to be the dominate configuration for the grub bootloader. Therefore, if we wish to change our grub2 settings we must boot to the Mint 18.3 operating system as making changes to the other would not take effect.

You may find that you want to change the order of the operating system options or set a default boot option.

technical point: GRUB 2 works like this: /etc/default/grub contains customization; /etc/grub.d/ scripts contain GRUB menu information and operating system boot scripts. When the update-grub command is run, it reads the contents of the grub file and the grub.d scripts and creates the grub.cfg file.

The UEFI configuration can point to the grub2 configuration within /boot of one of the two linux partitions. The most recent linux to be installed with have the active grub2 configuration in the /boot of its own partition. The grub2 configuration if the former is completely ignored.

In our example we installed 18.3 last, thus it has the active grub2 configuration. However, say we want to have 19.2 our primary Mint version and thus we want its grub2 configuration in its /boot to be the active one. To accomplish this do the following:

  1. boot to the 19.2 (or whatever your original linux install was)
  2. from terminal execute the following:
apt-get install --reinstall grub-efi-amd64

After you reboot you will be using the grub2 configuration of /boot from the partition with 19.2 and the boot menu will list 19.2 at the top.

Related