来吧兄弟,一起玩一起讨论!
您需要 登录 才可以下载或查看,没有账号?注册
×
本帖最后由 lionor 于 2012-8-20 18:39 编辑
刚刚在 京东买的希捷 goflex home ,2TB, NAS, 很帅。998人民币,性价比极高,,1.2GHz ARM,128M RAM. 最爽的是还有usb.... 可以接*****头,硬盘,打印机等。
比西数的那个性价比高多了!!!
今天在折腾,分享如下:
第一步 root
Getting started - with Windows XP/Vista/7
If you're doing all this from a windows computer:
First download PUTTY.exe (an SSH client) from http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html Instead of entering all the above in one line, run Putty and connect to the IP of your Stora on port 22, then enter the username and password separately when prompted exactly as explained above (i.e. USERNAME_hipserv2_netgear_XXXX-XXXX-XXXX-XXXX). You can save the settings in putty so you don't have to type the username every time (look under Connection > Data > Auto-login username)
After logging in everything works the same as a Linux SSH client, you can do everything from windows if you want!
Notes
The "hipserv2_netgear" part may be different for some users, although I suppose is the same for everybody, if you already hacked your Stora using other ways I'd ask you to check the "/etc/oe-release" and post here the DistName line and we'll try to figure it out. (see also: Original forum post)
For Seagate GoFlex Home use seagateplug, e.g.:
ssh USERNAME_hipserv2_seagateplug_XXXX-XXXX-XXXX-XXXX@YOUR_IP_ADDRESS
第二部安装 package manager
Introduction
A package manager, for the uninitiated is a way of installing and maintaining software on a computer system. In the context of the stora, it allows you to easily download, install and update programs. It will also remove programs that you no longer want.
The package manager we're going to use is called Optware which was originally created for NSLU2 and it allows you to install additional software on your stora without interfering with original firmware. The Optware project supports several architectures including that of the stora and the repository (where the package manager downloads everything from) we're going to use seems to work quite nicely with the stora.
It's worth noting that certain programs have caused a few problems, although that was from a different repository that's less compatible. See the forum thread here for more details.
How to install
Preparatory Stuff
In order to install optware we're going to need to do a few preparatory things first.
Logging In
If you haven't looked at this already, you'll first of all need to log into the Stora via ssh[1]. What is also worth doing is installing the official OpenSSH server which works better and doesn't require such a long username[2].
Moving /opt to the hard disk
NAND flash memory has a limited number of reads and writes, and this is what the firmware of the stora is saved on. Seeing as the usage of a package manager will increase the amount of wear and tear on the card, we're going to move /opt which is where all the programs used by the package manager will be stored to the hard disk.
Firstly we need to create persistent root access:
1. sudo -E -s
Next, we need to copy the contents of the old opt directory to the new location. In this example I've put the opt folder in home (/home/opt).
1. cd /
2. cp -r /opt /home/opt
All going well, the contents of /opt should now be copied to /home/opt. The next thing to do is to create a symbolic link in the root directory to the new folder so that everything that is written to opt is stored on the hard disk.
1. mv opt opt-old
2. ln -s /home/opt /opt
With that done we're now ready to actually install Optware and most importantly, it's lovely package manager, ipkg.
Installing Optware
First, we're going to create a folder in your home directory to download ipkg to, and then download it.
2. cd ~
3. mkdir ipkg
4. cd ipkg
5. wget http://ipkg.nslu2-linux.org/feed ... 0.99.163-10_arm.ipk
You should see some stuff downloading. Now we're going to unpack the files we need:
6. tar -xzf ipkg-opt_0.99.163-10_arm.ipk
7. cp ./data.tar.gz /data.tar.gz
8. cd /
9. tar -xzf data.tar.gz
10. rm data.tar.gz
Now we're going to set up and install ipkg:
11. echo src cs08q1armel http://ipkg.nslu2-linux.org/feed ... 1armel/cross/stable >> /opt/etc/ipkg.conf
12. /opt/bin/ipkg update
All going well, you should see this:
Downloading http://ipkg.nslu2-linux.org/feed ... oss/stable/Packages
Updated list of available packages in /opt/lib/ipkg/lists/cs08q1armel
Successfully terminated.
NB If you want to live more dangerously and/or need newer packages, you could use the unstable branch of ipkg instead. To do so simply replace "stable" with "unstable" in steps 5 and 11 above:
5. wget http://ipkg.nslu2-linux.org/feed ... 0.99.163-10_arm.ipk
and
11. echo src cs08q1armel http://ipkg.nslu2-linux.org/feed ... rmel/cross/unstable >> /opt/etc/ipkg.conf
Optional Extra Steps
These extra steps aren't necessary but for me at least, are quite handy.
Installing Nano
This step is strictly optional but if you're not a fan of vi then nano is a much more straightforward text editor to use and will come in handy for editing lots of configuration files. Note: If you have logged out since installing ipkg, then you will need to use sudo to execute the commands as root.
1. /opt/bin/ipkg install nano
All going well, nano should now be installed.
Editing the PATH variable
When I did this, the 'environment' file which is where you store the environment variable was empty. You can check this for yourself by doing the following:
1. sudo /opt/bin/nano /etc/environment
If the file is empty
If you don't edit the PATH variable then you will have to enter the full path of the executable you want to run every time you run it. The PATH variable is held in /etc/environment and when I looked that file was empty. First, you need to do copy the text below:
PATH=/usr/local/bin:/usr/bin:/bin:/opt/bin:/usr/sbin:/opt/sbin:/usr/sbin:/sbin
Copy the above to your clipboard (sometimes its helpful to paste into a text file on your PC first to make sure the line is clean, then select and copy from there) With /etc/environment open in Nano, Ctrl+0 to paste the above text into the file, Ctrl+X to exit, Y to save and confirm filename
Now (or when you open a new SSH session), you will be able to type program names e.g. "nano", without the path, and your Stora will be able to find them for you.
If the file is not empty
If the file is not empty all you need to do is to add this directory to the end of the PATH variable.
/opt/bin:/opt/sbin
Whether the PATH variable is there or not, you'll need to log out and log back in again once you've finished editing the PATH settings. If that doesn't work, you'll need to reboot which you can do by entering the following command. You can do this via ssh by entering the command:
sudo reboot
After all that you should have a working Optware install and should be easily able to execute any programs you install.
Root user path
If you want to be able to switch to a root user with sudo -i, for example, then you'll find the root user gets their PATH variable munged!
Seems like it promotes the 'sbin' paths ahead of the 'bin' paths. For me it had the effect of removing the /opt/sbin and /opt/bin entries.
I hacked the munging script directly with:
sudo -i
/opt/bin/nano /etc/profile
Then edited this section to read:
# Path manipulation
if [ "$EUID" = "0" ]; then
pathmunge /opt/bin
pathmunge /sbin
pathmunge /opt/sbin
pathmunge /usr/sbin
pathmunge /usr/local/sbin
fi
Now when I switch to root user I still have a sane PATH to nano.
Enjoy!
Original article by guestus.
ORIGINAL FORUM POST: here
How to uninstall
Uninstall a package
As space and memory on the Stora is quite limited then you might want to uninstall a package, like so:
sudo ipkg remove [package name]
Uninstall the package manager
First you have to unmount the /opt folder that was created on the hard drives
umount /media/[path]/opt
rm -rf /media/[path]/opt
Then delete the package manager
rm -rf /usr/lib/ipkg
第三部,哈哈,终于可以自动安装 软件啦!!!
取得root权限 然后,
bash-3.2# /opt/bin/ipkg install transmission
Installing transmission (2.61-1) to root...
Downloading http://ipkg.nslu2-linux.org/feed ... sion_2.61-1_arm.ipk
Installing openssl (0.9.8v-2) to root...
Downloading http://ipkg.nslu2-linux.org/feed ... sl_0.9.8v-2_arm.ipk
Installing libcurl (7.24.0-1) to root...
Downloading http://ipkg.nslu2-linux.org/feed ... rl_7.24.0-1_arm.ipk
Installing zlib (1.2.5-1) to root...
Downloading http://ipkg.nslu2-linux.org/feed ... lib_1.2.5-1_arm.ipk
Installing libevent (2.0.19-1) to root...
Downloading http://ipkg.nslu2-linux.org/feed ... nt_2.0.19-1_arm.ipk
Configuring libcurl
Configuring libevent
Configuring openssl
Configuring transmission
Configuring zlib
Successfully terminated.
bash-3.2#
至此最新的2.61安装完毕!!!
秀一下吧:自动监控,自动限速(晚上在家限速的200k)见图
汗死,nas1上传图片总是出错,无语了。。。
今天还测试了下读写速度,环境如下:千兆路由+450兆无线。
goflex是用的千兆连的路由,电脑是450兆无线连的路由,
读取速度在26-28兆,写入速度为23-25兆。非常满意。如果用千兆连电脑估计还要快很多!
真是神器。性价比太高了。
过几天再测试外接usb的功能。
|