SuSe 文件系统只读, 懒人卸载

问题背景
早上来,发现昨天的备份全部失败,报错都是 /tmp文件系统只读。

处理过程
:~ # lsb_release -a
LSB Version:    core-2.0-noarch:core-3.0-noarch:core-2.0-x86_64:core-3.0-x86_64:desktop-3.1-amd64:desktop-3.1-noarch:graphics-2.0-amd64:graphics-2.0-noarch:graphics-3.1-amd64:graphics-3.1-noarch
Distributor ID: SUSE LINUX
Description:    SUSE Linux Enterprise Server 10 (x86_64)
Release:        10
Codename:       n/a
bi-db:~ # cat /etc/SuSE-release
SUSE Linux Enterprise Server 10 (x86_64)
VERSION = 10
PATCHLEVEL = 2

:~ # df -h


进入 /tmp目录,touch一个文件果然报错,于是打算umount掉文件系统,再重新挂载。

:~ # umount /tmp
umount: /tmp: device is busy
umount: /tmp: device is busy

设备忙的话,可以查一下谁在使用。

:~ # lsof | grep /tmp
:~ # fuser -k -m -v /tmp

奇怪了,没有人使用,没有任何进程。

再次执行,依然报错。

:~ # umount /tmp
umount: //tmp: device is busy
umount: /tmp: device is busy

换个思路,执行懒人卸载,结果成功了。其实还不行的话,还可以执行强制卸载(-f 参数)
:~ # umount -l /tmp



:~ # mount /tmp

umount相关重要参数:
    
       -a  删除fstab中所有的文件系统
       -f  强制umount,主要针对不可达的NFS,这个应该是有风险,大家慎用,毕竟强扭的瓜不甜的哦。
       -l  懒惰模式,先删除文件系统层次。等文件系统不忙的时候清空所有连接。

参数使用顺序:

umount   /111

umount -l /111

umount -f /111

总结问题处理思路
文件系统只读的问题还是比较常见的,作为一个老手,处理思路最好心中有数,才可以处变不惊。
1)确保所有用户都已经退出挂载点目录,退出占用该目录的应用程序,尤其是自己

2)fuser或lsof查看还有什么僵死进程占用,kill掉

3)umount对应文件系统,使用的手段优先级参看本文前面内容



原文地址:https://www.cnblogs.com/yudai/p/12313306.html