Showing posts from July, 2021

How to clone CentOS server to another one

 How to clone CentOS server to another one   Step 1: Installing the Rsync Tool in CentOS For cloning to be successful the rsync command-line tool needs to be present on both servers. This will be used for mirroring the source server to the destination server and syncing all the differences between the two systems. Thankfully, modern systems come with rsync already pre-installed. To check the version of rsync installed run: $ rsync --version If you want to view additional information about rsync, execute the following rpm command : $ rpm -qi rsync Check Rsync Version in CentOS If rsync is missing, run the following command to install it in RHEL / CentOS / Fedora systems. $ sudo yum install rsync Step 2: Configure the Source Server There are directories and files that you may want to exclude from cloning because they are either already available in the destination server or are autogenerated. These include the /boot , /tmp and /dev directories. Therefore, create

Change grub2 default kernel

 Change grub2 default kernel 0. Check if grub_default is setup to saved # cat /etc/default/grub 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=" vconsole.font=latarcyrheb-sun16 crashkernel=auto  vconsole.keymap=us rhgb quiet" GRUB_DISABLE_RECOVERY="true" 1. make copy of grub # cp /boot/grub2/grub.cfg /boot/grub2/grub.cfg.bak 2. generata new grub .config # grub2-mkconfig -o /boot/grub2/grub.cfg   3. Check what kernels are available. # grep "^menuentry" /boot/grub2/grub.cfg | cut -d "'" -f2 4. Select kernel by name and setup as default  #grub2-set-default "Oracle Linux Server 7.9, with Linux 3.10.0-1160.31.1.el7.x86_64   5. Check what is saved entry # grub2-editenv list  

Recreate initramfs with realtek.ko for kernel 5.4.x

  Recreate initramfs with realtek.ko for kernel 5.4.x   1. Edit dracut.conf # mcedit /etc/dracut.conf add_drivers+=" realtek r8169 "   2. Backup initramfs # cp /boot/initramfs-$(uname -r).img /boot/initramfs-$(uname -r).img.$(date +%m-%d-%H%M%S).bak 3. Rebuild initramfs with multipath >CentOS/RHEL 6 # dracut -v -f -a multipath --include /etc/multipath /etc/multipath >CentOS/RHEL 7 # dracut --force --add multipath --include /etc/multipath 4. Verify # ls -lrt /boot/initramfs-$(uname -r).img 5.  Check if realtek is included # lsinitrd /boot/initramfs-5.4.17-2102.202.5.el7uek.x86_64.img |grep realtek -rw-r--r--   1 root root 33784 May 23 08:24 usr/lib/modules/5.4.17-2102.202.5.el7uek.x86_64/kernel/drivers/net/ethernet/realtek/r8169.ko.xz -rw-r--r--   1 root root   4732 May 23 08:24 usr/lib/modules/5.4.17-2102.202.5.el7uek.x86_64/kernel/drivers/net/phy/realtek.ko.xz  6. Reboot # reboot