1. 症状
ipod にデータを転送する際にこんなエラーが出て転送が止まってしまう。
「不明なエラーが発生しました(-54)」
2. 環境
OS | Mac OS X 10.4.10 |
ipod | ipod video 60G (第5世代), Ver. 1.2.1 |
iTunes | 7.3.2 |
3. 原因
色々検索していって以下のサイトに辿り着いた。
Apple Discussions : Unknown error (-54) while syncing ipod
それによると直接の原因は「ロックされたファイルの転送に失敗した」かららしい。
(何故ロックされたファイルが出来たかについては調べていない)
4. 対処
4.1 ロックされたファイルの捜索
Mac OS X 付属のコマンドでファイルロックなどのフラグ情報の閲覧や操作を行える。
以下に 3 の項に載せたページの書き込みを引用する。
Re: Unknown error (-54) while syncing ipod
Posted: Aug 22, 2007 10:58 PM
in response to: geoffs11
If you are a Terminal geek like me,
here's the easy way to find which one of your 3500 songs is the cause:
just:~/Music/iTunes/iTunes Music joe$ ls -loR | grep uchg
-rwx------ 1 joe joe uchg 6881143 Feb 22 22:38 09 Wrecking Ball.m4a
ls = List files
-l = long format
-o = show flags (immutable flag, in this case)
-R = recursive, all subdirectories
| = take the output from that command and give it to the next command.
grep = searches for text
uchg = the "Immutable" flag. This is "Locked" when viewed in Finder.
Found the file in finder and unlocked it. Sync completed successfully.
Only took 2 hours to find the cause of the -54 error...
|
上記の方法で見つけたロックされたファイルをファインダーの「情報」の項からロックを外せば OK。
4.2 ターミナルからロックを外す方法
chflags (/usr/bin/chflags) というコマンドを使えばターミナルからロックを外す事が出来る。
-R オプションをつけると指定したディレクトリ以下全てのファイルが対象になる。
詳細は man を参照する事。
$ chflags nouchg File ...
4.1 では ls (/bin/ls) を使っていたが find (/usr/bin/find) と chflags を組み合わせれば
ファイルの捜索とロック解除を同時に行う事が出来る。
パーミッションでエラーが出た場合は sudo を追加して root 権限で実行する事。
$ find Dir -flags uchg -exec chflags nouchg '{}' \;