[SOLVED] How to make RHEL7.2 and CentOS 7.2 dual boot ( Linux to Linux ) ?
Linux - DesktopThis forum is for the discussion of all Linux Software used in a desktop context.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
It depends on how RHEL was installed and if you want to install CentOS on the same disk. A default install would use LVM and xfs filesystem. Creating free space on the same disk is somewhat difficult since there are no tools to shrink a xfs filesystem. One must backup the data, shrink the logical volume, create a new filesystem, and finally copy the data back. Once the new xfs filesystems are created you need to update the UUIDs in the /etc/fstab file. Once the logical volumes are reduced you can shrink the volume group and physical volume to create free space to install CentOS.
Not using LVM and xfs you would still need to backup your data, resize the partition, create a new filesystem and restore data. If using ext4 instead of xfs you can use resize the filesystem and the partition. Always backup data.
"Once the logical volumes are reduced you can shrink the volume group and physical volume to create free space to install CentOS."
This is dangerous and unnecessary. You can put the centos installation in lvm along with the rhel. There is no need to try to shrink the volume group and physical volume to create physical partitions, at least for the centos root. Once the existing logical volumes are reduced simply create a new logical volume for the centos root partition. I would recommend creating a separate data partition where you will keep most of your files. You then link to this partition from both home directories.
A problem you may run into is that lvm installs boot easier from a separate boot partition outside of lvm. There is a need for at least one separate boot partition in a standard physical partition on a system. The rhel install likely has a separate 500 MiB /boot partition. If you don't have space for another physical boot partition you will need to boot the centos installation in lvm from the grub in the rhel boot partition.
In a multi-boot system it is possible to have the one external boot partition with grub2 boot all of the other installations even if they are in lvm and have their boot directory in lvm. You would need to write a custom target in grub (40-custom) using grub lvm modules ( insmod lvm ) which loads the configfile inside the lvm installation's boot directory and loads its kernel and initrd.
It would have been easier to do such an install if you planned for it during the initial rhel install, leaving room for both a second 500MiB /boot partition and plenty of unused space in the lvm volume group.
In my opinion it would be best to keep the two completely separate. The OP could easily forget and delete the LVM partition without realizing that it is common to both. The dangerous part is shrinking the logical volume and the existing root filesystem. The OP needs to verify that root can be backed up and restored successfully.
By default RHEL/CentOS 7 creates a /boot partition and a LVM partition that contains root and swap. The default filesystem is xfs which as far as I know still does not have tool to reduce similar resize2fs. Since the OP has not responded yet I will assume a default installation.
As aside note if the OP does not have a RH paid subscription it would be best to completely reinstall with just CentOS.
"In my opinion it would be best to keep the two completely separate. The OP could easily forget and delete the LVM partition without realizing that it is common to both."
You have a low opinion of the intelligence and competence of the OP, someone you likely don't know. If it is a default install there would only be a 500 MiB /boot partition, possibly a tiny 1 MiB BIOS Boot partition for GPT disks, and a very large lvm partition which encompasses the rest of the disk, possibly hundreds of GB in size. There would be no other physical partitions on the disk, only 2-3. If the OP followed my advice and placed centos inside a logical volume there still would be only 2-3 physical partitions. Only an idiot would not realize that both installations must be inside the giant lvm partition if the only other two partitions are tiny.
Also keeping the two completely separate would waste disk space as you would need to create two swap partitions. A swap partition can easily be shared among multiple installations. I share a swap partition between my Centos 7 and Fedora 24 installs. The existing swap logical volume can be used for both saving many GB of disk space.
Last edited by tofino_surfer; 09-01-2016 at 09:13 PM.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.