文件不存在,阻止我删除它们,文件系统损坏

文件不存在,阻止我删除它们,文件系统损坏

嗯……这是关于 OS X 系统(hfs+)的,但那毕竟是 unix。 :p

由于文件系统错误,系统无法启动...

fsck.hfsplus 失败,因为......

    ...
    ** Checking Catalog file.
       Illegal name
            illegal name is 0xB1 03 0D 03 BB 03 BF 03 B3 03 BF 03 2F 00 C3 03 B5 03 BB 03 2E 00 33 00 37 00 2E 00 74 00 69 00 66 00
            replacement name is 0xB1 03 01 03 BB 03 BF 03 B3 03 BF 03 2F 00 C3 03 B5 03 BB 03 2E 00 33 00 37 00 2E 00 74 00 69 00 66 00
    ....
    ** Repairing volume.
            replacement name already exists
            duplicate name is 0xB1 03 01 03 BB 03 BF 03 B3 03 BF 03 2F 00 C3 03 B5 03 BB 03 2E 00 33 00 37 00 2E 00 74 00 69 00 66 00
            FixIllegalNames - repair failed for type 0x23B 571
    ** The volume Macintosh HD could not be repaired.
    ...

使用 find -mtime 我设法找到一些有问题的文件,这些文件......实际上并不存在......

    # ls -lhai
    ls: cannot access USB 프린터 공유: No such file or directory
    ls: cannot access 시동 디스크: No such file or directory
    ls: cannot access 애플 메뉴 선택사항: No such file or directory
    ls: cannot access 인터넷: No such file or directory
    ls: cannot access 파일 관리자: No such file or directory
    total 0
    152704 drwxr-xr-x 1 root root  7 Apr 23 16:49 .
    152677 drwxr-xr-x 1 root root 18 Apr 23 14:55 ..
         ? -????????? ? ?    ?     ?            ? 애플 메뉴 선택사항
         ? -????????? ? ?    ?     ?            ? 시동 디스크
         ? -????????? ? ?    ?     ?            ? 파일 관리자
         ? -????????? ? ?    ?     ?            ? 인터넷
         ? -????????? ? ?    ?     ?            ? USB 프린터 공유

rm -r 对它们根本没有任何结果或错误。父目录上的 rmdir 和 rm -rf 不起作用,因为“目录不为空”。尝试触摸这些文件并

    # ls -lhai
    ls: cannot access USB 프린터 공유: No such file or directory
    ls: cannot access 시동 디스크: No such file or directory
    ls: cannot access 애플 메뉴 선택사항: No such file or directory
    ls: cannot access 인터넷: No such file or directory
    ls: cannot access 파일 관리자: No such file or directory
    total 0
    152704 drwxr-xr-x 1 root root  7 Apr 23 16:52 .
    152677 drwxr-xr-x 1 root root 18 Apr 23 14:55 ..
         ? -????????? ? ?    ?     ?            ? 애플 메뉴 선택사항
         ? -????????? ? ?    ?     ?            ? 시동 디스크
         ? -????????? ? ?    ?     ?            ? 파일 관리자
         ? -????????? ? ?    ?     ?            ? 인터넷
         ? -????????? ? ?    ?     ?            ? USB 프린터 공유
    # touch USB\ 프린터\ 공유 
    # ls -lhai
    ls: cannot access 시동 디스크: No such file or directory
    ls: cannot access 애플 메뉴 선택사항: No such file or directory
    ls: cannot access 인터넷: No such file or directory
    ls: cannot access 파일 관리자: No such file or directory
    total 0
     152704 drwxr-xr-x 1 root root  8 Apr 23 17:09 .
     152677 drwxr-xr-x 1 root root 18 Apr 23 14:55 ..
          ? -????????? ? ?    ?     ?            ? 애플 메뉴 선택사항
          ? -????????? ? ?    ?     ?            ? 시동 디스크
          ? -????????? ? ?    ?     ?            ? 파일 관리자
          ? -????????? ? ?    ?     ?            ? 인터넷
    4641964 -rw-r--r-- 1 root root  0 Apr 23 17:09 USB 프린터 공유
    4641964 -rw-r--r-- 1 root root  0 Apr 23 17:09 USB 프린터 공유

具有相同 inode 的双重条目...

    # rm -f U*

但这也让我想到了最初的情况

    # ls -lhai
    ls: cannot access USB 프린터 공유: No such file or directory
    ls: cannot access 시동 디스크: No such file or directory
    ls: cannot access 애플 메뉴 선택사항: No such file or directory
    ls: cannot access 인터넷: No such file or directory
    ls: cannot access 파일 관리자: No such file or directory
    total 0
    152704 drwxr-xr-x 1 root root  7 Apr 23 16:52 .
    152677 drwxr-xr-x 1 root root 18 Apr 23 14:55 ..
         ? -????????? ? ?    ?     ?            ? 애플 메뉴 선택사항
         ? -????????? ? ?    ?     ?            ? 시동 디스크
         ? -????????? ? ?    ?     ?            ? 파일 관리자
         ? -????????? ? ?    ?     ?            ? 인터넷
         ? -????????? ? ?    ?     ?            ? USB 프린터 공유

我可以尝试什么想法吗?

答案1

您在 Apple 的 HFS+ fsck 中发现了一个错误(或者可能是“我们有一天会解决它......”)。听起来在发现第一次尝试不可用后,它需要尝试将文件修复为不同的名称。这给你留下了几个选择:

首先,备份当前可以从 FS 读取的所有数据。理想情况下,拍摄一张图像(逐位复制)并对其进行处理。

腐败总是让我想知道它是如何发生的。它可能来自很多地方,但最令人担心的是记性不好。我会在机器上运行内存测试。

打印出来的文件名似乎是 UTF16-LE,它给出了一个名称α̍λογο/σελ.37.tif.它想把它改成άλογο/σελ.37.tif——不知道为什么。谷歌翻译告诉我这是希腊语,并且有道理,所以我猜它是对的。它是可能的其中一个上的 (或 ) 会起作用rmmv您确实想尝试对命令行上给出的文件名进行十六进制解码;我曾经xxd -p -r这样做过,但我不确定你在 Mac OS X 上是否有这个。谁知道这个奇怪的文件名是否会在我的终端、通过我的网络浏览器、Stack Exchange、你的浏览器以及最后的复制和粘贴中幸存下来复制并粘贴到您的终端。

我还注意到/文件名中的;这是一个真正的正斜杠,而不是看起来像的东西。我不确定 HFS+ 是否允许这样做。

无论如何,如果所有这些都不起作用,您可以尝试以下三种方法:

  1. 格式化文件系统并从备份恢复。
  2. HFS+ fsck 是开源的,您可以下载源代码并尝试修复它。
  3. 查找 HFS+ 规范(希望有记录;HFS 是,我想 Apple 也记录了 HFS+)。使用文件系统编辑器(如果你能找到一个),或者最坏的情况下,使用十六进制编辑器来修复它,或者至少删除该文件。

最简单的编辑可能是更改文件名的几个字节。例如,您可以轻松地将.tif末尾的 (2E 00 74 00 69 00 66 00) 更改为.bad(2E 00 62 00 61 00 64 00)。然后再次运行 fsck,这将有望产生一个不重复的名称。

相关内容