New My Book LIve

Hi, 

Just in case it helps someone: I just performed a “clean” factory restore (without deleting the data), and after the reboot I thought I had lost everything that was under all the shares, since I only saw the folder “Public”.

But connecting with SSH I discovered the folders were still there, just not showing. I moved all the data to Public and voilà!

1 Like

After my last message, I have to point out that it doesn’t actually format the partition. I had installed optware and Transmission in my MBL an after executing “/usr/local/sbin/factoryRestore.sh noreformat”, they are still there.

What it did was to restore the configuration to factory settings (passwords, shares, users, etc…)

1 Like

That is good to know. Now if only if the people who put together the WD firmware could make this an option via. the reset button on the back to allow the W.D. to be reset this way. Plus perform other actions that will fully restore the Dashboard UI irrespective of what state it’s in.

Hello,

Could someone PLEASE send a copy of  factoryRestore.sh to d.anmoore @ gmail.com?

It is missing from /usr/local/sbin (‘find / -name  factoryRestore.sh’ comes up empty!) , so I can’t do the factory reset, and my WD interface isn’t working.

Thank you very much!

I am curious how that script simply went missing?  I think W.D. will also want to know how a script has gone missing.

The script is simple. It seems to trigger some other process during the time the MBL starts up.  The script in my MBL is:

#!/bin/sh

#---------------------
# add stderr to stdout
exec 2>&1
PATH=/sbin:/bin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin

logger -s -t "$(basename $0)" "begin script: $@"
ls -l ${mountBasePath}/etc/nasglobalconfig.ini
source ${mountBasePath}/etc/nasglobalconfig.ini 2>/dev/null

. /usr/local/sbin/share-param.sh
. /usr/local/sbin/disk-param.sh

# accept parameter for skipping reformat (noreformat)

SYSTEM_SCRIPTS_LOG=${SYSTEM_SCRIPTS_LOG:-"/dev/null"}
# Output script log start info
{
echo "Start: `basename $0` `date`"
echo "Param: $@"
} >> ${SYSTEM_SCRIPTS_LOG}
#
{
#---------------------
# Begin Script
#---------------------
CMD=${1:-"ext4"}

##########################################
# � 2010 Western Digital Technologies, Inc. All rights reserved.
#
# factoryRestore.sh - This script kicks off the factory restore process
##########################################
echo "$CMD" > ${reformatDataVolume}

/usr/bin/touch ${RESTORE_SETTINGS_FROM_DIR_TRIGGER}

#---------------------
# End Script
#---------------------
# Copy stdout to script log also
} | tee -a ${SYSTEM_SCRIPTS_LOG}
# Output script log end info
{
echo "End:$?: `basename $0` `date`"
echo ""
} >> ${SYSTEM_SCRIPTS_LOG}
1 Like

Well, I was hoping not to have to relate this, but you were nice enough to post the script.  For some reason PHP wasn’t working, so I was trying to figure out how to reinstall it.  I saw this message:

The following packages are BROKEN:
  apache-php-webdav phpmyadmin
The following packages will be REMOVED:
  libapache2-mod-php5 php5
0 packages upgraded, 0 newly installed, 2 to remove and 43 not upgraded.
Need to get 0B of archives. After unpacking 6246kB will be freed.
The following packages have unmet dependencies:
  apache-php-webdav: Depends: php5 but it is not installable
  phpmyadmin: Depends: libapache2-mod-php5 but it is not installable or
                       libapache-mod-php5 which is a virtual package. or
                       php5-cgi but it is not installable or
                       php5 but it is not installable or
                       libapache2-mod-php4 which is a virtual package. or
                       libapache-mod-php4 which is a virtual package. or
                       php4 which is a virtual package. or
                       php4-cgi which is a virtual package.
The following actions will resolve these dependencies:

Remove the following packages:
admin-rest-api
apache-php-webdav
nas-safepoint
phpmyadmin
webui
The following packages will be REMOVED:
  admin-rest-api{a} apache-php-webdav{a} libapache2-mod-php5
  nas-safepoint{a} php5 phpmyadmin{a} webui{a}

So I canceled out…

Then for some stupid reason I tried to reinstall just admin-rest-api, but I missed the message it would uninstall webui as well… Stupid is as stupid does, and sometimes I does stupid things. Neither one will reinstall, they aren’t found. Anyways, I don’t know what did what, but now several important scripts are missing, and the MBL web interface isn’t working either…

Thanks for the script!

Can someone tell me what files they have in their MBL’s /etc folder that start with a period (aka: . )?

danimore, thing is that Western Digital designed the hardware and configured Linux for the MBL for one purpose and that’s for acting as a simple file and media streaming server.  Unfortunate the versions of software used is a bit out of date, there are more stable versions of certain software that should be included in the updates.

Ok, I understand the issue with Twonky but the likes of VSFTPD and SAMBA are open source GNU free-to-the-public server packages so it does puzzle me why Western Digital don’t update those.  It makes no sense whatsoever.

As to messing with aptitude?  My logic is that all the software libraries and other stuff are matched up.  Disturb them and you’re asking for more trouble somewhere down the line.

You might get the software and configuration you desire from the MyBook Live but there will be some piece of software that in time will fail.  Usually because a software library it expected is to find is now different.

As to your immediate problem.  Have you tried to reapply the firmware upgrade file?  That literally overwrites the Linux system partition and copies over configuration files from the Linux OS partition being replaced.  That might sort out the mess.

“Have you tried to reapply the firmware upgrade file?  That literally overwrites the Linux system partition and copies over configuration files from the Linux OS partition being replaced.  That might sort out the mess.”

Which script would that be, and BTW, I am probably missing it as well. I have the firmware file, just no way that I can figure out how to use it. Every time I see a reference to a script, it isn’t there.

I probably broke things by getting a PPTP VPN server working on it. I was successfull in VPNing in from a Windoze box. I scewed with it way too much doing that. If I did it over again I would do much less, it probably would be OK. I’d use OpenVPN, but the client setup everywhere I went would be too much. PPTP works out of the box on most OSs I use.

Right after I got that going,  I noticed that php wasn’t working.  Then I broke it

Any info/script to redo the firmware would be helpful, thanks!

(Since I posted this message, W.D. have released a firmware update that has changed this script.)

Have you the following two scripts on your NAS?

/usr/local/sbin/updateFirmwareFromFile.sh

/usr/local/sbin/updateFirmwareToLatest.sh

You can download the firmware file from W.D. web site.  Copy it to the NAS either via. the Samba service, using FTP if it’s enabled or SFTP which is automatically available when SSH is enabled then use the updateFirmwareFromFile.sh script to perform the upgrade.

Once the upgrade process starts, don’t terminate the Telnet over SSH session. Not much will show on the terminal window.  You can open a second a second Telnet over SSH session to the NAS and use the TOP command to reassure yourself that something is happening or not.  That’s what I do.  When the upgrade is complete you’ll know about it. you’ll see a broadcast message appear on all the consoles stating that the OS is about to reboot.

In-case the main upgrade script is missing, I’ve copied-n-pasted it below as is from my own NAS.

Maybe you could change dpkg -i ${filename} 2>&1 | tee ${updatelog} > /dev/null to dpkg -i ${filename} 2>&1 | tee ${updatelog} only if you’re going to run the script within the console so you get to see the output of dpkg for your personal reassurance?

updateFirmwareFromFile.sh = 

#!/bin/bash
#
# � 2010 Western Digital Technologies, Inc. All rights reserved.
#
# updateFirmwareFromFile.sh <filename>
#
#

#---------------------
# add stderr to stdout
exec 2>&1

PATH=/sbin:/bin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin
. /usr/local/sbin/share-param.sh
. /usr/local/sbin/disk-param.sh

source /etc/system.conf

SYSTEM_SCRIPTS_LOG=${SYSTEM_SCRIPTS_LOG:-"/dev/null"}
# Output script log start info
{
echo "Start: `basename $0` `date`"
echo "Param: $@"
} >> ${SYSTEM_SCRIPTS_LOG}
#
{
#---------------------
# Begin Script
#---------------------

restoreRaid ()
{
    currentRootDevice=`cat /proc/cmdline | awk '/root/ { print $1 }' | cut -d= -f2`
    duplicate_md=
    if ["${currentRootDevice}" != "/dev/nfs"]; then
        # stop any duplicate md devices and make sure both disks are part of the current rootfs md device
        if ["${currentRootDevice}" == "/dev/md0"]; then
            if [-e /dev/md1]; then
                duplicate_md="/dev/md1"
            fi
        elif ["${currentRootDevice}" == "/dev/md1"]; then
            if [-e /dev/md0]; then
                duplicate_md="/dev/md0"
            fi
        fi
        if [! -z ${duplicate_md}]; then
            echo "stopping duplicate md device ${duplicate_md}"
            mdadm --stop ${duplicate_md}
            mdadm --wait ${duplicate_md}
            sleep 1
        fi
        # always attempt to add both mirror partitions - its ok to fail if they are already there
        mdadm ${currentRootDevice} --add ${rootfsDisk1} > /dev/null 2>&1
        mdadm --wait ${currentRootDevice}
        mdadm ${currentRootDevice} --add ${rootfsDisk2} > /dev/null 2>&1
        mdadm --wait ${currentRootDevice}
        sleep 1
    fi
}

filename=${1}
updatelog="/CacheVolume/update.log"

if [$# != 1]; then
        echo "usage: updateFirmwareFromFile.sh <filename>"
        exit 1
fi

if [! -f ${filename}]; then
        echo "File not found"
        exit 1
fi

# check disk usage
dfout=`df | grep /DataVolume`
avail=`echo "$dfout" | awk '{printf("%d",$2-$3)}'`
if ["${avail}" -lt "${fwUpdateSpace}"]; then
        error="failed 201 \"not enough space on device for upgrade\""
        echo ${error} > /tmp/fw_update_status
        echo ${error}
        exit 1
fi

# ITR No. 34229 Abstract: 3.5G allows down rev code to be applied from file
version_current=`cat /etc/version | tr -d .-`
version_newfile=`dpkg -f ${filename} Version`
version_newfile=`echo ${version_newfile} | tr -d .-`
echo "version_newfile=$version_newfile"
echo "version_current=$version_current"
package_newfile=`dpkg -f ${filename} Package`
echo "package_newfile=$package_newfile"
echo "master_package_name=$master_package_name"

if ["${master_package_name}" != "${package_newfile}"] || ["${version_newfile}" -lt "${version_current}"]; then
        error="failed 200 \"invalid firmware package\""
        echo ${error} > /tmp/fw_update_status
        echo "Error: $0 (${filename}) version ($version_newfile) is less than current system version ($version_current)"
        echo "Error: $0 (${filename}) version ($version_newfile) is less than current system version ($version_current)" | logger
        exit 1
fi

old_color=`cat /usr/local/nas/led_color`
echo white > /usr/local/nas/led_color
#upgrade
dpkg -i ${filename} 2>&1 | tee ${updatelog} > /dev/null
status=$?

# remove update files
rm -f /CacheVolume/*.deb

cat ${updatelog} | grep -q "not a debian format archive"
if [$? -eq 0]; then
        error="failed 200 \"invalid firmware package\""
        echo ${error} > /tmp/fw_update_status
        echo ${error}
        restoreRaid
        if ["$old_color" == "red"]; then
            echo "red" > /usr/local/nas/led_color
        else
            echo "green" > /usr/local/nas/led_color
        fi
        exit 1
fi
if [${status} -ne 0]; then
        echo "dkpg exited with non-zero status: ${status}"
        error="Update failed. Check ${updatelog} for details."
        echo ${error} > /tmp/fw_update_status
        echo ${error}
        restoreRaid
        if ["$old_color" == "red"]; then
                echo "red" > /usr/local/nas/led_color
        else
                echo "green" > /usr/local/nas/led_color
        fi
fi

#---------------------
# End Script
#---------------------
# Copy stdout to script log also
} | tee -a ${SYSTEM_SCRIPTS_LOG}
# Output script log end info
{
echo "End:$?: `basename $0` `date`"
echo ""
} >> ${SYSTEM_SCRIPTS_LOG}

exit ${status}
1 Like

That works. Thanks.

Thanks, this updateFirmwareFromFile.sh finally worked. It was really crashing slowly. I back up most configuration files, and had the firmware downloaded, suddenly  I could no longer get in withscp, only putty. But I was ready!

After it said it was going to reboot, the MBL blinked green for app 1/2 hour. I just left it alone, and it finally went solid, and I was back in to the MBL web setup.

Thanks!

As soon as the green LED shows the MBL is ready.  I guess for half an hour it was rebuilding its media databases.

For me that all doesn’t work. I purchased the MBL round about 6 Month ago. Everything works fine, even with all Updates. But the update that should fix the problems i read from in this forum beginns just in this moment. 

There is no more webinterface (Only the help files are still there). As I had SSH enabled i tried to reinstall the newest firmware. No way.

Please fix the problem. That could not be so difficult…

I have MBL connected to an Imac computer and have not found any solutions for a Mac setup. I note that you have posted regularly and have found solutions for several ohters. I’m not a computer geek so I’m not sure I can manage the hi-tech stuff you have posted for others, but I’m willing to give it a try if you have a suggestion how to get my MLB back online. Like others, it has just quit and I only see a solid yellow light after turning the unit on and then on again.

This is my second MBL, my earlier version was purchased in 2008, but quit and I bought a new one a few months ago, whcih worked well until last week. I have no idea what could have happened, but I suspect it must have done an automatic update in firmware (is this possible?)

Any suggestions you have would be appreciated. I really don’t want to return the unit as I lve in Northern Thailand, quite a distance from where I purchased the unit in Bangkok.

On the previous firmware release there was a problem with Mac computers accessing the MBL. A log file can explode in size, fill-up the system partition and cause havoc.  If you get a new MBL or get one by R.M.A. then make sire it’s got the latest revision of the firmware, which is 02.11.09-053.

If you have SSH enabled then there may be solution to get it back and working.

I am not a Apple Mac expert.  Far from it.  The Mac causes the MBL to throw up a specific CNID error.