I tested dual booting RHEL 7 with Windows Server 2008 R2 (both in Legacy Mode) and documented it in this youtube video. These are the steps that I followed:
Step1: Make some space for installing RHEL 7 in Windows. I usually use Disk Management Utility
to shrink one of the existing NTFS partitions. Leave the empty space unallocated.
Step2: Boot RHEL 7 Installation Disc in Legacy mode. (Although Installation disk of Windows Server 2008 R2 is supposed to support UEFI, it gets stuck midway after booting).
Step3: Start Installation
Step4: Make some partitions in the free space. I usually create 3 partitions. One with the mount point '/'
and the second with the mount point '/boot'
and the third being the swap
partition. The first and second can be combined into one into the first one. But it is a matter of choice. One can also create another partition for mount point '/home'. The space that I allocate to swap partition is usually half of my physical RAM, since I don't run many memory hungry programs.
Step5: Continue with the installation
Step6: Boot into newly installed RHEL 7. You will notice that there was no option to boot into Windows Server 2008 R2. Strange, but true.
Step7: Add a menu entry for Windows in /etc/grub.d/41_custom
. Example:
cat <<EOF
menuentry "Windows Server 2008 R2" --class windows --class os {
insmod part_msdos
insmod ntfs
set root='(hd1,msdos1)'
search --no-floppy --fs-uuid --set=root 5478AE7178AE5192
chainloader +1
}
EOF
The value for set root=
should point to the partition which is marked as bootable. To check this, run the command: fdisk -l
as root. Sample Output:
Device Boot Start End Blocks Id System
/dev/sda1 * 41943040 167772159 62914560 7 HPFS/NTFS/exFAT
/dev/sda2 167772160 432199679 132213760 7 HPFS/NTFS/exFAT
/dev/sda4 432199680 625141759 96471040 5 Extended
/dev/sda5 448507904 625141759 88316928 83 Linux
/dev/sda6 432201728 436398079 2098176 82 Linux swap / Solaris
The partition with '*' in the 'Boot' column is the partition which has to be used as the value to set root=
. 1 in msdos1 corresponds to /dev/sda1
The argument to --set=root
is the UUID of the same partition with the boot flag enabled. Find that out by running the command blkid
as root. Sample Output:
/dev/sda1: LABEL="OS" UUID="5478AE7178AE5192" TYPE="ntfs"
/dev/sda2: LABEL="Data" UUID="54065C15065BF688" TYPE="ntfs"
/dev/sda5: UUID="ba2f07fa-ce2e-4705-ab39-203eb2be0053" TYPE="ext4"
/dev/sda6: UUID="d472a2f9-295e-4536-8273-b7eb489fc9e4" TYPE="swap"
Regenerate grub configuration, using the command: grub2-mkconfig -o /boot/grub/grub.cfg
Step8: Reboot. Done!
thanks, I don't understand this "fit a rescue/maintenance Linux "root-only" on a plain filesystem without swap into a smaller chunk before the "main" Linux". also what exactly CD do you use for partitioning? what partitions/filesystems do you create? – javapowered – 2014-10-06T19:41:09.153
also probably this is not compatible with HP Intelligent Provisioning as it can use entire disk only, I think – javapowered – 2014-10-06T19:41:59.680
@javapowered - edited the answer to include my comments and some more details for the partitioning scheme. Is this better understandable? – Florenz Kley – 2014-10-07T06:04:23.813
it's still hard to understand. i will try. it's better to have "step-by-step" tutuorial or, ideally, video ) Can I install Windows on entire harddrive, then "shrink" some space to install Linux there? will this work? – javapowered – 2014-10-09T07:00:03.380