Fault description
Unix UOS terminal logs into the graphical interface (i.e., the following figure), enters the correct domain user name and password,
and is unable to log in normally.Even if you use a local user, you cannot log in, and after clicking Log in, you are automatically returned to the log in interface.
Because TUNISY UOS disables the local root user in the domain management environment, TUNISY technical support suggests recoverinthe system to solve theproblem,
but after recovering the system,it is necessary to reconfigure all kinds of software programs,
and the problem occurs frequently,
and it is time-consuming and laborious to recover the system.
After repeated diagnosis and research by our technical experts, it is found that the problem is caused by the log file is too large, and the problem can be solved by
single-user logging in and emptying the file content.
Failure Analysis
In the long-term operation of the Unisys UOS system, some programs report errors, continuously write system logs, and the output error messages are too frequent,
which leads to a crazy growth of the log file, and ultimately leads to the root directory space is occupied, the system has no remaining space, and users can not log in.
Troubleshooting
Enter into single-user mode and empty the log file.
1) At the boot grub menu, press the direction "↓" key to position the cursor to the Uniontech OS Backup & Restore menu;
2) Press E to enter grub menu edit mode;
3) splash quite change to systemd.unit=multi-user.target, then press CTRL+X to enter into single-user mode;
4) Find the big log file:
a.Type sudo -s to switch to the root user;
b. Enter fdisk -l to view the disk partition, and find that the sda5 partition is 50G;
c. Find the root partition to mount;
Use the command to mount the sda5 partition on the /mnt directory and confirm that there are var, lib, usr directories under /mnt, then you can confirm
that sda5 is the root partition, if not then you need to try other partitions.
mount /dev/sda5 /mnt
ls -l /mnt
Type df -h to see the file system usage.
d. Find the large directory in the /mnt directory;
Use the following command:
du --max-depth=1 -BM /mnt/ | sort -nk1
The output shows that the /mnt/var directory is very large. Find files larger than 5 gigabytes in the /mnt/var directory.
cd /mnt/var
du --max-depth=1 -BM /mnt/var | sort -nk1
The output shows that the /mnt/var/log directory is very large, look for files larger than 5G under /mnt/var/log.
du -sh /mnt/var/log/*.
Note: The file kern.log.1 exceeds 5G and has reached 41G.
Empty the log files larger than 5G found by using the command (filenames are based on the larger files output by find).
truncate -s 0 /mnt/var/log/
Use the df -h command to see the space being freed as shown below.
e. Input reboot command to reboot the machine can be normally logged into the domestic Unisys UOS system.
Summary of experience
1、When there is a situation in which the Unix UOS cannot be logged in because the file system is full, resulting in the user not being able to log in,
and there are important files that can't be reset to the system,you can use this method to solve the problem;
2、Users will pull the baseline check script within the domain management platform every time they log in as a domain user. The following command
can be appended to the baseline check script toautomatically empty the log file after each login to avoid such problems;
find /var/log -type f -name \*.log -size +5G -exec truncate -s 0 {}\;
3. If you cannot control the baseline check script, you can also use the domain management platform to issue script function to issue the following
command to the terminal and modify the scheduled tasks to avoid it.
#/bin/bash
set -x
cat << EOF >> /var/spool/cron/crontabs/root
0 9 */1 * * find /var/log -type f -name \*.log -size +5G -exec truncate -s 0 {}\;
EOF
For more information, please visit Antute's official website:wm0t.aredsa.com