CenOS 9 - Lab 18.1

docx

School

San Antonio College *

*We aren’t endorsed by this school

Course

2325

Subject

Information Systems

Date

Apr 3, 2024

Type

docx

Pages

7

Uploaded by BaronRiver11822

Report
Page | 1 of 7 Lab 18.1 - Task 1 Restart your server and change the root password from the appropriate troubleshooting mode. To restart your server and change the root password from the appropriate troubleshooting mode in CentOS 9, follow these steps: 1. Boot into rescue mode. o Restart your server. o When the GRUB 2 boot menu appears, press  e  to edit the boot entry. o Find the line that starts with  Linux  and add the following to the end of it:  init=/sysroot/bin/sh o Press  Ctrl + X  to boot your server into rescue mode. o 2. Once a root shell is opened, type mount -o remount,rw /
Page | 2 of 7 3. Change the root password. o Once your server has booted into rescue mode, you will be presented with a shell prompt. o Type the following command to change the root password:  passwd root o You will be prompted to enter your new password twice. o 4. Reboot your server. 5. Log in to your server with the new root password. o Once your server has rebooted, you will be able to log in with the new root password. Lab 18.1 - Task 2 In /etc/fstab, change one of the device names so that on the next reboot, the file system on it cannot be mounted. Restart and fix the issue that you encounter. To change one of the device names in /etc/fstab so that on the next reboot, the file system on it cannot be mounted, follow these steps: 1. Open the /etc/fstab file in a text editor. 2. Find the line that corresponds to the device whose file system you want to prevent from mounting. 3. Change the device name to something invalid. For example, you could change it to /dev/invalid . 4. Save the /etc/fstab file. Once you have changed the device name in /etc/fstab, reboot your server. When the server boots, it will try to mount the file system on the device with the invalid name, but it will fail. To fix the issue, you will need to edit the /etc/fstab file again and change the device name back to the correct name. You can then reboot your server again, and the file system will mount normally.
Page | 3 of 7 Example: Suppose you have the following line in your /etc/fstab file: /dev/sda1 / ext4 defaults 0 1 This line tells the system to mount the file system on the device /dev/sda1 at the mount point / . If you want to prevent this file system from mounting, you can change the device name to something invalid, such as /dev/invalid . The revised /etc/fstab line would then be: /dev/invalid / ext4 defaults 0 1 When you reboot your server, the system will try to mount the file system on /dev/invalid , but it will fail because there is no such device. To fix the issue, you would need to edit the /etc/fstab file again and change the device name back to /dev/sda1 . You could then reboot your server again, and the file system would mount normally. Please note: Changing the device names in /etc/fstab can prevent file systems from mounting, which can cause problems if those file systems are required for booting the system or running applications. It is important to understand what you are doing before making any changes to /etc/fstab. If you are unsure of what you are doing, it is best to consult a qualified system administrator.
Your preview ends here
Eager to read complete document? Join bartleby learn and gain access to the full version
  • Access to all documents
  • Unlimited textbook solutions
  • 24/7 expert homework help
Page | 4 of 7 Lab 18.1 – Task 3 Use a rescue disk to bring your server up in full troubleshooting mode from the rescue disk. To use a rescue disk to bring your server up in full troubleshooting mode, follow these steps: 1. Insert the rescue disk into your server's optical drive or USB port. 2. Boot your server from the rescue disk. 3. When you see the rescue disk boot menu, select the option to start a troubleshooting shell. 4. Once you are in the troubleshooting shell, you will have full root access to your server's file system. You can then use the troubleshooting shell to perform any tasks necessary to troubleshoot your server. For example, you can: Check the file system for errors and repair them if necessary. Rebuild the initial RAM disk. Reconfigure the GRUB bootloader. Mount the root partition and chroot into it, which allows you to make changes to the system as if you were booted normally. Once you have finished troubleshooting your server, you can exit troubleshooting mode by running the following command: reboot Note: The specific steps for booting your server from the rescue disk and starting a troubleshooting shell may vary depending on the make and model of your server. Consult your server's documentation for more information. Example: Suppose you are using a CentOS 9 rescue disk. To boot your server from the rescue disk and start a troubleshooting shell, follow these steps:
Page | 5 of 7 1. Insert the rescue disk into your server's optical drive or USB port. 2. Restart your server. 3. When you see the GRUB bootloader menu, press the e key to edit the boot entry. 4. Add the following kernel parameter to the end of the boot entry: inst.rescue 5. Press Ctrl+X to boot into troubleshooting mode. 6. Once you are in troubleshooting mode, you will have a root shell. You can then use the root shell to perform any tasks necessary to troubleshoot your server. Please note that troubleshooting mode is a powerful tool, and using it incorrectly can damage your system. If you are not comfortable troubleshooting your system yourself, it is best to contact a qualified system administrator for assistance.
Page | 6 of 7 If you do not have a rescue disk, you can still get into troubleshooting mode on CentOS 9 by following these steps: 1. Restart your server. 2. When you see the GRUB bootloader menu, press the e key to edit the boot entry. 3. Add the following kernel parameter to the end of the boot entry: inst.rescue 4. Press Ctrl+X** to boot into troubleshooting mode.** Once you are in troubleshooting mode, you will have a root shell that you can use to troubleshoot your system. You can also use the following commands to perform common troubleshooting tasks: fsck -f /dev/sda1 to check the root partition for errors and repair them if necessary. dracut -f to rebuild the initial RAM disk, which can be helpful if your system is having problems booting. grub2-mkconfig -o /boot/grub2/grub.cfg to reconfigure the GRUB bootloader. chroot /mnt/sysimage to mount the root partition and chroot into it, which allows you to make changes to the system as if you were booted normally. Once you have finished troubleshooting your system, you can exit troubleshooting mode by running the following command: reboot Note: If you are using a UEFI system, you may need to press the F12 key or another key to access the boot menu. You may also need to disable Secure Boot in order to boot into troubleshooting mode. Please note that troubleshooting mode is a powerful tool and using it incorrectly can damage your system. If you are uncomfortable troubleshooting your system, it is best to contact a qualified system administrator for assistance.
Your preview ends here
Eager to read complete document? Join bartleby learn and gain access to the full version
  • Access to all documents
  • Unlimited textbook solutions
  • 24/7 expert homework help
Page | 7 of 7 Lab 18.1 – Task 4 Re-create the initramfs. To recreate the initramfs in CentOS 9, you can use the following command: dracut -f This command will rebuild the initramfs using the current kernel and configuration. If you are using a custom kernel or configuration, you may need to specify them to the dracut command. For example, to rebuild the initramfs for a custom kernel located at /boot/vmlinuz- 4.18.0-custom , you would run the following command: dracut -f -k /boot/vmlinuz-4.18.0-custom If you are rebuilding the initramfs for a specific configuration file, you can use the -c option to specify the file. For example, to rebuild the initramfs for a configuration file located at /etc/dracut.conf.d/my-custom-config , you would run the following command: dracut -f -c /etc/dracut.conf.d/my-custom-config Once the initramfs has been rebuilt, it will be located at /boot/initramfs-$(uname -r).img . You can then reboot your system and use the new initramfs. Please note that rebuilding the initramfs can be a dangerous operation if done incorrectly. If you are not comfortable rebuilding the initramfs yourself, it is best to contact a qualified system administrator for assistance.