[CONTENT] Linux common parameters of /etc/fstab file

/dev/vg/lv_var /var xfs nodev,nosuid,noexec 0 0
/dev/vg/lv_var_log /var/log xfs nodev,nosuid,noexec,x-systemd.requires-mounts-for=/var 0 0

(
Add:
1) nodev parameter here means this directory can not be interpreted by devices or blocks
2) nosuid parameter here means no setuid files can be created in this directory
3) noexec parameter here means no files can be executed in this directory
4) x-systemd.requires-mounts-for=/var here parameter means /var/log directory can not be mounted until /var directory has been mounted
)

[DEBUG] Linux resolve df command is stuck

Error phenomenon:

Input df command and the command is stuck
Can not us cd / command to access /(root) directory
Can not us ls / command to display /(root) directory

Analysis:

There may be some network storage disconnected

Solution:

Step One: Use mount command to check if there is any disconnected network storage here

# mount

Step Two: Use unmount command to unmount this disconnected network storage

# umount -f -l <nfs storage which is stuck>

[步骤] Linux journal 日志的永久存储

正文:

步骤一:理解 journal 日志存储机制

默认情况下,journal 的日志存储在 /run/log/journal,而 /run 目录只是一个临时目录。

将 Storage 参数设置为 persistent 后,journal 的日志将存储在 /var/log/journal,/var/log 则是一个永久的目录。

步骤二:将 journal 日志设置为永久存储

2.1 修改 /etc/systemd/journald.conf 文件

# vi /etc/systemd/journald.conf

将部分内容修改如下:

[Journal]
......
Storage=persistent
......

2.2 重启 systemd-journald 服务

# systemctl restart systemd-journald.service

参考文献:

https://linuxconfig.org/introduction-to-the-systemd-journal