Prerequisites for Hacking the HP MediaVault

By Peter Michael Bruun


See also: My Family Home

Overview of my MediaVault pages:

Note that the information given here, simply reports my experience with the mv5020. I have no experience with other models of HP MediaVault than the mv5020.

I provide no warranty, and you should proceed at your own risk. A risk, which is true and real - as stated below.

Before you start: BE WARNED

This page describes my personal experience with the HP MediaVault, and implies no liability and no endorsement or support by HP, whatsoever.

Following these instructions is likely to void any warranty on the HP MediaVault.

Following these instructions are highly likely make your HP MediaVault completely and utterly unresponsive and cause loss of data. This is known as "bricking" the MediaVault.

If (or when) this happens to you, there are three things you can do:

You can download the "HP MediaVault Firmware Recovery Utility" and the accompanying firmware from HP. At the time of writing that is version You may want to check for newer versions by going to the HP website, find the "Support & Drivers" tab, and search for "mv5020". This should bring you a page with the latest downloads. (You may need to select the version of the Windows operating system, on which you are going to run the recovery tool.)

Unfortunately, the recovery-utility will reset the contents of the disks to factory default: Empty.

In other words: The recovery-utility WILL WIPE ALL YOUR FILES FROM THE MediaVault DISK(S).

Lee Devlin has located a version of the image, which should be able to restore the firmware without cleaning the disks, but I have not yet heard of anyone using it. You can find the instructions and the modified image here.

Another warning: When I had the opportunity to try out the recovery tool, it failed in varying ways 9 out of 10 times - and each attempt took at least 30 minutes. However, don't give up: Suddenly, randomly, the blue light turns on, and you are up-and-running again - time to restore your backup of your disk contents (which you have - right?).

Skills you may need

In order to hack you MediaVault, you may need som basic skills that could take some time to acquire:


Before you begin, consider these items:

Finding your way around the MediaVault

Use the ssh login and locate (use cd and ls) the following directories on the MediaVault:

/Root directory - this is where you are at login
/binLinux executables directory.
/usr/binMore Linux executables.
/usr/htdocsThe root directory for the Apache webserver. This is where web-pages are served from - except JSPs.
/usr/jetty-5.1.12/webapps/WebshareThis is where JSP pages are located. This is for experts only, so if you don't already know your way around a J2EE directory structure, stay away from this place.
/etcStandard Linux configuration files. Your Apache webserver httpd.conf file is here, but it will be overwritten at boot-up.
/etc/incMediaVault boot-scripts. These are very fragile, so handle with care. Any mistake, and you have a "brick". You will, however, be hacking the file and possibly also and
/shareMediaVault disk(s). The above directories are all on the firmware file-system, whereas the /share directories are on the real hard-drive(s).
/share/1000Here you find the virtual disks (Samba mount-points): Documents, Backup, etc. that you can see from Windows.
/share/1000/DocumentsThe mv5020 does not sport an ftp server, so create a directory here for file-transfers between Windows and MV.
/share/1000/Documents/webThis is what I happened to call my transfer directory. You could also create and mount a new shared directory using the standard GUI for the MediaVault
/share/1000/postgresThis is where the PostgreSQL database resides. It is not mounted on Samba. I don't think you can, and I wouldn't like to try.
/share/1000/postgres/dataIf you need access to the PostgreSQL database on the MediaVault from Windows, you need to customize the pg_hba.conf file here.

Editing Linux files on Windows

You can do that directly on the MediaVault using the vi-editor. It works if you have the terminal settings right, and if you fixed the TTY bug as explained above.

Personally, I am not fond of vi, so if you are like me, you may want to transfer the file to Windows, edit it there, and then move it back to the original location. However, you must take care, because there is a subtle difference between text-files on Linux and Windows.

On Windows, all lines must end with two characters (bytes) named CR and LF, whereas on Linux, lines must end in the CR byte only.

(Aside: CR means CarriageReturn, and LF means LineFeed. When I was a kid, the Teletype terminals were basically remote-controlled typewriters. Moving the type-head back to the beginning of the line was a CR operation, whereas advancing the paper by one line was a LF operation. Doing just the LF was good fun - you could create all sorts of interesting effects by typing several lines on top of eachother).

Some Windows tools, such as Wordpad (C:\Program Files\Windows NT\Accessories\wordpad.exe) can interpret Linux files correctly, but will write files back containing CR-LF sequences. Other Windows tools, such as Notepad cannot correcly display Linux files.

Conversely, some Linux tools can interpret Windows files correctly, whereas others will fail due to the unexpected LF characters inserted by Windows tools.

So this is what you do, if you want to edit a file from the MediaVault from Windows:

Valid HTML 4.01 Transitional