Difference between revisions of "Upgrade RHEL6 to RHEL7"

From Notes_Wiki
(Created page with "Home > RHEL > Upgrade RHEL6 to RHEL7 We can upgrade from RHEL 6 to RHEL 7 as follows: # Install the tool to perform the migration from RHEL 6 to RHEL 7: #:<pre> #:: yum install redhat-upgrade-tool #:: yum install yum-utils #:</pre> # Disable all the enabled 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 use...")
 
m
 
(3 intermediate revisions by the same user not shown)
Line 1: Line 1:
[[Main Page|Home]] > [[RHEL]] > [[Upgrade RHEL6 to RHEL7]]
[[Main Page|Home]] > [[RHEL]] > [[Upgrade RHEL6 to RHEL7]]


We can upgrade from RHEL 6 to RHEL 7 as follows:
Overall upgrade from RHEL 6 to RHEL 7 can be done as follows:
# Install the tool to perform the migration from RHEL 6 to RHEL 7:
 
=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>
#:<pre>
#:: yum install redhat-upgrade-tool
#:: preupg
#:: yum install yum-utils
#:</pre>
#:</pre>
# Disable all the enabled repositories:
#: 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>
#:<pre>
#:: yum-config-manager --disable \*
#:: yum-config-manager --disable \*
Line 15: Line 47:
## Click Downloads to visit the Software & Download Center.  
## 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.  
## In the Red Hat Enterprise Linux area, click Download Software to download the latest version of the software.  
# Upgrade to RHEL 7 using ISO
## 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>
#:<pre>
#:: # redhat-upgrade-tool --iso RHEL7_ISO_filepath --cleanup-post
#:: cat /etc/*release
#:: # reboot
#:</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>
#:</pre>


Refer:
Refer:
* https://access.redhat.com/documentation/en-us/red_hat_gluster_storage/3.4/html/installation_guide/rhel6_to_rhel7
* 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>
##:: 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>
## 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>
##::  cat /proc/cmdline
##:</pre>
##: In the output leave BOOT_IMAGE and its value, copy everything from root= till end of line
## Set correct ownership and permissions
##:<pre>
##:: chown root:root /etc/default/grub
##:: chmod 644 /etc/default/grub
##:</pre>
## Install GRUB 2 specifing the install device
##:<pre>
##::  grub2-install /dev/<DEVICE_NAME> --grub-setup=/bin/true
##:</pre>
##: For example
##::<pre>
##:::  grub2-install /dev/sda1 --grub-setup=/bin/true
##::</pre>
##:: The --grub-setup=/bin/true option ensures that the old GRUB Legacy configuration is not deleted.
##:: '''Here we are installing grub2 on partition eg /dev/sda1 and not on parent disk /dev/sda for testing.'''
## Generate the GRUB 2 configuration file
##:<pre>
##:: grub2-mkconfig -o /boot/grub2/grub.cfg
##:</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>
##:: title GRUB 2 Test
##:: root (hd0,0)
##:: kernel /grub2/i386-pc/core.img
##:: boot
##:</pre>
##: Note that since we installed grub2 on /dev/sda1, we are specifying root(hd0,0) instead of root (hd0) as boot options.
## 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>
##:: grub2-install /dev/sdX
##:</pre>
##: '''Here we are installing grub2 on MBR (after testing) and overwriting grub and hence device is /dev/sda and not /dev/sda1'''
## Remove the old GRUB Legacy configuration file
##:<pre>
##:: mv /boot/grub/grub.conf /boot/grub/grub-old.conf
##:</pre>
## Reboot the system
##:<pre>
##::  reboot
##:</pre>
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




[[Main Page|Home]] > [[RHEL]] > [[Upgrade RHEL6 to RHEL7]]
[[Main Page|Home]] > [[RHEL]] > [[Upgrade RHEL6 to RHEL7]]

Latest revision as of 06:17, 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:

  1. Clear the version lock
    yum versionlock clear
  2. Enable the Extras repository
    subscription-manager repos --enable rhel-6-server-extras-rpms --enable rhel-6-server-optional-rpms
  3. Install the Preupgrade Assistant and Red Hat Upgrade Tool
    yum install preupgrade-assistant preupgrade-assistant-el6toel7 redhat-upgrade-tool
  4. Update all packages to their latest RHEL 6 version
    yum update
    shutdown -r now
  5. 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.
  6. 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.
  7. 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:

  1. Install the yum-utils package
    yum install yum-utils redhat-upgrade-tool
  2. Disable active repositories:
    yum-config-manager --disable \*
  3. Download latest RHEL 7 ISO
    1. Visit the Red Hat Customer Service Portal at https://access.redhat.com/login and enter your user name and password to log in.
    2. Click Downloads to visit the Software & Download Center.
    3. In the Red Hat Enterprise Linux area, click Download Software to download the latest version of the software.
    4. Copy the RHEL 7.9 iso to /root directory
  4. 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
  5. Reboot the system when prompted
    shutdown -r now
  6. (Optionally) Update your new RHEL 7 packages to their latest version
    yum update
  7. Verify that the system was upgraded to the desired minor version of RHEL 7
    cat /etc/*release
  8. (Optionally) Install the gnome desktop
    yum groupinstall 'X Window System' 'GNOME'
  9. (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:

  1. Ensure that the GRUB Legacy package has been uninstalled
    yum remove grub
  2. Make sure that the grub2 package has been installed.
    yum install grub2
  3. Generate the GRUB 2 configuration files
    1. 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"
    2. 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
    3. Set correct ownership and permissions
      chown root:root /etc/default/grub
      chmod 644 /etc/default/grub
    4. 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
      The --grub-setup=/bin/true option ensures that the old GRUB Legacy configuration is not deleted.
      Here we are installing grub2 on partition eg /dev/sda1 and not on parent disk /dev/sda for testing.
    5. Generate the GRUB 2 configuration file
      grub2-mkconfig -o /boot/grub2/grub.cfg
  4. Testing GRUB 2 with GRUB Legacy bootloader still installed
    1. 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
      Note that since we installed grub2 on /dev/sda1, we are specifying root(hd0,0) instead of root (hd0) as boot options.
    2. Reboot the system
    3. When presented with a GRUB Legacy menu, select the "GRUB 2 Test" entry
    4. When presented with a GRUB 2 menu, select a kernel to boot
    5. If the above did not work, restart, and do not choose the GRUB 2 Test entry on the next boot.
  5. Replacing GRUB Legacy bootloader on systems that use BIOS, if GRUB 2 works successfully
    1. Replace the GRUB Legacy bootloader with the GRUB 2 bootloader
      grub2-install /dev/sdX
      Here we are installing grub2 on MBR (after testing) and overwriting grub and hence device is /dev/sda and not /dev/sda1
    2. Remove the old GRUB Legacy configuration file
      mv /boot/grub/grub.conf /boot/grub/grub-old.conf
    3. Reboot the system
      reboot

Refer:



Home > RHEL > Upgrade RHEL6 to RHEL7