📜 ⬆️ ⬇️

Restoring the "killed" LaCie Network Space 2 without removing the HDD

image
In this article I will describe the entire process of restoring LaCie Network Space 2 (hereinafter - NS2 ) without directly removing the hard drive from the device.

Prehistory

I bought this device in the summer of this year and used it as a rocking torrent and network file sharing service. When the torrents in the list accumulated quite a lot (about 100+), Download Machine (the utility for downloading torrents and other files) began to work unstable and in the end a couple of days the device stopped loading at all, the reason remained unclear to me. As far as I understand, 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 painful waiting for answers to my questions in various forums and in IRC, I finally found a solution to this problem here .

Recovery process

To restore the device you will need a computer with Linux OS on board. Mac OS X is not suitable because it lacks the necessary library for compiling. I do not exclude that it is possible to properly 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 network booting. In both cases, there is no need to disassemble the case of the device - this is a definite plus, warranty seals remain in place. All my attempts to boot the system with the only free USB flash drive failed, the device did not want to recognize my device. Therefore, I decided to follow the difficult path of loading the system through the network. Debian ARM is used as an alternative distribution for downloading. You also need a CLUNC client to access the console of the device.
')
TFTPD configuration

Network booting is performed using the TFTP service, so if it is not in the system, it must be installed and configured. Next, I give an example for Ubuntu:

The TFTP service is configured and running.

CLUNC installation

To access the NS2 console, we need a CLUNC client. It will be necessary to compile the sources of the distributive downloaded and unzipped earlier. To do this, in the root directory CLUNC need to run the command make. The compiled binary is in the build / folder under the name clunc-open. It should be moved to the CLUNC root folder. This completes the installation and you can proceed directly to restoring the device. Example installation code:
 $ 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 Alternative Distribution

If CLUNC is successfully installed, you need to connect to the NS2 console. The device must be turned off while entering the following command ($ {NAS_IP} - device IP):
 $ ./clunc -i ${NAS_IP} -w 60 

After entering the command in the terminal, you should connect the device power, after which we get to the NS2 console. We need to configure the distribution boot. I used the following parameters:
 Marvell>> setenv bootargs ip=dhcp netconsole=6666@${ipaddr}/,6666@${serverip}/ root=/dev/sda2 rootwait; 

$ {ipaddr} - IP device, $ {serverip} - IP of the machine from 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 which ip address will be assigned to the device after booting:
 $ 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 machine configuration.
Now enter the command to start the system:
 Marvell>> bootm; 


NS2 System Restore

The device is running, you need to access it through telnet:
 $ telnet ${new_nas_ip} Trying ${new_nas_ip}... Negotiating binary mode on output. Connected to ${new_nas_ip}. Escape character is '^]'. 

The new IP address is taken from the dhcpdump utility dump, or it can be viewed in the kernel boot log during the startup of the DHCP client.
Then you need to enter as root login and find out the name of the disk (in my case - / dev / sda, as can be seen 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 the name of the disk, we can load the master boot record:
 # wget http://downloads.lacie.nas-central.org/Users/Mijzelf/Networkspace2/1.0.2/mbr 

I carried out further actions manually, however later I found a ready script for reformatting the hard disk of the device, 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, it remains only to cross your fingers and hope that everything went well, we send the device to the reboot:
 miniroot ~ # reboot miniroot ~ # Connection closed by foreign host. 


Conclusion

After the reboot, we try to access the web interface of the device by IP. In case of a successful operation, we are met with a login and password entry field, it remains only to congratulate each other on the revival of the device. The data stored on the disk, in the process did not suffer, so it is quite a humane way to restore the system, leaving no trace of interference.
image

Useful resources:

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

Source: https://habr.com/ru/post/132909/


All Articles