Can I dual boot two Linux distros with common boot partition? The reason I'm asking this is because I have a LVM setup with only one primary partition for /boot
.
1 Answer
It should be possible, but I think you're in for a painful experience. Unless you have a liveCD/USB to hand or like playing with GRUB recovery I'd try it in a VM first.
- An OS entry in grub specifies both the GRUB root (where the kernel image can be found, ie the device containing
/boot
, and the kernel command line specifies the root device to use. So, there should be no reason you can't have kernels for multiple distributions in one/boot
device controlled by one GRUB configuration.
.
menuentry distribution1 {
insmod part_msdos
insmod ext2
insmod gzio
set root=(hdX,msdosY)
linux /boot/vmlinuz-distribution1 root=UUID=uuid-for-distribution1-root
initrd /boot/initrd.img-distribution1
}
menuentry distribution2 {
insmod part_msdos
insmod ext2
insmod gzio
set root=(hdX,msdosY)
linux /boot/vmlinuz-distribution2 root=UUID=uuid-for-distribution2-root
initrd /boot/initrd.img-distribution2
}
Providing the kernels and initrds for the two distributions are named differently, there should not be a problem with interference between the kernel images.
However, there is likely to be problems with the grub configuration. Ubuntu certainly automatically updates this each time you update grub or the kernel, and I doubt the autogeneration will handle this configuration.
You'll need to either tweak the configuration in
/etc/grub.d
to handle this setup, disable autogeneration or remember to manually edit it yourself each time. You probably want to uninstallgrub
from one of the two distributions or you'll be dealing with this problem twice.
-
I've been trying to get this working on my home server (installation of ubuntu 14 along with 12). Could not get it to work. Really messy business and definitely as painful experience as chronitis indicated.– PierreFeb 17, 2015 at 3:48
-
I have no issues running two distros with one /boot patition at all. The key point is to install one bootloader to MBR and the other one to either other disk or to a partition on the same disk. I have Ubuntu 14.04 with Mint 17.3. Every time, ubuntu updates its kernel it picks the latest mint at the end and puts it as last menuentry. The / are separate LVs anf /home is common.– AasJan 25, 2016 at 22:04