I'm new on Linux and I want to install Antergos and CentOS in a single machine.
- Do I need to have 2 /boot partitions?
- Do I need to have 2 /swap partitions?
- How to share files between the 2 OS?
- How should my disk be partitioned?
It's your choice; generally on a laptop to preserve precious space, you'll share your /home, /boot, swap partitions, however you can also have separate ones. Note only one partition will be loaded at boot.
Each Linux distro will be able to find any other Linux distros, so if you have separate /boot and so grub configs, both grubs would have both distros anyway, but there really is no need to have multiple /boot partitions (unless you want one to work off legacy and one to work off UEFI, but that would require some additional tweaks).
Typical layout for 2x distro;
/dev/sda1 = /boot = shared
/dev/sda2 = / = distro 1
/dev/sda3 = / = distro 2
/dev/sda4 = /home = shared
/dev/sda5 = swap = shared
If you want to go further, you would have 2x /usr and 2x /var (these should not be shared across different installs as they will have references to installed packages / files elsewhere).
Here is the file structure we use in Linux:
http://www.pathname.com/fhs/pub/fhs-2.3.html
You can find a copy online by searching "linux fhs".
Legacy boot
Install the first linux distro , you need to create the root
partition and a swap
partition , install your system the Grub should be installed on the Master Boot Record assuming on sda
.
You can create a separate /boot
partition , home
,etc... for the 1st linux distro.
To Install the second linux distro , you can create only the root
partition
It is possible to use the same swap
partition.
You can create a separate /boot
, home
... for the second linux distro
You can mount and use the same home
, swap
, /boot
partition during the second linux install , but it is not recommended to use the same boot
partition
Some linux distro will ask you for the path to re-install GRUB on the MBR ,you can reinstall it also you can skip it.
To skip the re-installation of GRUB by choosing the root
partition of the second linux distro as path e,g: sda4
(not sda
), After rebooting your system run grub-mkconfig -o /boot/grub/grub.cfg
from the first linux distro to get a new entry.
UEFI
It is necessary to get an ESP
partition to install the first linux distro , a root
and a swap
partiton and more .
When you install the second linux distro do not format the ESP just mount it to install the boot-loader.then Create the root partition.
How to share files between the 2 OS?
You don't have a problem of sharing between linux OS.