The Restore feature (General Restore or Full Restore) on My Book World Edition II has a serious bug. It wrecks the WD_Backup user, so Time Machine stops working, making it impossible to create or access any backups. This bug is verified on current firmware version 01.02.14.
I wrote a little script that can automatically repair the WD_Backup user bringing Time Machine back to life.
To run the script, you have to logon as root in SSH and type the following lines:
1. When Time Machine is started, it shows the error message: „An unexpected error occurred (error code -6584).“
2. When trying to change backup disk in System Preferences, the user WD_Backup and correct password are not accepted.
3. In My Book’s web interface it’s impossible to change the WD_Backup users password. An error message „Failed to change the password for ‚WD_Backup‘!“ is shown.
What happened, technichal background: All users are stored in /etc/passwd. The restore deletes WD_Backup from that file and recreates the user entry, messing it up somehow. It misses out a colon (:) between the password placeholder „x“ and the user id „502“. This makes it impossible for Time Machine to access or generate backups.
What the script does
The script checks, whether there is a damaged WD_Backup user entry in /etc/passwd and tries to repair it.
sed -i 's|:x502:|:x:502:|g' /etc/passwd
If it locates the known bug, the script automatically patches the firmware, so next time a General or Full Restore is run, it will not make the same mistake again.
sed -i 's|"502:|":502:|g' /proto/SxM_webui/admin/tools/generalRestore.php
sed -i 's|"502:|":502:|g' /proto/SxM_webui/admin/tools/fullRestore.php
If the WD_Backup user cannot be repaired this way, the script deletes this user an recreates it from firmware default settings. The password is set to backup.
id -u WD_Backup
cat /etc/.factoryDefault/passwd | grep WD_Backup >> /etc/passwd
cat /etc/.factoryDefault/shadow | grep WD_Backup >> /etc/shadow
At last the user is asked to change WD_Backup’s password.