Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

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.

share|improve this question

1 Answer 1

up vote 1 down vote accepted

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 uninstall grub from one of the two distributions or you'll be dealing with this problem twice.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.