On Thu, 09 Jul 2020 14:22:00 +0200, Tomek The Messenger said:
On the soc on which I work there is issue with unmouting some partitions/directories during /sbin/reboot, here is some example:
[ OK ] Stopped target Local File System. Unmouting Temporary Directory (/tmp)... Unmouting /run/user/0... ... [ FAILED ] Failed unmouting Temporary Directory (/tmp). [ FAILED ] Failed unmouting /run/user/0. ....
Unfortunately like it is typical in kernel information about why unmouting failed doesn't appear.
Those aren't kernel messages, they're messages issued by your init system. (Based on OK/FAILED, you're probably using a sysvinit rather than systemd, and the messages are coming from scripts in /etc/rc.d/rc6/ which is the 'reboot' runlevel - rc6 has symlinks to the actual script. The main shutdown/reboot script basically does a 'for $script in /etc/rc.d/rc6; do $script stop; done'. The most common reason for a filesystem to fail to unmount is that a process still has a file open on the file system. And for this, lsof is your friend. Stick an '/bin/lsof /tmp' in the script at the appropriate place to find out what's still got /tmp busy. (Depending on the system, it may not be worth looking into - often /tmp and /run are tmpfs systems that are going to evaporate *anyhow*, so there's no actual danger of a filesystem or data getting corrupted due to a hard dismount while the file system is active)