It is no secret that at this time the presence of several computers at home and other devices working with the network in one way or another (phones, televisions, iptv-set-top boxes, media players, etc) has become for many things the norm. Usually, in this case, all such hardware is connected to the network with a general Internet connection. The question arises about some kind of general storage of information, in the role of which a permanently turned on computer, a router with an external disk or a specialized device usually acts. In general, a NAS is organized in any way, on which family and personal photos, favorite music, films, and many other things already live. How exactly NAS is organized is a matter of personal choice of everyone. For example, I purchased
WD My Book Live on 2TB, about which I will lead the further story.
After reading a few reviews of this device, I found out that “inside” is a full-fledged Debian Linux with the ability to access via ssh. My joy knew no bounds - not only do I get 2TB of network storage mod my modest needs, so there is still an opportunity to expand the factory functionality, for example, put a web server there, raise my Internet radio, well, everything that comes to mind and implemented in linux. As a last resort - to collect or write the necessary program most.
Reality, as usual, broke the next pair of rose-colored glasses. To begin with, what's inside is Linux. Debian 5 Lenny (which is already oldstable). It cannot be updated, since the support for the SoC iron on which the device itself is implemented may fall off. Installing the programs I needed was also quite problematic - some of them are either still missing in Debian 5, or have so old versions that I don’t need any functionality, or they simply don’t install because the package manager cannot install the dependencies they need without destroying the running system.
The result of the “autopsy” turned out to be sad, of course, but not lethal - it's Linux, in it you can solve the same problem in different ways. My next step was to create a backup copy of the current firmware, so that my experiments would not lead to a software "death" of the device and a trip to the SC, which in my city, it seems, does not exist at all ...
')
Having tormented the search engines, I came across an
instruction for backing up a backup copy , the main part of which is given here:
1) Get ssh access
http: // <IP-OF-YOUR-MYBOOK> / UI / ssh - enter the url by hand, there are no links in the interface
2) Go through PuTTY to the device
user = root
password = welc0me
(Of course, you should change the password to your own, with the passwd command)
3) Save the MBR and information about the free space at the beginning of the device disk (save quickly, the archive size is 440 bytes):
dd if=/dev/sda bs=15728640 count=1 | bzip2 > /DataVolume/shares/Public/SDA_MBR_FREESPACE.bz2
4) Save the partitions (there are two of them, since the soft-raid is used) with the current firmware, I warn you, the process is long:
dd if=/dev/sda1 | bzip2 > /DataVolume/shares/Public/SDA1_IMA.bz2 dd if=/dev/sda2 | bzip2 > /DataVolume/shares/Public/SDA2_IMA.bz2
Must give something like:
1 - SDA1_IMA.bz2 file:
3999744 + 0 records in
3999744 + 0 records out
2047868928 bytes (2.0 GB) copied, 2212.34 s, 926 kB / s
filesize = 595MB
2 - SDA2_IMA.bz2:
3999744 + 0 records in
3999744 + 0 records out
2047868928 bytes (2.0 GB) copied, 1914.37 s, 1.1 MB / s
5) We merge the received archives on your computer or in another safe place ...
So, the backup copy is made and saved on another medium, we will continue.
On the site with the backup instruction I
came across the mention of Optware , but mpd from there did not want to work in the broadcast mode, although htop and mc were installed and earned correctly. Optware seemed to me clearly not enough. I wanted more.
Instructions for auto-installation of various feature-packs I, for some reason, frankly did not like. Probably by adding an abundance of various web configurators, in which I did not see the need. At that moment, a thought came to my rather tired head, after which I felt wildly ashamed of the fact that I sometimes consider myself to be a Linux user - chroot.
Chroot with a full system inside will allow me to run everything in the repository of the selected distribution! With a grief in half (for some reason, the Lenny repositories were unstable, and then they stopped giving out the list of packages altogether) I installed
debootstrap , with which I installed normal Debian (testing - in pursuit of "fresh" versions), I wrote scripts that mounted my balls are inside the chrut and they run the services I need.
It seems to be all right and I can calm down, but then I remembered that updating the firmware completely erases the entire system partition and destroy all my crutches and supports. Well, everything I did was transferred to the data section and mounted to the working system via mount --bind, another script was written that returned all the settings to the site, since the firmware update did not remove ssh access.
Thinking that other owners of similar glands could have the same problems, I
laid out my creation on googlecode with the possibility of easy installation. Maybe someone will come in handy, although still damp, of course.