Difference between revisions of "Upgrade RHEL6 to RHEL7"
From Notes_Wiki
m |
m |
||
Line 1: | Line 1: | ||
[[Main Page|Home]] > [[RHEL]] > [[Upgrade RHEL6 to RHEL7]] | [[Main Page|Home]] > [[RHEL]] > [[Upgrade RHEL6 to RHEL7]] | ||
For upgrading we need to first run pre-upgrade check. After that we can upgrade using redhat-upgrade-tool. | Overall upgrade from RHEL 6 to RHEL 7 can be done as follows: | ||
# | |||
## | =Run Pre-upgrade check= | ||
For upgrading we need to first run pre-upgrade check: | |||
# Clear the version lock | |||
#:<pre> | |||
#:: yum versionlock clear | |||
#:</pre> | |||
# Enable the Extras repository | |||
#:<pre> | |||
#:: subscription-manager repos --enable rhel-6-server-extras-rpms --enable rhel-6-server-optional-rpms | |||
#:</pre> | |||
# Install the Preupgrade Assistant and Red Hat Upgrade Tool | |||
#:<pre> | |||
#:: yum install preupgrade-assistant preupgrade-assistant-el6toel7 redhat-upgrade-tool | |||
#:</pre> | |||
# Update all packages to their latest RHEL 6 version | |||
#:<pre> | |||
#:: yum update | |||
#:: shutdown -r now | |||
#:</pre> | |||
# Run the Preupgrade Assistant to perform an assessment of the system | |||
#:<pre> | |||
#:: preupg | |||
#:</pre> | |||
#: This should generate an HTML file for us to view. | |||
#: There are options for preupg such as --cleanup for cleaning up after previos run; -S or --skip-common to skip common tests and -d for debug. Apart from HTML it also generate a log file which mostly has same information as what is displayed on screen. | |||
# Resolve problems found by the Preupgrade Assistant during the assessment by following the Remediation text in the report. ##: Sometimes for KDE and Gnome the text will include list of packages that need to be removed. We should remove them using yum for preupg test to succeed. | |||
# Run the Preupgrade Assistant again. If there are no new problems to be resolved, you can proceed with upgrading your system | |||
=Upgrade OS after successful pre-upgrade test= | |||
After that we can upgrade using redhat-upgrade-tool via: | |||
# Install the yum-utils package | |||
#:<pre> | |||
#:: yum install yum-utils redhat-upgrade-tool | |||
#:</pre> | |||
# Disable active repositories: | |||
#:<pre> | |||
#:: yum-config-manager --disable \* | |||
#:</pre> | |||
# Download latest RHEL 7 ISO | |||
## Visit the Red Hat Customer Service Portal at https://access.redhat.com/login and enter your user name and password to log in. | |||
## Click Downloads to visit the Software & Download Center. | |||
## In the Red Hat Enterprise Linux area, click Download Software to download the latest version of the software. | |||
## Copy the RHEL 7.9 iso to /root directory | |||
# Start the upgrade | |||
#:<pre> | |||
#:: redhat-upgrade-tool --iso iso_path --cleanup-post | |||
#:</pre> | |||
#: For example | |||
#::<pre> | |||
#::: redhat-upgrade-tool --iso /root/rhel-server-7.9-x86_64-dvd.iso --cleanup-post | |||
#::</pre> | |||
# Reboot the system when prompted | |||
#:<pre> | |||
#:: shutdown -r now | |||
#:</pre> | |||
# (Optionally) Update your new RHEL 7 packages to their latest version | |||
#:<pre> | |||
#:: yum update | |||
#:</pre> | |||
# Verify that the system was upgraded to the desired minor version of RHEL 7 | |||
#:<pre> | |||
#:: cat /etc/*release | |||
#:</pre> | |||
# (Optionally) Install the gnome desktop | |||
#:<pre> | |||
#:: yum groupinstall 'X Window System' 'GNOME' | |||
#:</pre> | |||
#(Optionally) Enable and start the graphical environment | |||
#:<pre> | |||
#:: systemctl set-default graphical.target | |||
#:: systemctl start graphical.target | |||
#:</pre> | |||
Refer: | |||
* https://access.redhat.com/documentation/en-us/red_hat_gluster_storage/3.4/html/installation_guide/rhel6_to_rhel7 | |||
=Update grub to grub2= | |||
After RHEL6 to RHEL7 upgrade we can upgrade grub to grub2 via: | |||
# Ensure that the GRUB Legacy package has been uninstalled | |||
#:<pre> | |||
#:: yum remove grub | |||
#:</pre> | |||
# Make sure that the grub2 package has been installed. | |||
#:<pre> | |||
#:: yum install grub2 | |||
#:</pre> | |||
# Generate the GRUB 2 configuration files | |||
## Manually create the /etc/default/grub file with content similar to: | |||
##:<pre> | ##:<pre> | ||
##:: | ##:: GRUB_TIMEOUT=5 | ||
##:: GRUB_DISTRIBUTOR="$(sed 's, release .*$,,g' /etc/system-release)" | |||
##:: GRUB_DEFAULT=saved | |||
##:: GRUB_DISABLE_SUBMENU=true | |||
##:: #GRUB_TERMINAL_OUTPUT="console" | |||
##:: GRUB_CMDLINE_LINUX="root=/dev/mapper/volgroup_lv_root rd.lvm.lv=vg_<volgroup>/<lvm_1> rd.lvm.lv=vg_<volgroup>/<lvm_1> custom_parameter_1 custom_parameter_2" | |||
##:: GRUB_DISABLE_RECOVERY="true" | |||
##:: GRUB_THEME="/boot/grub2/themes/system/theme.txt" | |||
##:</pre> | ##:</pre> | ||
## | ## In the created /etc/default/grub file, change the arguments list for GRUB_CMDLINE_LINUX. You can either fetch the list from /proc/cmdline or from /boot/grub2/grub.cfg | ||
##:<pre> | ##:<pre> | ||
##:: | ##:: cat /proc/cmdline | ||
##:</pre> | ##:</pre> | ||
## | ##: In the output leave BOOT_IMAGE and its value, copy everything from root= till end of line | ||
## Set correct ownership and permissions | |||
##:<pre> | ##:<pre> | ||
##:: | ##:: chown root:root /etc/default/grub | ||
##:: chmod 644 /etc/default/grub | |||
##:</pre> | ##:</pre> | ||
## | ## Install GRUB 2 specifing the install device | ||
##:<pre> | ##:<pre> | ||
##:: | ##:: grub2-install /dev/<DEVICE_NAME> --grub-setup=/bin/true | ||
##:</pre> | ##:</pre> | ||
## | ##: For example | ||
##::<pre> | |||
##::: grub2-install /dev/sda1 --grub-setup=/bin/true | |||
##::</pre> | |||
## Generate the GRUB 2 configuration file | |||
##:<pre> | ##:<pre> | ||
##:: | ##:: grub2-mkconfig -o /boot/grub2/grub.cfg | ||
##:</pre> | ##:</pre> | ||
# | # Testing GRUB 2 with GRUB Legacy bootloader still installed | ||
## | ## For systems with a separate /boot partition, Add a new section into grub.conf '<tt>/boot/grub/grub.conf</tt>' | ||
##:<pre> | ##:<pre> | ||
##:: | ##:: title GRUB 2 Test | ||
##:: root (hd0,0) | |||
##:: kernel /grub2/i386-pc/core.img | |||
##:: boot | |||
##:</pre> | ##:</pre> | ||
## | ## Reboot the system | ||
## When presented with a GRUB Legacy menu, select the "GRUB 2 Test" entry | |||
## When presented with a GRUB 2 menu, select a kernel to boot | |||
## If the above did not work, restart, and do not choose the GRUB 2 Test entry on the next boot. | |||
# Replacing GRUB Legacy bootloader on systems that use BIOS, if GRUB 2 works successfully | |||
## Replace the GRUB Legacy bootloader with the GRUB 2 bootloader | |||
##:<pre> | ##:<pre> | ||
##:: | ##:: grub2-install /dev/sdX | ||
##:</pre> | ##:</pre> | ||
## | ## Remove the old GRUB Legacy configuration file | ||
##:<pre> | ##:<pre> | ||
##:: | ##:: mv /boot/grub/grub.conf /boot/grub/grub-old.conf | ||
##:</pre> | ##:</pre> | ||
## Reboot the system | |||
## Reboot the system | |||
##:<pre> | ##:<pre> | ||
##:: | ##:: reboot | ||
##:</pre> | ##:</pre> | ||
Refer: | Refer: | ||
* https://access.redhat.com/documentation/en-us/ | * https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/7/html/system_administrators_guide/ch-working_with_the_grub_2_boot_loader#sec-Upgrading_from_GRUB_Legacy_to_GRUB_2 | ||
* https://access.redhat.com/solutions/3185891 | |||
* https://access.redhat.com/solutions/5697541 | |||
[[Main Page|Home]] > [[RHEL]] > [[Upgrade RHEL6 to RHEL7]] | [[Main Page|Home]] > [[RHEL]] > [[Upgrade RHEL6 to RHEL7]] |
Revision as of 06:09, 19 September 2022
Home > RHEL > Upgrade RHEL6 to RHEL7
Overall upgrade from RHEL 6 to RHEL 7 can be done as follows:
Run Pre-upgrade check
For upgrading we need to first run pre-upgrade check:
- Clear the version lock
- yum versionlock clear
- Enable the Extras repository
- subscription-manager repos --enable rhel-6-server-extras-rpms --enable rhel-6-server-optional-rpms
- Install the Preupgrade Assistant and Red Hat Upgrade Tool
- yum install preupgrade-assistant preupgrade-assistant-el6toel7 redhat-upgrade-tool
- Update all packages to their latest RHEL 6 version
- yum update
- shutdown -r now
- Run the Preupgrade Assistant to perform an assessment of the system
- preupg
- This should generate an HTML file for us to view.
- There are options for preupg such as --cleanup for cleaning up after previos run; -S or --skip-common to skip common tests and -d for debug. Apart from HTML it also generate a log file which mostly has same information as what is displayed on screen.
- Resolve problems found by the Preupgrade Assistant during the assessment by following the Remediation text in the report. ##: Sometimes for KDE and Gnome the text will include list of packages that need to be removed. We should remove them using yum for preupg test to succeed.
- Run the Preupgrade Assistant again. If there are no new problems to be resolved, you can proceed with upgrading your system
Upgrade OS after successful pre-upgrade test
After that we can upgrade using redhat-upgrade-tool via:
- Install the yum-utils package
- yum install yum-utils redhat-upgrade-tool
- Disable active repositories:
- yum-config-manager --disable \*
- Download latest RHEL 7 ISO
- Visit the Red Hat Customer Service Portal at https://access.redhat.com/login and enter your user name and password to log in.
- Click Downloads to visit the Software & Download Center.
- In the Red Hat Enterprise Linux area, click Download Software to download the latest version of the software.
- Copy the RHEL 7.9 iso to /root directory
- Start the upgrade
- redhat-upgrade-tool --iso iso_path --cleanup-post
- For example
- redhat-upgrade-tool --iso /root/rhel-server-7.9-x86_64-dvd.iso --cleanup-post
- Reboot the system when prompted
- shutdown -r now
- (Optionally) Update your new RHEL 7 packages to their latest version
- yum update
- Verify that the system was upgraded to the desired minor version of RHEL 7
- cat /etc/*release
- (Optionally) Install the gnome desktop
- yum groupinstall 'X Window System' 'GNOME'
- (Optionally) Enable and start the graphical environment
- systemctl set-default graphical.target
- systemctl start graphical.target
Refer:
Update grub to grub2
After RHEL6 to RHEL7 upgrade we can upgrade grub to grub2 via:
- Ensure that the GRUB Legacy package has been uninstalled
- yum remove grub
- Make sure that the grub2 package has been installed.
- yum install grub2
- Generate the GRUB 2 configuration files
- Manually create the /etc/default/grub file with content similar to:
- GRUB_TIMEOUT=5
- GRUB_DISTRIBUTOR="$(sed 's, release .*$,,g' /etc/system-release)"
- GRUB_DEFAULT=saved
- GRUB_DISABLE_SUBMENU=true
- #GRUB_TERMINAL_OUTPUT="console"
- GRUB_CMDLINE_LINUX="root=/dev/mapper/volgroup_lv_root rd.lvm.lv=vg_<volgroup>/<lvm_1> rd.lvm.lv=vg_<volgroup>/<lvm_1> custom_parameter_1 custom_parameter_2"
- GRUB_DISABLE_RECOVERY="true"
- GRUB_THEME="/boot/grub2/themes/system/theme.txt"
- In the created /etc/default/grub file, change the arguments list for GRUB_CMDLINE_LINUX. You can either fetch the list from /proc/cmdline or from /boot/grub2/grub.cfg
- cat /proc/cmdline
- In the output leave BOOT_IMAGE and its value, copy everything from root= till end of line
- Set correct ownership and permissions
- chown root:root /etc/default/grub
- chmod 644 /etc/default/grub
- Install GRUB 2 specifing the install device
- grub2-install /dev/<DEVICE_NAME> --grub-setup=/bin/true
- For example
- grub2-install /dev/sda1 --grub-setup=/bin/true
- Generate the GRUB 2 configuration file
- grub2-mkconfig -o /boot/grub2/grub.cfg
- Manually create the /etc/default/grub file with content similar to:
- Testing GRUB 2 with GRUB Legacy bootloader still installed
- For systems with a separate /boot partition, Add a new section into grub.conf '/boot/grub/grub.conf'
- title GRUB 2 Test
- root (hd0,0)
- kernel /grub2/i386-pc/core.img
- boot
- Reboot the system
- When presented with a GRUB Legacy menu, select the "GRUB 2 Test" entry
- When presented with a GRUB 2 menu, select a kernel to boot
- If the above did not work, restart, and do not choose the GRUB 2 Test entry on the next boot.
- For systems with a separate /boot partition, Add a new section into grub.conf '/boot/grub/grub.conf'
- Replacing GRUB Legacy bootloader on systems that use BIOS, if GRUB 2 works successfully
- Replace the GRUB Legacy bootloader with the GRUB 2 bootloader
- grub2-install /dev/sdX
- Remove the old GRUB Legacy configuration file
- mv /boot/grub/grub.conf /boot/grub/grub-old.conf
- Reboot the system
- reboot
- Replace the GRUB Legacy bootloader with the GRUB 2 bootloader
Refer:
- https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/7/html/system_administrators_guide/ch-working_with_the_grub_2_boot_loader#sec-Upgrading_from_GRUB_Legacy_to_GRUB_2
- https://access.redhat.com/solutions/3185891
- https://access.redhat.com/solutions/5697541