我有 3 个 HDD:/dev/sda
和 /dev/sdb
(2x1TB),均处于 RAID 0 模式 ->/dev/md127
和 4TB /dev/sdc
, -> /dev/sdc
。
我不小心运行了dd
脚本https://github.com/tdg5/blog/blob/master/_includes/scripts/dd_obs_test.sh到/dev/md127
(脚本写入 134218752 字节(128MB)到 raid),我的 Linux 操作系统在哪里。
是否有机会恢复一切,系统尚未重新启动并显示错误,无法使用 99% 的命令,这是来自控制台的日志:
[root@ns2 tmp]# df -h
Filesystem Size Used Avail Use% Mounted on
devtmpfs 7.8G 4.0K 7.8G 1% /dev
tmpfs 7.8G 12K 7.8G 1% /dev/shm
tmpfs 7.8G 624K 7.8G 1% /run
tmpfs 7.8G 0 7.8G 0% /sys/fs/cgroup
/dev/md127 64Z 64Z 677G 100% /
tmpfs 7.8G 0 7.8G 0% /tmp
tmpfs 1.6G 0 1.6G 0% /run/user/509
tmpfs 1.6G 0 1.6G 0% /run/user/0
[root@ns2 tmp]# df -a
Filesystem 1K-blocks Used Available Use% Mounted on
sysfs 0 0 0 - /sys
proc 0 0 0 - /proc
devtmpfs 8162264 4 8162260 1% /dev
securityfs 0 0 0 - /sys/kernel/security
tmpfs 8169748 12 8169736 1% /dev/shm
devpts 0 0 0 - /dev/pts
tmpfs 8169748 596 8169152 1% /run
tmpfs 8169748 0 8169748 0% /sys/fs/cgroup
cgroup 0 0 0 - /sys/fs/cgroup/systemd
pstore 0 0 0 - /sys/fs/pstore
cgroup 0 0 0 - /sys/fs/cgroup/cpuset
cgroup 0 0 0 - /sys/fs/cgroup/cpu,cpuacct
cgroup 0 0 0 - /sys/fs/cgroup/pids
cgroup 0 0 0 - /sys/fs/cgroup/net_cls,net_prio
cgroup 0 0 0 - /sys/fs/cgroup/blkio
cgroup 0 0 0 - /sys/fs/cgroup/memory
cgroup 0 0 0 - /sys/fs/cgroup/perf_event
cgroup 0 0 0 - /sys/fs/cgroup/devices
cgroup 0 0 0 - /sys/fs/cgroup/freezer
cgroup 0 0 0 - /sys/fs/cgroup/hugetlb
configfs 0 0 0 - /sys/kernel/config
/dev/md127 73786976294807425856 73786976294098109944 709299528 100% /
hugetlbfs 0 0 0 - /dev/hugepages
tmpfs 8169748 0 8169748 0% /tmp
systemd-1 - - - - /proc/sys/fs/binfmt_misc
debugfs 0 0 0 - /sys/kernel/debug
mqueue 0 0 0 - /dev/mqueue
tmpfs 1633952 0 1633952 0% /run/user/509
tmpfs 1633952 0 1633952 0% /run/user/0
binfmt_misc 0 0 0 - /proc/sys/fs/binfmt_misc
[root@ns2 tmp]# hdparm --help
-bash: /usr/sbin/hdparm: Structure needs cleaning
[root@ns2 tmp]# w
-bash: /usr/bin/w: Structure needs cleaning
[root@ns2 tmp]# ps
-bash: /usr/bin/ps: Structure needs cleaning
[root@ns2 tmp]# top
-bash: top: command not found
[root@ns2 tmp]# dnf --help
Fatal Python error: Py_Initialize: Unable to get the locale encoding
ImportError: No module named 'encodings'
Aborted
[root@ns2 tmp]# yum --help
-bash: /usr/bin/yum: Input/output error
[root@ns2 tmp]# kill --help
-bash: kill: -help: invalid signal specification
[root@ns2 tmp]# who
-bash: who: command not found
[root@ns2 tmp]# w
-bash: /usr/bin/w: Structure needs cleaning
[root@ns2 tmp]# xfs_copy
-bash: xfs_copy: command not found
[root@ns2 tmp]# ls -la /dev/sdc1
brw-rw---- 1 root disk 8, 33 Jun 4 17:53 /dev/sdc1
[root@ns2 tmp]#
编辑:所以我已经从 live CD 启动,将我的 RAID 0 -> /dev/md127 DD'ed 到 /dev/sdc1 作为 raid.img 并立即运行 xfs_repair -n 。我对此很陌生,是否还有其他命令可以以尽可能低的损坏来修复它?
答案1
raid0 中没有冗余,因此您覆盖的任何内容都消失了。