Category:Network Space 2
From NAS-Central Lacie Wiki
| CPU | Processor : ARM926EJ-S rev 1 (v5l)
BogoMIPS : 799.53 |
| RAM | 256 MB |
Contents |
cat /proc/cpuinfo
Processor : ARM926EJ-S rev 1 (v5l) BogoMIPS : 799.53 Features : swp half thumb fastmult edsp CPU implementer : 0x56 CPU architecture: 5TE CPU variant : 0x2 CPU part : 0x131 CPU revision : 1 Cache type : write-back Cache clean : cp15 c7 ops Cache lockdown : format C Cache format : Harvard I size : 16384 I assoc : 4 I line length : 32 I sets : 128 D size : 16384 D assoc : 4 D line length : 32 D sets : 128 Hardware : netspace_v2 Revision : 0000 Serial : 0000000000000000
cat /proc/meminfo
MemTotal: 256892 kB MemFree: 141860 kB Buffers: 19328 kB Cached: 49624 kB SwapCached: 0 kB Active: 42392 kB Inactive: 51908 kB SwapTotal: 256968 kB SwapFree: 256968 kB Dirty: 60 kB Writeback: 0 kB AnonPages: 25372 kB Mapped: 13664 kB Slab: 16844 kB SReclaimable: 6936 kB SUnreclaim: 9908 kB PageTables: 744 kB NFS_Unstable: 0 kB Bounce: 0 kB CommitLimit: 385412 kB Committed_AS: 195700 kB VmallocTotal: 385024 kB VmallocUsed: 16780 kB VmallocChunk: 360444 kB
cat /proc/partitions
major minor #blocks name 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 31 0 512 mtdblock0 7 32 134217732 loop1 7 33 134217712 loop1p1
cat /proc/mounts
rootfs / rootfs rw 0 0 /dev/sda7 /oldroot ext3 ro,data=ordered 0 0 none /oldroot/proc proc rw 0 0 none /oldroot/sys sysfs rw 0 0 udev /oldroot/dev tmpfs rw 0 0 devpts /oldroot/dev/pts devpts rw 0 0 none /oldroot/dev/shm tmpfs rw 0 0 /dev/sda8 /oldroot/var/original ext3 ro,data=ordered 0 0 /dev/sda9 /oldroot/snapshots ext3 rw,data=ordered 0 0 unionfs / unionfs rw,dirs=/oldroot/snapshots/snaps/00=rw:/oldroot/var/original=ro 0 0 proc /proc proc rw 0 0 sys /sys sysfs rw 0 0 /dev/sda9 /var ext3 rw,data=ordered 0 0 udev /dev tmpfs rw 0 0 /dev/sda9 /tmp ext3 rw,data=ordered 0 0 usbfs /proc/bus/usb usbfs rw 0 0 /dev/sda2 /media/internal_6 xfs rw,nosuid,nodev,usrquota,prjquota 0 0 /dev/sda2 /lacie/tmp xfs rw,nosuid,nodev,usrquota,prjquota 0 0 /dev/sda2 /lacie/var xfs rw,nosuid,nodev,usrquota,prjquota 0 0 /dev/sda2 /lacie/torrent_dir xfs rw,nosuid,nodev,usrquota,prjquota 0 0 /dev/sda2 /lacie/afp_db xfs rw,nosuid,nodev,usrquota,prjquota 0 0 /dev/loop1p1 /media/external_usb_9 vfat rw,nosuid,nodev,fmask=0000,dmask=0000,codepage=cp437,iocharset=iso8859-1 0 0 /dev/sda2 /shares/MyShare xfs rw,nosuid,nodev,usrquota,prjquota 0 0 /dev/sda2 /shares/OpenShare xfs rw,nosuid,nodev,usrquota,prjquota 0 0 /dev/loop1p1 /shares/USBShare vfat rw,nosuid,nodev,fmask=0000,dmask=0000,codepage=cp437,iocharset=iso8859-1 0 0
cat /proc/filesystems
nodev sysfs nodev rootfs nodev bdev nodev proc nodev debugfs nodev sockfs nodev pipefs nodev anon_inodefs nodev futexfs nodev tmpfs nodev inotifyfs nodev devpts ext3 ext2 nodev ramfs nodev unionfs xfs nodev usbfs vfat
Enabling SSH with disassembling
NOTE: One screw of the hard disk is protected by a label "Warranty void if seal broken"
NOTE: it is now not longer necessary to dissassemble the device to gain remote access through ssh. "See Enabling SSH without disassembling"
The black cover can be removed from the device. On the front side of the device (check the blue LED) the cover is locked with one tab in the middle. Carefully push away the middle of the cover and lift only the front side. When it comes off, shift it a little to the back and you can safely remove the whole cover.
Now you can unscrew the hard disk (watch the warranty label) and attach it to your computer. Your computer has to be running Linux or you can boot a LiveCD like Knoppix.
/dev/sdb2 is the one carrying your data. It is XFS formatted.
/dev/sdb8 contains the most important files like executables and system configuration files. This ext3 filesystem is mounted read-only during normal operation.
/dev/sdb9 contains your configuration files. This ext3 filesystem is mounted read-write during normal operation.
You can't mount /dev/sdb8 as easily as the other two partitions:
# mount /dev/sdb8 [your_mountpoint] mount: unknown filesystem type 'linux_raid_member'
You will have to specify some extra parameters:
mount -t ext3 /dev/sdb8 [your_mountpoint] -o rw,data=ordered
The setup of the Network Space 2 is quite similar to the Lacie D2 Network. You can enable ssh by removing the comment # from the file:
[your_mountpoint]/etc/initng/runlevel/default.runlevel
Since you don't know the root password, you can add your ssh public key to [your_mountpoint]/root/.ssh/autorized_keys.
After saving the files and unmounting the hard disk, you can put it back into the device. After the device is powered on, you can connect with ssh and your ssh private key. Now it is possible to change the root password, so you can connect from every other PC as root.
Since the changes were made on the read-only file system, the changes are kept after a factory default reset. Only the root password will be reset, so it is worth trying to change the shadow file on /dev/sdb8 too. Else you can only log in with you ssh key.
Enabling SSH without disassembling
Use the following script to enable the ssh daemon and add your public key to the authorized_keys file.
<?php
/******************************************************
* Enable SSH root access on Lacie Network Space 2 (v1.0.2 & v1.2.5)
*
* - Use puttygen to create a public/private key pair
* - Save the public and private key to your computer
* - Copy the key from the puttygen box "Public key for pasting into OpenSSH authorized_keys file"
* - Paste the key into this script in the $sshkey variable below.
* - Save this script (call it ssh.php) to the OpenShare of your Network Space 2 (\\<IP Address of NetworkSpace2>\OpenShare)
* - Open a brower and point it to the following URL:
* http://<IP Address of NetworkSpace2>/webdav/OpenShare/ssh.php
* - Restart the Network Space 2
* - Tell PuTTY to use your private key to connect to the Network Space 2
* - You should be able to log in as root
*
******************************************************/
$sshkey=''; // Paste your key here. It starts with ssh-rsa (or ssh-dss) and ends with your "Key comment"
/******************************************************
// No changes needed below this line
******************************************************/
if (empty($sshkey)) {
die("Please paste your public key into this script!!");
}
$runlevelpath = '/etc/initng/runlevel/default.runlevel';
$authorizedkeyspath = '/root/.ssh/authorized_keys';
$initngfile = file ($runlevelpath, FILE_IGNORE_NEW_LINES);
if (in_array('sshd',$initngfile)) {
echo "SSH already enabled<br/>";
} else {
echo "Enabling SSH Access<br/>";
$fh = fopen($runlevelpath, 'a');
fwrite($fh, "sshd\n");
fclose($fh);
}
if (!is_dir('/root/.ssh')) {
echo "Creating directory /root/.ssh<br/>";
mkdir('/root/.ssh');
}
if (file_exists($authorizedkeyspath)) {
$authkeys = file('/root/.ssh/authorized_keys', FILE_IGNORE_NEW_LINES);
} else {
$authkeys = Array(); //suppress warning
}
if (!in_array($sshkey,$authkeys)) {
echo "Adding your public key to /root/.ssh/authorized_keys<br/>";
$fh = fopen('/root/.ssh/authorized_keys', 'a');
fwrite($fh, $sshkey."\n");
fclose($fh);
} else {
echo "Your public key is already in /root/.ssh/authorized_keys<br/>";
}
echo "Please restart your device";
?>
This category currently contains no pages or media.


