NFS Issue - may have lost much of my itunes library

Discussion in 'macOS' started by kc2kth, Aug 29, 2009.

  1. kc2kth macrumors member

    Joined:
    Aug 27, 2009
    #1
    So a week or so ago I followed some online instructions for moving my itunes library to an external nas device. The remote file system was mounted with nfs and the remote host is a nas appliance running some Linux variant. Everything looked good and I imported about 100 CD's to the new location. Originally I had mounted the remote nfs share using the Directory Utility, however reading through some more documentation on Leopard (I'm relatively new at Macs in general) I found out that I didn't need to create that mount and I could use the automounting feature in the /net file system.

    In trying to get itunes to point to this location instead (/net/rhost/path/itunes) instead of the old mount point (/Volumes/rhost/path/itunes) iTunes got really confused. Eventually it wouldn't open and I ended up reinstalling (didn't help), then deleting all of the itunes related files from ~/Library/Preferences (iTunes started up after this). I then pointed iTunes to the correct path and began adding everything back to the itunes library since none of it came up automatically (like iTunes couldn't use the existing library file on the remote host).

    This morning I see only about one third of my music is in iTunes. Looking at a folder containing some of the missing music in Finder, all of the files are 0kb in size and have dates of Dec 31 1903. If I look at these files from Terminal, I see the correct dates and file sizes (~500-600kb). I also notice that the "@" is missing from the file permissions on these songs. All of the songs iTunes can see have the "@" intact on their permissions.

    I know this indicates something to do with extended attributes or resource forks, but I'm not sure exactly what. I'm also not sure how - if I can - to recover these files into iTunes. They are all .m4a files if that matters.

    I'm hoping someone can help me figure out what I did wrong so I don't do it again, and hopfully how to recover all of this stuff. I'd hate to have to start reimporting everything again.

    thanks in advance!
     
  2. DeepYogurt, Jan 4, 2011
    Last edited: Jan 4, 2011

    DeepYogurt macrumors newbie

    Joined:
    Sep 17, 2008
    #2
    Messed up iTunes - possible solution?

    Hi,

    Did you ever figure out how to resolve the problem with the lost extended attributes? The same thing just happened to me - I used the "rsync" command to move a bunch of stuff (including iTunes) and now I'm in a pickle.

    I've learned a bit more info - I looked at another Mac's iTunes setup with a "ls -l" and "xattr *" and "xattr -l *" and the songs all look similar to this:

    mp-snowtime:picture Parodies #1 me$ ls -la
    total 175192
    drwxr-xr-x 2 me staff 136 Dec 26 18:35 .
    drwxr-xr-x 7 me staff 238 Dec 26 18:33 ..
    -rw-r--r--@ 1 me staff 45676953 Dec 26 22:23 01 Hunchback Of N.D. - 1940-03-17.m4a
    -rw-r--r--@ 1 me staff 44016111 Dec 26 18:35 02 Mr. Benny Goes To Washington - 1943-01-24.m4a
    mp-snowtime:picture Parodies #1 bobf$ xattr *
    01 Hunchback Of N.D. - 1940-03-17.m4a: com.apple.FinderInfo
    02 Mr. Benny Goes To Washington - 1943-01-24.m4a: com.apple.FinderInfo
    mp-snowtime:picture Parodies #1 bobf$ xattr -l *
    01 Hunchback Of N.D. - 1940-03-17.m4a: com.apple.FinderInfo:
    00000000 4D 34 41 20 68 6F 6F 6B 00 00 00 00 00 00 00 00 |M4A hook........|
    00000010 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
    00000020
    02 Mr. Benny Goes To Washington - 1943-01-24.m4a: com.apple.FinderInfo:
    00000000 4D 34 41 20 68 6F 6F 6B 00 00 00 00 00 00 00 00 |M4A hook........|
    00000010 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
    00000020

    I think I might try to use the "xattr" command on the files that got goofed up and see what happens. In a posting on the Apple forums site (see http://discussions.apple.com/thread.jspa?threadID=2351284 for more info) - they talk about using the "xattr" command like this:

    By the way, the com.apple.FinderInfo attribute for a text file (type TEXT creator R*ch) would be set with something like:

    xattr -wx com.apple.FinderInfo '54 45 58 54 52 2A 63 68 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00' /some/text/file

    So if that's how to use it something like this for one of the songs:

    xattr -wx com.apple.FinderInfo '4D 34 41 20 68 6F 6F 6B 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00' "02 Mr. Benny Goes To Washington - 1943-01-24.m4a"

    might work (sets the attribute to "M4A hook") which is the attribute that all the songs seem to have on the Mac that has a working iTunes setup.

    Also the iTunes libraries have some special attributes that also got removed. They look like this on another Mac that isn't goofed up:

    mp-snowtime:iTunes bobf$ xattr -l "iTunes Library" "iTunes Music Library.xml" sentinel
    iTunes Library: com.apple.FinderInfo:
    00000000 68 6B 64 62 68 6F 6F 6B 00 00 00 00 00 00 00 00 |hkdbhook........|
    00000010 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
    00000020
    iTunes Music Library.xml: com.apple.FinderInfo:
    00000000 54 45 58 54 74 74 78 74 00 00 00 00 00 00 00 00 |TEXTttxt........|
    00000010 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
    00000020
    iTunes Music Library.xml: com.apple.metadata:com_apple_backup_excludeItem:
    00000000 62 70 6C 69 73 74 30 30 5F 10 11 63 6F 6D 2E 61 |bplist00_..com.a|
    00000010 70 70 6C 65 2E 62 61 63 6B 75 70 64 08 00 00 00 |pple.backupd....|
    00000020 00 00 00 01 01 00 00 00 00 00 00 00 01 00 00 00 |................|
    00000030 00 00 00 00 00 00 00 00 00 00 00 00 1C |.............|
    0000003d
    sentinel: com.apple.FinderInfo:
    00000000 00 00 00 00 00 00 00 00 40 00 00 00 00 00 00 00 |........@.......|
    00000010 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
    00000020

    Anyway, if you have any news on what you tried and worked or tried and didn't work would be appreciated.

    No guarantees for any of this - so make your own decision to try it or not. Can't be responsible for any thing bad that happens, but will be happy to take credit for anything good ;-) Good luck ...

    -Bob

    ps - this was done on a Snow Leopard 10.6.5 system - not sure if other versions are same or different, but think that 10.5 is when the extended file stuff was added and the xattr command appears. Also the above referenced Apple forum post talks about the "GetFileInfo" and "SetFile" utilities in the /Developer/usr/bin folder if you have installed the Developer option, but they don't give as much info as the "xattr" command as far as I can see.

    pps - just found out that the "rsync" command has the -E switch - so next time will definitely give that another try. Had originally copied things with the Finder but kept getting -36 type errors and couldn't figure out any way around it other than the "rsync" command - by the way here is the "rsync" command I used:

    cd ~
    rsync -avz Music "/Volumes/xxx/Music"
    #
    # which should be changed to
    #
    # rsync -avzE Music "/Volumes/xxx/Music"
    #
    # and another thing that happens is an extra level of directory, ie when it's done everything appears in the folder
    #
    # /Volumes/xxx/Music/Music
    #
    # so the content needs to be moved up one level, e.g.
    #
    # cd /Volumes/xxx
    # mv Music zzz
    # cd zzz
    # mv Music ..
    # cd ..
    # rmdir zzz

    Hope this makes sense ... have fun and let me know how it works out if you try it.
     

Share This Page