LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Desktop
User Name
Password
Linux - Desktop This forum is for the discussion of all Linux Software used in a desktop context.

Notices


Reply
  Search this Thread
Old 08-28-2016, 11:57 PM   #1
ritesh.yeole
LQ Newbie
 
Registered: Aug 2016
Posts: 1

Rep: Reputation: Disabled
How to make RHEL7.2 and CentOS 7.2 dual boot ( Linux to Linux ) ?


Hi,

I have RHEL7.2, 64 bit workstation installed and want to install CentOS7.2, 64 bit. Can anyone have idea how to make dual boot with RHEL and CentOS.

Thanks in advace.

Ritesh
 
Old 08-29-2016, 05:54 AM   #2
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,696

Rep: Reputation: 5894Reputation: 5894Reputation: 5894Reputation: 5894Reputation: 5894Reputation: 5894Reputation: 5894Reputation: 5894Reputation: 5894Reputation: 5894Reputation: 5894
Welcome to LinuxQuestions

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.
 
Old 09-01-2016, 01:58 PM   #3
tofino_surfer
Member
 
Registered: Aug 2007
Posts: 483

Rep: Reputation: 153Reputation: 153
"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.
 
Old 09-01-2016, 03:09 PM   #4
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,696

Rep: Reputation: 5894Reputation: 5894Reputation: 5894Reputation: 5894Reputation: 5894Reputation: 5894Reputation: 5894Reputation: 5894Reputation: 5894Reputation: 5894Reputation: 5894
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.

Last edited by michaelk; 09-01-2016 at 03:13 PM.
 
Old 09-01-2016, 09:09 PM   #5
tofino_surfer
Member
 
Registered: Aug 2007
Posts: 483

Rep: Reputation: 153Reputation: 153
"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.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Unable to dual boot after install RHEL7 in windows 7 running laptop k@nch@ Red Hat 8 09-15-2017 06:37 AM
Is it possible to Dual Boot Linux Mint 14 and CentOS 6? QuantumKnight Linux - Newbie 4 05-20-2013 11:48 AM
[SOLVED] Solaris 11 + CentOS 6 dual boot , how to make it work routers Solaris / OpenSolaris 3 11-17-2012 11:25 PM
[SOLVED] How to dual boot Linux (CentOS 5.3) and Windows 7 on 2 partitions. purerage34 Linux - Newbie 7 01-14-2010 12:52 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Desktop

All times are GMT -5. The time now is 02:45 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration