The way we did in place upgrades from CentOS 6 to 7 for our network appliance VMs:
1. Take a backup of our appliance (database, settings, uploads, etc.). Store the backup on a separate partition/volume. 2. Copy the CentOS 7 Minimal .iso, with our added packages, to the backup partition/volume (disk.iso in the below code). 3. Copy the initrd and vmlinuz images to the boot partition (cp loop/isolinux/vmlinuz loop/isolinux/initrd.img /boot/). 4. Backup the current GRUB config (cp /boot/grub/grub.conf /boot/grub/grub.conf.bakupgrade). 5. Copy our custom kickstart file to the boot partition/volume. 6. Drop the upgrade GRUB menu config on the boot partition/volume.
``` default=0 timeout=0 serial --unit=0 --speed=9600 terminal --dumb --timeout=5 serial console
title upgrade root (hd0,0) kernel vmlinuz rd.lvm=1 rd.md=1 inst.ks=hd:/dev/${disk_device}1://ks.cfg inst.repo=hd:/dev/mapper/VolGroup-lv_backup://disk.iso inst.sshd inst.cmdline inst.noninteractive inst.noshell inst.headless net.ifnames=0 selinux=0 ip=dhcp ksdevice=eth0 vga=792 modprobe.blacklist=floppy consoleblank=0 biosdevname=0 console=tty0 console=ttyS0,115200n8 initrd initrd.img ```
${disk_device} can be found using:
``` disk_device=$(lsblk | grep disk | grep -e '^[h,s,v]da' -e 'xvda' -e 'nvme0n1' | awk '{print $1}' | head -1) ```
I can't guarantee the LVM route will work with CentOS 8, we had to use CentOS 7.3's LiveOS image to do this, as after that version the ability to access the .iso on a LVM disappeared (I think it was an unintended feature of 7.3 and older).
Gregory Young | Senior Developer/Systems Engineer | N-able
On 2021-09-29, 09:25, "CentOS on behalf of Gestió Servidors" <centos-bounces@centos.org on behalf of sysadmin.caos@uab.cat> wrote:
[EXTERNAL] This email originated from outside of the organization.
Hi,
I'm doing some tests of upgrading CentOS from 7 to 8 reading this step-by-step guide: https://nam12.safelinks.protection.outlook.com/?url=https%3A%2F%2Fnetshopisp...
I'm trying this upgrade in a VM, so I can save "snapshots" and restart in a past saved point. However, all my test ends wrong, exacly in Step 4 when I run "rpm -e `rpm -q kernel`". Then, systems says that some packages are kernel dependencies. After I remove that dependencies, I can't remove kernel...
Anybody has tested process upgrade from 7 to 8?
Thanks.
_______________________________________________ CentOS mailing list CentOS@centos.org https://nam12.safelinks.protection.outlook.com/?url=https%3A%2F%2Flists.cent...