Активация перезапуска kdump#
# Write 1 to the sysrq file to enable the SysRq function. After this function is enabled, the kernel will respond to any operation.
echo 1 > /proc/sys/kernel/sysrq
# Make the system crash.
echo c > /proc/sysrq-trigger
Выполнение принудительного перезапуска#
Для принудительного перезапуска ОС можно использовать любой из следующих способов. — Перезапуск ОС вручную.
reboot -f
- Принудительное включение и отключение ОС через iBMC.
Перезапуск сети#
openEuler использует NetworkManager для управления сетью. Выполните следующую команду, чтобы перезапустить сеть:
systemctl restart NetworkManager
Восстановление файловой системы#
После принудительного отключения и последующего включения ОС файловая система может быть повреждена. При запуске ОС автоматически проверяет и восстанавливает файловую систему. Если файловую систему не удается восстановить, нужно выполнить команду fsck, чтобы проверить и восстановить файловую систему.
# In this case, the system enters the rescue mode. Check which file system is damaged in the log.
journalctl -xb
# Check whether the partition has been mounted before the repair.
cat /proc/mounts
# Uninstall the directory.
umount xx
# If the directory cannot be uninstalled, kill the process that occupies the directory.
lsof | grep xxx
kill xxx
# Run the fsck command to rectify the fault. Enter yes or no when prompted.
fsck -y /dev/xxx
Удаление кэша вручную#
#Different values of N can achieve different clearance purposes. According to the Linux kernel document, run the sync command before clearing data. (The drop operation does not release any dirty objects. The sync command writes all unwritten system buffers to drives, including modified inodes, delayed block I/Os, and read/write mapping files. In this way, dirty objects can be reduced so that more objects can be released.)
echo N > /proc/sys/vm/drop_caches
#Release the page caches.
echo 1 > /proc/sys/vm/drop_caches
#Release dentries and inodes.
echo 2 > /proc/sys/vm/drop_caches
#Release the page caches, dentries, and inodes.
echo 3 > /proc/sys/vm/drop_caches
Режим восстановления и однопользовательский режим#
-
Однопользовательский режим
На странице входа введите e, чтобы перейти на страницу grub, добавьте init=/bin/sh в строку linux и нажмите Ctrl+X.
- Выполните команду mount -o remount,rw /.
- Выполните операции, такие как изменение пароля.
- Введите exit, чтобы выйти.