Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

Well... It's about on an OS X system (hfs+), but that's unix after all to. :p

system has become unbootable, due to a filesystem error...

fsck.hfsplus fails because ....

    ...
    ** 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.
    ...

using find -mtime I managed to locate some problematic files, that.... do not actually exist....

    # 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 on them simply does not have any result or error. rmdir and rm -rf on the parent directory do not do the trick, because "the directory is not empty". Tried to touch those files and

    # 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 프린터 공유

dual entries with the same inode...

    # rm -f U*

but that also brings me to the initial situation

    # 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 프린터 공유

any ideas of anything I could try????

share|improve this question
    
format the file sysem? –  Ramesh Apr 23 at 15:34
    
Time to restore the backup, I guess… –  Andreas Wiese Apr 23 at 15:50
    
@Ramesh, that is indeed the easy way out but I see this as a kind of educational case. I'd like to try and solve it instead of bypassing the problem :) –  chris Apr 23 at 15:57
    
This seems to me like some implementation bug, maybe? I'd say get your backup tapes out. –  darnir Apr 23 at 16:05

1 Answer 1

up vote 2 down vote accepted

You've found a bug (or, possibly, "we'll get to it somday...") in Apple's HFS+ fsck. It sounds like it needs to try fixing your file to a different name, after finding out its first attempt isn't available. This leaves you with a couple of options:

First, take a backup of any data you can currently read from the FS. Ideally, take an image (bit-for-bit copy) and work on that.

Corruption always makes me wonder how it happened. There are a lot of places it could have come from, but the most worrysome would be bad memory. I'd run a memory test on the machine.

The file names is printing out appear to be UTF16-LE, which gives a name α̍λογο/σελ.37.tif. It wants to change it to άλογο/σελ.37.tif—not sure why. Google Translate tells me that's Greek, and makes sense, so I'm guessing its right. It's possible that an rm (or mv) on one of those will work. You really want to attempt to hex-decode the file name its giving on the command-line; I used xxd -p -r to do so, but I'm not sure if you have that on Mac OS X. Who knows if that weird file name will survive copy & paste from my terminal, through my web browser, Stack Exchange, you browser, and finally copy & past to your terminal.

I also note the / in the file name; that's an actual forward-slash, not something that just looks like it. I'm not sure if that's allowed by HFS+.

Any way, if all that doesn't work, you have three next approaches to try:

  1. Format the filesystem and restore from backup.
  2. HFS+ fsck is open source, you could download the source and attempt to fix it.
  3. Look up the HFS+ specifications (hopefully its documented; HFS was, I presume Apple documented HFS+ too). Use a filesystem editor (if you can find one) or, worst case, a hex editor to fix it, or at least delete the file.

The simplest edit might be to change a few bytes of the file name. For example, you could easily change the .tif at the end (2E 00 74 00 69 00 66 00) to .bad (2E 00 62 00 61 00 64 00). Then run fsck again, and that'll hopefully lead to a non-duplicate name.

share|improve this answer
    
thank you very much!!!! It seems I got confused in between two quite separate problems and you led me to solve the first and most important!!! Your hint for the file name (άλογο) led me to locate the file, simply make a copy and remove the old one. after that fsck proudly reported ** The volume Macintosh HD was repaired successfully. –  chris Apr 23 at 17:36

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.