Error 50 is a generic - iTunes has failed to write a file and the article listing specific store errors (expand the section on Specific Conditions and Alert Messages to reveal -50 in that section) deals with the usual problems where the store is failing or the network is failing.
If the error is bubbling up from the filesystem (or you get the error from Finder), then it's often an "illegal" character in the file or folder name. Look to remove or rename files with emoji, unicode characters or more mundane characters like : & or /
In your case, it's very likely the drive is the cause. You can and should look in the console app to see what other errors happen around that time. Look for I/O errors - disk0 - or just run disk utility and have it verify / repair the catalog file. This will confirm the guess that the drive is failing and the errors are not some software problem.
You could export the current library xml to the desktop and start over with a brand new iTunes library file just to rule out corruption in that file, but then you would have two problems at the same time - terminal unable to write a file and iTunes unable to write a file. Occam's razor (and my experience) says it's the filesystem/drive - not two identical software problems.
Spinning hard drives do track the sectors where a bad write has happened and try to keep track of them so the system won't notice files not vein written, but as a drive ages (or if this mechanism fails) you will get unrecoverable errors more and more.
Also - it's often hard to tell if the catalog structure is bad (which Disk Warrior, Drive Genius and plain old erase in Disk Utility attempt to fix assuming the drive works properly). But if the underlying hardware is failing, you'll need to move to a new drive.
I would just make another backup and zero the drive and look for errors during the zero / reinstall. If the errors persist, it's time for a new drive once the pain of reboots is more than the cost of a new part costs.
In your specific case of an old PPC machine where repair is invasive and the cables likely to be brittle, I would just re-install the OS onto an inexpensive and many GB external drive and run the mac from a cheap USB drive (most iBooks will boot from USB, but not all will) - leaving the potentially failing internal drive sitting unused, unmounted and spun down. It's rare for a failed drive to take down the machine so you can just leave it alone for minimal cost if you can tolerate the iBook running on an external drive.
Manually Cloning a Recovery Partition
This process worked for me on an external USB drive, but I don't have a Firewire drive or encrypted partition to test with, but it should work for you.
Requirements
- Existing recovery partition on your internal drive (or elsewhere).
- At least 650 MB of free space on your external drive (a previous version of this answer required more space, but I fixed the first section to only use what's required).
Add New Partition
Notes: this process is not destructive, provided you have sufficient free space on your drive.
In Terminal, run diskutil list
. You should get output like this:
/dev/disk0
#: TYPE NAME SIZE IDENTIFIER
0: GUID_partition_scheme *120.0 GB disk0
1: EFI 209.7 MB disk0s1
2: Apple_HFS Macintosh SSD 119.2 GB disk0s2
3: Apple_Boot Recovery HD 650.0 MB disk0s3
/dev/disk1
#: TYPE NAME SIZE IDENTIFIER
0: GUID_partition_scheme *320.1 GB disk1
1: EFI 209.7 MB disk1s1
2: Apple_HFS Portable 319.7 GB disk1s2
Make note of the identifiers for your existing recovery partition (in my case, disk0s3
) and the main partition on your external drive (disk1s2
).
- Run
diskutil info disk1s2 | grep 'Total Size'
, replacing disk1s2
with the identifier for your external volume. Note the number of bytes listed.
- Run
diskutil resizeVolume disk1s2 Xb JHFS+ Temp 650002432b
, replacing X with the total number of bytes from step 2 minus 650002432
. This will repartition your disk, giving us a new partition with exactly enough space for the recovery partition. Note: A recovery partition is not always 650002432 bytes. Find out the exact size by checking diskutil info
on the partition you want to copy.
- The
resizeVolume
command will print out the new partition map (like in step 1), make note of the identifier for the new partition (labelled Temp
).
Clone Existing Recovery to the New Partition
Run the following command in Terminal to clone the recovery partition to the new partition, replacing disk0s3
and disk1s3
with the appropriate identifiers for your partitions:
sudo asr -source /dev/disk0s3 -target /dev/disk1s3 --erase
You will be asked for your password, and to verify that you want to erase the contents (type y followed by enter), then the cloning process will begin.
- Unmount the recovery partition if it's mounted, then run
sudo asr adjust --target /dev/disk1s3 --settype "Apple_Boot"
. Be sure to replace disk1s3
with the appropriate identifier. This sets the proper partition type, which stops OS X from auto-mounting the recovery partition when you attach your external drive.
If everything completed properly, you should have a working recovery partition on your external disk.
Best Answer
The error message "Mac OS X Lion couldn't be install, because the disk Macintosh HD is damaged and can't be repaired." in the photo above would indicate that there is either a problem with the physical hard drive of your Mac or the Mac's "Macintosh HD" volume is damaged at a software level.
While you're in the installer you can click on Window > Installer Log to view a log from the Lion installer. This may give you some clues as to what is causing the error. For instance, any mention of "Disk I/O Error" would be an indicator that there is a communication problem with the hard drive at a hardware level.
You can also attempt to repair the Macintosh HD volume using Disk Utility (should be accessible from the Lion installer's Utility menu), or reformat it again if the repair fails. Once repaired or reformatted you can attempt the installation again.
Hopefully that helps.