Re: how to debug problem with "failing unmounting"
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) pgpz9Eg9wANFY.pgp Description: PGP signature ___ Kernelnewbies mailing list Kernelnewbies@kernelnewbies.org https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
Re: how to debug problem with "failing unmounting"
On Thu, Jul 9, 2020 at 5:24 AM Tomek The Messenger < tomekthemessen...@gmail.com> wrote: > Hi > 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. So seems like searching in darkness what > is going on. Is any way how to search in darkness? Firstly I should make > sure /tmp or /run/user/0 is really a partition and was mount at linux > startup. Then maybe I should check access rights if it is rwx. What else > can be tried here? > ___ > > make sure there is no process which has these directories open (cd into it or open a file), you can I put some printk in the code to debug what leads to this condition. ___ Kernelnewbies mailing list Kernelnewbies@kernelnewbies.org https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
how to debug problem with "failing unmounting"
Hi 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. So seems like searching in darkness what is going on. Is any way how to search in darkness? Firstly I should make sure /tmp or /run/user/0 is really a partition and was mount at linux startup. Then maybe I should check access rights if it is rwx. What else can be tried here? ___ Kernelnewbies mailing list Kernelnewbies@kernelnewbies.org https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies