• NFS导致df -h无法使用解决


    NFS服务意外断开,导致挂载的客户端“df -Th”命令无法使用,及挂载目录无法“cd”“ls”

    检查

    [root@test ~]# strace df -h
    execve("/usr/bin/df", ["df", "-h"], 0x7ffd59cf01e8 /* 22 vars */) = 0
    brk(NULL)                               = 0x23d4000
    mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f635d450000
    access("/etc/ld.so.preload", R_OK)      = -1 ENOENT (No such file or directory)
    open("/etc/ld.so.cache", O_RDONLY|O_CLOEXEC) = 3
    fstat(3, {st_mode=S_IFREG|0644, st_size=33888, ...}) = 0
    mmap(NULL, 33888, PROT_READ, MAP_PRIVATE, 3, 0) = 0x7f635d447000
    close(3)                                = 0
    open("/lib64/libc.so.6", O_RDONLY|O_CLOEXEC) = 3
    read(3, "177ELF21133>1`&2"..., 832) = 832
    fstat(3, {st_mode=S_IFREG|0755, st_size=2156240, ...}) = 0
    mmap(NULL, 3985920, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7f635ce62000
    mprotect(0x7f635d025000, 2097152, PROT_NONE) = 0
    mmap(0x7f635d225000, 24576, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x1c3000) = 0x7f635d225000
    mmap(0x7f635d22b000, 16896, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x7f635d22b000
    close(3)                                = 0
    mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f635d446000
    mmap(NULL, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f635d444000
    arch_prctl(ARCH_SET_FS, 0x7f635d444740) = 0
    mprotect(0x7f635d225000, 16384, PROT_READ) = 0
    mprotect(0x617000, 4096, PROT_READ)     = 0
    mprotect(0x7f635d451000, 4096, PROT_READ) = 0
    munmap(0x7f635d447000, 33888)           = 0
    brk(NULL)                               = 0x23d4000
    brk(0x23f5000)                          = 0x23f5000
    brk(NULL)                               = 0x23f5000
    open("/usr/lib/locale/locale-archive", O_RDONLY|O_CLOEXEC) = 3
    fstat(3, {st_mode=S_IFREG|0644, st_size=106172832, ...}) = 0
    mmap(NULL, 106172832, PROT_READ, MAP_PRIVATE, 3, 0) = 0x7f6356920000
    close(3)                                = 0
    open("/usr/share/locale/locale.alias", O_RDONLY|O_CLOEXEC) = 3
    fstat(3, {st_mode=S_IFREG|0644, st_size=2502, ...}) = 0
    mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f635d44f000
    read(3, "# Locale name alias data base.
    #"..., 4096) = 2502
    read(3, "", 4096)                       = 0
    close(3)                                = 0
    munmap(0x7f635d44f000, 4096)            = 0
    open("/usr/share/locale/en_US.UTF-8/LC_MESSAGES/coreutils.mo", O_RDONLY) = -1 ENOENT (No such file or directory)
    open("/usr/share/locale/en_US.utf8/LC_MESSAGES/coreutils.mo", O_RDONLY) = -1 ENOENT (No such file or directory)
    open("/usr/share/locale/en_US/LC_MESSAGES/coreutils.mo", O_RDONLY) = -1 ENOENT (No such file or directory)
    open("/usr/share/locale/en.UTF-8/LC_MESSAGES/coreutils.mo", O_RDONLY) = -1 ENOENT (No such file or directory)
    open("/usr/share/locale/en.utf8/LC_MESSAGES/coreutils.mo", O_RDONLY) = -1 ENOENT (No such file or directory)
    open("/usr/share/locale/en/LC_MESSAGES/coreutils.mo", O_RDONLY) = -1 ENOENT (No such file or directory)
    open("/proc/self/mountinfo", O_RDONLY)  = 3
    fstat(3, {st_mode=S_IFREG|0444, st_size=0, ...}) = 0
    mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f635d44f000
    read(3, "18 40 0:18 / /sys rw,nosuid,node"..., 1024) = 1024
    stat("/etc/sysconfig/64bit_strstr_via_64bit_strstr_sse2_unaligned", 0x7ffe3bf78430) = -1 ENOENT (No such file or directory)
    read(3, " efivarfs rw
    29 25 0:25 / /sys/f"..., 1024) = 1024
    read(3, ",noexec,relatime shared:19 - cgr"..., 1024) = 1024
    read(3, "55,hard,proto=tcp,timeo=600,retr"..., 1024) = 319
    read(3, "", 1024)                       = 0
    lseek(3, 0, SEEK_CUR)                   = 3391
    close(3)                                = 0
    munmap(0x7f635d44f000, 4096)            = 0
    stat("/dev", {st_mode=S_IFDIR|0755, st_size=2960, ...}) = 0
    stat("/sys/kernel/security", {st_mode=S_IFDIR|0755, st_size=0, ...}) = 0
    stat("/dev/shm", {st_mode=S_IFDIR|S_ISVTX|0777, st_size=40, ...}) = 0
    stat("/run", {st_mode=S_IFDIR|0755, st_size=1060, ...}) = 0
    stat("/sys/fs/cgroup", {st_mode=S_IFDIR|0755, st_size=340, ...}) = 0
    stat("/sys/fs/cgroup/systemd", {st_mode=S_IFDIR|0755, st_size=0, ...}) = 0
    stat("/sys/fs/pstore", {st_mode=S_IFDIR|0755, st_size=0, ...}) = 0
    stat("/sys/firmware/efi/efivars", {st_mode=S_IFDIR|0755, st_size=0, ...}) = 0
    stat("/sys/fs/cgroup/blkio", {st_mode=S_IFDIR|0755, st_size=0, ...}) = 0
    stat("/sys/fs/cgroup/net_cls,net_prio", {st_mode=S_IFDIR|0755, st_size=0, ...}) = 0
    stat("/sys/fs/cgroup/devices", {st_mode=S_IFDIR|0755, st_size=0, ...}) = 0
    stat("/sys/fs/cgroup/cpu,cpuacct", {st_mode=S_IFDIR|0755, st_size=0, ...}) = 0
    stat("/sys/fs/cgroup/cpuset", {st_mode=S_IFDIR|0755, st_size=0, ...}) = 0
    stat("/sys/fs/cgroup/freezer", {st_mode=S_IFDIR|0755, st_size=0, ...}) = 0
    stat("/sys/fs/cgroup/memory", {st_mode=S_IFDIR|0755, st_size=0, ...}) = 0
    stat("/sys/fs/cgroup/hugetlb", {st_mode=S_IFDIR|0755, st_size=0, ...}) = 0
    stat("/sys/fs/cgroup/pids", {st_mode=S_IFDIR|0755, st_size=0, ...}) = 0
    stat("/sys/fs/cgroup/perf_event", {st_mode=S_IFDIR|0755, st_size=0, ...}) = 0
    stat("/sys/kernel/config", {st_mode=S_IFDIR|0755, st_size=0, ...}) = 0
    stat("/", {st_mode=S_IFDIR|0555, st_size=284, ...}) = 0
    stat("/dev/hugepages", {st_mode=S_IFDIR|0755, st_size=0, ...}) = 0
    stat("/boot/efi", {st_mode=S_IFDIR|0700, st_size=16384, ...}) = 0
    stat("/data", {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0
    stat("/run/user/0", {st_mode=S_IFDIR|0700, st_size=40, ...}) = 0
    stat("/data/share", 

    是由于/data/share导致的无法使用命令,/data/share为nfs挂载目录

    解决思路:
    1.强制取消客户端挂载
    2.重启NFS服务,客户端和服务端都需要重启
    3.重新挂载NFS

    处理方法:
    1.强制取消客户端挂载

    cat /etc/mtab
    umount -lf /mnt
  • 相关阅读:
    【笔记】偏差方差权衡 Bias Variance Trade off
    【笔记】验证数据集与交叉验证
    【笔记】可视化模型误差之学习曲线
    【笔记】过拟合和欠拟合以及为什么要对分为训练数据集和测试数据集
    【笔记】多项式回归的思想以及在sklearn中使用多项式回归和pipeline
    【笔记】特征脸(PCA在人脸识别领域的应用)
    【笔记】使用PCA对数据进行降噪(理解)
    Kubernetes 中的 Pod 安全策略
    解读与部署(三):基于 Kubernetes 的微服务部署即代码
    【从小白到专家】Istio技术实践专题(四):应用接入Istio的正确姿势
  • 原文地址:https://www.cnblogs.com/fat-girl-spring/p/14585497.html
Copyright © 2020-2023  润新知