在 Raid 驱动器上运行 fsck

在 Raid 驱动器上运行 fsck

我最近购买了一台旧的 Lenovo ix4-300d NAS(过时型号)。一段时间后它开始显示文件系统错误。

我尝试在通过 SSH 使用 putty 连接到设备后运行 fsck,这在空运行中确实识别出了可纠正的问题。但是,尽管卸载了驱动器和共享,fsck 仍会终止并显示错误,指出驱动器仍在使用中。定影器不显示任何正在使用该驱动器的内容。我还通过网络界面禁用了这些协议。我无法从 Web 界面使用文件系统扫描仪的原因是它不起作用。我也无法在根 FS 上触摸forcefsck,因为根 FS 是只读的,并且触摸的文件在重新启动时就会消失。

任何帮助将不胜感激。非常感谢。

错误显示 Raid 仍在使用中

我的/etc/fstab

装置错误

Web 界面中禁用所有协议

尾部 /var/log/messages

root@AdanetCloud:/# vgs
  VG          #PV #LV #SN Attr   VSize  VFree
  7d2470b7_vg   1   1   0 wz--n- 14.48t    0
  md0_vg        1   2   0 wz--n- 19.98g    0

root@AdanetCloud:/# lvs
  LV        VG          Attr     LSize  Pool Origin Data%  Move Log Copy%  Convert
  lv9953e62 7d2470b7_vg -wi-ao-- 14.48t                                         
  BFDlv     md0_vg      -wi-ao--  4.00g                                         
  vol1      md0_vg      -wi-ao-- 15.98g                                         


root@AdanetCloud:/# df -h Filesystem Size Used Avail Use% Mounted on /dev/mapper/7d2470b7_vg-lv9953e62 15T 2.6T 12T 18% /mnt/pools/A/A0 ... (truncated)

fsck -yf /dev/mapper/7d2470b7_vg-lv9953e62

root@AdanetCloud:/# fuser -uvm /mnt/pools/A/A0
                     USER        PID ACCESS COMMAND
/mnt/pools/A/A0:     root     kernel mount (root)/mnt/pools/A/A0
                     root       3512 F.... (root)mt-daapd

[fuser -uvm /mnt/pools/A/A0 after unmounting /mnt/pools/A/A0]

root@AdanetCloud:/# fuser -uvm /mnt/pools/A/A0
                     USER        PID ACCESS COMMAND
/mnt/pools/A/A0:     root     kernel mount (root)/
                     root          1 .rce. (root)init
                     root          2 .rc.. (root)kthreadd
                     root          3 .rc.. (root)ksoftirqd/0
                     root          6 .rc.. (root)migration/0
                     root          7 .rc.. (root)migration/1
                     root          9 .rc.. (root)ksoftirqd/1
                     root         10 .rc.. (root)khelper
                     root         11 .rc.. (root)netns
                     root        183 .rc.. (root)sync_supers
                     root        185 .rc.. (root)bdi-default
                     root        187 .rc.. (root)kblockd
                     root        193 .rc.. (root)ata_sff
                     root        204 .rc.. (root)khubd
                     root        210 .rc.. (root)md
                     root        228 .rc.. (root)rpciod
                     root        251 .rc.. (root)khungtaskd
                     root        256 .rc.. (root)kswapd0
                     root        257 .rc.. (root)fsnotify_mark
                     root        258 .rc.. (root)unionfs_siod
                     root        259 .rc.. (root)nfsiod
                     root        260 .rc.. (root)xfs_mru_cache
                     root        261 .rc.. (root)xfslogd
                     root        262 .rc.. (root)xfsdatad
                     root        263 .rc.. (root)xfsconvertd
                     root        264 .rc.. (root)crypto
                     root        345 .rc.. (root)iscsi_eh
                     root        348 Frc.m (root)httpd
                     root        361 .rc.. (root)scsi_eh_0
                     root        364 .rc.. (root)scsi_eh_1
                     root        367 .rc.. (root)scsi_eh_2
                     root        370 .rc.. (root)scsi_eh_3
                     root        384 .rc.. (root)scsi_eh_4
                     root        387 .rc.. (root)scsi_eh_5
                     root        393 .rc.. (root)target_completi
                     root        394 .rc.. (root)LIO_rd_mcp
                     root        403 .rc.. (root)mtdblock0
                     root        408 .rc.. (root)mtdblock1
                     root        413 .rc.. (root)mtdblock2
                     root        418 .rc.. (root)mtdblock3
                     root        423 .rc.. (root)mtdblock4
                     root        428 .rc.. (root)mtdblock5
                     root        433 .rc.. (root)mtdblock6
                     root        538 .rc.. (root)scsi_eh_6
                     root        539 .rc.. (root)usb-storage
                     root        558 .rc.. (root)kworker/u:1
                     root        633 .rc.. (root)ubi_bgt0d
                     root        694 .rc.. (root)kworker/0:0
                     root        713 .rc.. (root)ubifs_bgt0_0
                     root        718 .rc.. (root)md0_raid1
                     root        726 .rc.. (root)kdmflush
                     root        735 .rc.. (root)kjournald
                     root        750 .rc.. (root)loop0
                     root        754 .rc.. (root)loop1
                     root        776 .rc.. (root)loop2
                     root        839 .rc.. (root)krfcommd
                     root        920 .rc.. (root)flush-7:1
                     root       1049 Frc.m (root)udevd
                     root       2172 Frc.m (root)logsave
                     root       2484 Frc.m (root)rsyslogd
                     root       2554 .rc.. (root)bond0
                     root       2705 .rc.. (root)kworker/0:1
                     root       2795 Frc.m (root)dhclient
                     nobody     2934 Frc.m (nobody)mdnsd
                     root       2936 .rc.m (root)hostnamed
                     root       2949 Fr..m (root)appmd
                     root       2960 Frc.m (root)getty
                     root       2973 Fr..m (root)dbus-daemon
                     root       2975 Fr..m (root)eventd
                     nobody     3007 Frc.m (nobody)mdnsd
                     root       3009 .rc.m (root)hostnamed
                     root       3010 Fr..m (root)pkgd
                     root       3026 Fr..m (root)upnpdiscovery
                     nobody     3029 Fr..m (nobody)mdnsd
                     root       3031 Frc.m (root)sshd
                     root       3033 Fr..m (root)svcd
                     root       3037 Fr..m (root)acpid
                     root       3043 Fr..m (root)imgd
                     root       3057 Frc.m (root)lld2d
                     root       3058 Fr..m (root)sh
                     root       3060 Fr..m (root)sh
                     root       3077 Frc.m (root)httpd
                     root       3102 Fr..m (root)pcloudd
                     root       3105 Fr..m (root)activefolder
                     root       3243 Fr..m (root)sleep
                     root       3320 Frc.m (root)cron
                     root       3371 Frc.m (root)netplugd
                     root       3463 Frc.m (root)sshd
                     root       3478 .rc.m (root)sh
                     root       3556 .rc.. (root)flush-ubifs_0_0
                     root       3601 Fr..m (root)sleep
                     root       3678 Fr..m (root)sleep
                     root       3900 Frc.m (root)udevd
                     root       3902 Frc.m (root)udevd
                     root       4042 .rc.. (root)kdmflush
                     root       4087 .rc.. (root)kdmflush
                     root       4099 .rc.. (root)jbd2/dm-1-8
                     root       4100 .rc.. (root)ext4-dio-unwrit
                     root       4105 .rc.. (root)jbd2/dm-2-8
                     root       4106 .rc.. (root)ext4-dio-unwrit
                     root       4110 .rc.. (root)flush-253:1
                     root       4149 .rc.. (root)ufsd_sdd1
                     root       4316 Fr..m (root)displayd
                     root       4340 Fr..m (root)quiktransfer
                     root       4343 Fr..m (root)logrotation
                     root       4384 Fr..m (root)datamover
                     root       4459 Fr..m (root)connectd
                     root       4483 Fr..m (root)amazon
                     root       4548 Fr..m (root)Transmission
                     root       4550 Fr..m (root)transmission-da
                     root       4607 Fr..m (root)smbd
                     root       4611 Fr..m (root)winbindd
                     root       4616 Fr..m (root)mysqlserver
                     root       4683 Fr..m (root)winbindd
                     root       4839 Fr..m (root)smbd-notifyd
                     root       4840 Fr..m (root)cleanupd
                     root       4850 Fr..m (root)winbindd
                     root       4856 Fr..m (root)winbindd
                     root       4887 Fr..m (root)lpqd
                     root       4952 Fr..m (root)nmbd
                     root       4974 Fr..m (root)mysqld_safe
                     root       5202 Fr..m (root)rsync
                     root       5439 Fr..m (root)twonkystart.sh
                     root       5447 Fr..m (root)su
                     root       5451 Frc.m (root)isnsd
                     nobody     5459 Fr..m (nobody)twonkyserver
                     mysql      5837 Fr..m (mysql)mysqld
                     root       5985 .rc.. (root)scst_release_ac
                     root       5991 .rc.. (root)scst_uid
                     root       5995 .rc.. (root)scstd0
                     root       5998 .rc.. (root)scstd1
                     root       5999 .rc.. (root)scst_initd
                     root       6000 .rc.. (root)scsi_tm
                     root       6001 .rc.. (root)scst_mgmtd
                     root       6044 .rc.. (root)iscsird0_0
                     root       6045 .rc.. (root)iscsird0_1
                     root       6046 .rc.. (root)iscsird0_2
                     root       6049 .rc.. (root)iscsird0_3
                     root       6051 .rc.. (root)iscsiwr0_0
                     root       6052 .rc.. (root)iscsiwr0_1
                     root       6053 .rc.. (root)iscsiwr0_2
                     root       6055 .rc.. (root)iscsiwr0_3
                     root       6066 Frc.m (root)iscsi-scstd
                     root       6247 .rc.. (root)kworker/u:0
                     root      15522 Frc.m (root)httpd
                     root      16215 .rc.. (root)kworker/1:1
                     root      23662 Frc.m (root)httpd
                     root      26558 .rc.. (root)flush-253:2
                     root      32367 .rc.. (root)kworker/1:2

[After trying to run fsck on unmounted drive]

root@AdanetCloud:/# fsck /dev/mapper/7d2470b7_vg-lv9953e62
fsck 1.42.5 (29-Jul-2012)
e2fsck 1.42.5 (29-Jul-2012)
/dev/mapper/7d2470b7_vg-lv9953e62 is in use.
e2fsck: Cannot continue, aborting.

答案1

我能够解决这个问题。

  1. 启用 SSH(支持模式)并登录到设备 [UN: root; PW:soho+密码]使用SSH客户端(例如Windows上的Putty或Android上的JuiceSSH)。

  2. 通过 Web GUI 关闭所有可访问驱动器、NFS、Windows 共享、媒体服务器的“协议”[我之前没有禁用媒体服务器,因此 raid 驱动器正在使用中]。

  3. 卸载所有 NFS 共享文件夹和池安装 [使用 df -h 查看哪些文件夹安装到您的驱动器(对我来说是 /dev/mapper/7d2470b7_vg-lv9953e62)并使用 umount。

  4. 卸载所有内容后,在 RAID 驱动器上运行 fsck,运行 fsck -yfVC /dev/mapper/7d2470b7_vg-lv9953e62。

  5. 然后让它运行并纠正发现的任何错误。您可以单独运行 2 次,以确保修复所有错误。

  6. 如果存在大量碎片 (>1%),请在安装文件系统后重新启动后运行 e4defrag /dev/mapper/7d2470b7_vg-lv9953e62 (与 fsck 不同,fsck 不会在已安装的文件系统上运行)

  7. 运行 iostat -x 并检查每个驱动器的 %b。与其余的相比,表现不佳(或即将失败)的等待时间较长,并且通常 %b 将接近 100%。该驱动器需要更换。

  8. 重新启动(立即运行重新启动或关闭)

感谢大家。

相关内容