Chinaunix首页 | 论坛 | 博客
  • 博客访问: 279927
  • 博文数量: 56
  • 博客积分: 0
  • 博客等级: 民兵
  • 技术积分: 642
  • 用 户 组: 普通用户
  • 注册时间: 2013-12-16 15:11
文章分类

全部博文(56)

文章存档

2017年(6)

2015年(3)

2014年(41)

2013年(6)

我的朋友

分类: LINUX

2014-01-08 16:57:11

How to install multiple OSs on GRUB2

 

GRUB2 is quite different with GRUB1, we cannot just follow the steps in GRUB1. Following steps will provide a simple way to install multiple OSs with GRUB2

1. Download vmlinuz and initrd.img files from tree and put them in /boot

2. Edit /etc/grub.d/40_custom

3. Add the new boot option like following

menuentry 'install'{

     linux /boot/vmlinuz biosdevname=0 root=live:

     initrd /boot/initrd.img

}

4. Run #grub2-mkconfig -o /boot/grub2/grub.cfg

5. Reboot the machine and choose the new boot option to install the system

6. Repeat step4 after installation finished.

7. Repeat the machine again and enter the new OS.

 

NOTE:

1. GRUB2 doesn't use title, instead is menuentry

2. Like 1, linux replaced kernel

3. DO NOT edit /boot/grub2/grub.cfg directly. Edit /etc/grub.d/40_custom instead.

4. Insert your content into /etc/grub.d/40_custom from the 3rd line, NOT the end of the file.

5. You needn't to use chainloader +1, step 4 and 6 will generate the new OS boot option automatically. But that doesn't mean you cannot use it. If you want to use that, refer to next part.

6. I've attached my /etc/grub.d/40_custom as an attachment.

7. Red words in this example is not necessary for installing RHEL6, since something goes wrong with RHEL7 so you need these words to tell RHEL7 to start from NIC


How to use chainloader on GRUB2

 

1. Suppose you have finished the first part.

2. Modify /etc/grub.d/40_custom like following:

    menuentry 'RHEL7'{

        set root=(hdX,Y)

        chainloader +1

    }

3. Run #grub2-mkconfig -o /boot/grub2/grub.cfg

4. Reboot the machine

 

NOTE:

1. In GRUB2, hd number is still start with 0, but hard disk partition number is start with 1. So your first partition of firt disk will be hd(0,1), not hd(0,0)

2. Make sure execute these steps in your "FIRST" system.


How to enable intel_iommu on GRUB2.

 

1. Suppose you have finished previouse 2 parts if you want to enable this for your second or other non-first systems, or you can ignore that 2 parts.

2. Modify /etc/default/grub, just add intel_iommu=on to the end of the line which starts with: GRUB_CMDLINE_LINUX

3. Run #grub2-mkconfig -o /boot/grub2/grub.cfg

4. Reboot the machine.

 

NOTE:

1. DO NOT edit /boot/grub2/grub.cfg directly. Edit /etc/default/grub instead, and run #grub2-mkconfig -o /boot/grub2/grub.cfg to update the grub.cfg file.

2. Do this part in the system which you want to enable intel_iommu.


How to specify the boot os in the grub2 files.

 

1.  Edit the following value in file "/etc/default/grub".

GRUB_DEFAULT=0  --------------------------modify the value to other number, number "0" is the 1st boot os menuentry in file /boot/grub2/grub.cfg, number "1" is the 2nd boot os, and so on. So, you can specify the default boot os via this settings.

 

2. Run #grub2-mkconfig -o /boot/grub2/grub.cfg

3. Reboot the host, then the host will boot to the os you just specify.

 

Note:

Do not edit /boot/grub2/grub.cfg file directly, since some info will be lost after the grub2 is updated.

 

======================5th PART=============================

 

How to install rhel7 on rhel6 manully

 

We know how to install 2nd rhel6 os on rhel6 host, and how to install one rhel6 os on rhel7 host.

But how to install one rhel7 os on the rhel6 host? Here is the method:

 

1. Download vmlinuz and initrd.img files from tree and put them in /boot

2. add the following content in the grub.conf.

title RHEL7

        root (hd0,0)

                kernel /boot/vmlinuz biosdevname=0 root=live:

                initrd /boot/initrd.img

 

3. comment the hidemenu in the grub.conf file.

    #hiddenmenu

 

4. restart the host, choose "RHEL7“, and install it manully.

 

Note:

Must add the squashfs.img config in the grub, if not, it will prompt up that lack of squashfs.img file during the installation.


阅读(2831) | 评论(1) | 转发(0) |
0

上一篇:linux配置IPV6

下一篇:How to remove switch bridge

给主人留下些什么吧!~~

yangyangRH2014-01-08 17:19:22

If your OS is RHEL6, how to install RHEL7 by manual partition
download vmlinuz and initrd.img to fodler /boot/ from the following url
http://download.englab.nay.redhat.com/pub/rhel/rel-eng/RHEL-7.0-20131127.1/compose/Server/x86_64/os/images/pxeboot/
Add the following words to /etc/grub.conf:
title (3.10.0-54.el7-20131127.1-x86_64)
boot (hd0,0)
kernel /boot/vmlinuz biosdevname=0 root=live:http://download.englab.n