هذا الجزء لم يُترجم بعد. أنت ترى النص الإنجليزي.
الهدف
Practice the three repairs that matter most: a lost root password, a broken fstab, and a damaged initramfs.
قبل أن تبدأ
- Take a VM snapshot of server1 first. You need console access (not SSH).
- You need the file system
/datafrom lab 14.1 (or any extra fstab line you can break).
المهام
ضع علامة على المهمة عندما تنتهي منها. متصفحك فقط يتذكر ذلك.
- Reset the root password to
redhatwithout knowing the old one. - Add a wrong line to
/etc/fstab(for example a mount of a UUID that does not exist, without nofail) and reboot. Repair the system from emergency mode so it boots normally. - Boot into rescue mode once with a kernel argument, check which units run, and continue to the normal target.
- Make a backup of the initramfs of the running kernel, delete the original, and rebuild it with dracut. Check that the system still boots.
تحقّق من عملك
- You can log in as root with
redhat(and SELinux is enforcing:getenforce). - The system boots to the default target without errors;
findmnt --verifyis clean. - The initramfs exists again and the system boots.
تلميحات
اعرض التلميحات
rd.break→mount -o remount,rw /sysroot→chroot /sysroot→passwd→touch /.autorelabel.- In emergency mode:
mount -o remount,rw /, edit fstab,systemctl daemon-reload,mount -a. systemd.unit=rescue.target; leave withsystemctl default.dracut -f;lsinitrd.
الحل
اعرض الحل
- Root password (at the GRUB menu:
e, addrd.breakto the linux line,Ctrl+X). - Break and fix fstab.
echo "UUID=00000000-1111-2222-3333-444444444444 /broken xfs defaults 0 0" >> /etc/fstab systemctl rebootIn emergency mode (log in as root):
- Rescue mode (at GRUB add
systemd.unit=rescue.target). - Rebuild the initramfs.
ملاحظاتي
لا توجد ملاحظات بعد.