Repair Time Machine user WD_Backup on My Book World Edition II

english  Es gibt auch eine deutsche Version dieses Artikels.

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:

wget http://dreamrivers.net/mbwe/repair_backup_user.sh
sh repair_backup_user.sh

 

Error description

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.

wd_backup1

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
deluser WD_Backup
cat /etc/.factoryDefault/passwd | grep WD_Backup >> /etc/passwd
cat /etc/.factoryDefault/shadow | grep WD_Backup >> /etc/shadow
passwd WD_Backup

At last the user is asked to change WD_Backup’s password.

Advertisements

Kommentar verfassen

Trage deine Daten unten ein oder klicke ein Icon um dich einzuloggen:

WordPress.com-Logo

Du kommentierst mit Deinem WordPress.com-Konto. Abmelden /  Ändern )

Google+ Foto

Du kommentierst mit Deinem Google+-Konto. Abmelden /  Ändern )

Twitter-Bild

Du kommentierst mit Deinem Twitter-Konto. Abmelden /  Ändern )

Facebook-Foto

Du kommentierst mit Deinem Facebook-Konto. Abmelden /  Ändern )

Verbinde mit %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.