
Recovering a “killed” LaCie Network Space 2 without removing the HDD

In this article, I will describe the entire recovery process of LaCie Network Space 2 (hereinafter - NS2 ) without removing the hard drive directly from the device.
Background
I bought this device in the summer of this year and used it as a rocking torrent and network file sharing. When there were a lot of torrents in the list (about 100+), Download Machine (a utility for downloading torrents and other files) began to work unstably and in the end a couple of days later the device stopped loading at all, the reason remained unclear to me. As I understand it, LaCie devices are not officially supported in Russia, at least they don’t have a website in Russian, so I decided to try to figure out what was wrong with NS2, on my own. After a long search and painfully waiting for answers to my questions in various forums and in the IRC, I finally found a solution to this problem here .
Recovery process
To restore the device, you need a Linux computer on board. Mac OS X will not work, because it lacks the libraries necessary for compilation. I do not exclude that it is possible to correctly assemble the necessary package under it, but it is not worth the time spent. I used Ubuntu 11.10. NS2 supports booting the system from external media through the front USB port, as well as booting from the network. In both cases, there is no need to disassemble the device case - this is an unambiguous plus, warranty seals remain in place. All my attempts to boot the system from a single free USB flash drive were unsuccessful, the device did not want to recognize my device. Therefore, I decided to go along the difficult path of loading the system through the network. Debian ARM used as an alternative distribution for download. You will also need CLUNC - a client to access the device’s console.
TFTPD Configuration
Download over the network using the TFTP service, therefore, if it is not in the system, it must be installed and configured. The following is an example for Ubuntu:
- Install tftpd
$ sudo apt-get install xinetd tftpd tftp
- Create a configuration file:
$ nano /etc/xinetd.d/tftp
File Contents:service tftp { protocol = udp port = 69 socket_type = dgram wait = yes user = nobody server = /usr/sbin/in.tftpd server_args = /tftpboot disable = no }
- We create a directory in which the necessary files will lie
$ sudo mkdir /tftpboot $ sudo chmod -R 777 /tftpboot $ sudo chown -R nobody /tftpboot
- We start tftpd
$ sudo /etc/init.d/xinetd start
The TFTP service is configured and started.
Install CLUNC
To access the NS2 console, we need the CLUNC client. You will need to compile the sources of the downloaded and unzipped distribution earlier. To do this, you must run the make command in the CLUNC root directory. The compiled binary is in the build / folder under the name clunc-open. Move it to the root of the CLUNC folder. This completes the installation and you can proceed directly to the restoration of the device. Installation code example:
$ wget ftp://lacie-nas.org/tools/clunc-1.1.tar.gz
$ tar xvzf clunc-1.1.tar.gz
$ cd clunc-1.1/
$ make
$ cp build/clunc-open ~/clunc-1.1/
Download Alternate Distribution
If the CLUNC installation is successful, you must connect to the NS2 console. The device must be turned off while entering the following command ($ {NAS_IP} - IP device):
$ ./clunc -i ${NAS_IP} -w 60
After entering the command in the terminal, connect the device power, after which we get to the NS2 console. We need to configure the distribution download. I used the following options:
Marvell>> setenv bootargs ip=dhcp netconsole=6666@${ipaddr}/,6666@${serverip}/ root=/dev/sda2 rootwait;
$ {ipaddr} - IP of the device, $ {serverip} - IP of the machine with which we go to the console of the device.
Next, you need to download the distribution from the TFTP server, which we previously raised on our machine:
Marvell>> tftpboot 0x800000 uImage;
After that, you need to run the dhcpdump utility on the machine in a separate tab of the terminal in case you do not know what IP address will be assigned to the device after boot:
$ dhcpdump -i ${имя_интерфейса}
The interface name is usually wlan0 for the wireless network and eth0 for the Ethernet connection, but options are possible depending on the configuration of the machine.
Now enter the command to start the system:
Marvell>> bootm;
NS2 System Recovery
The device is running, you need to go to it via telnet:
$ telnet ${new_nas_ip}
Trying ${new_nas_ip}...
Negotiating binary mode on output.
Connected to ${new_nas_ip}.
Escape character is '^]'.
We take the new IP address from the dump of the dhcpdump utility, or you can see it in the kernel boot log during the start of the DHCP client.
Then you need to enter root as the login and find out the name of the disk (in my case - / dev / sda, as you can see from the log):
miniroot login: root
BusyBox v1.15.3 (2011-02-28 00:41:01 CET) built-in shell (ash)
Enter 'help' for a list of built-in commands.
miniroot ~ # cat /proc/partitions
major minor #blocks name
31 0 512 mtdblock0
8 0 976762584 sda
8 1 1 sda1
8 2 974751907 sda2
8 5 256977 sda5
8 6 8001 sda6
8 7 8001 sda7
8 8 851413 sda8
8 9 875511 sda9
8 10 8001 sda10
9 0 7936 md0
Having found out the name of the disk, we can load the main boot record:
# wget http://downloads.lacie.nas-central.org/Users/Mijzelf/Networkspace2/1.0.2/mbr
I carried out further actions manually, but later I found a ready-made script for reformatting the device’s hard disk, therefore I will give a way to launch it and a link to the script here :
# wget http://01110.ru/files/reformat_ns2
./reformat_ns2 ${имя_диска} # WARNING: use the correct partition here!
After that, you just have to cross your fingers and hope that everything went well, send the device to reboot:
miniroot ~ # reboot
miniroot ~ # Connection closed by foreign host.
Conclusion
After rebooting, we try to go to the device’s web interface over IP. In case of a successful operation, we are greeted with a login and password input field, we can only congratulate each other on the revival of the device. The data stored on the disk did not suffer in the process, so this is a completely humane way to restore the system, leaving no evidence of interference.

Useful resources:
LaCie-NAS
NAS-Central
http://www.davidsudjiman.info