Low power Debian file server over Wifi -- Cubieboard1 and a 128Gb SSD
LoopyByteloose
Posts: 12,537
I went window shopping today for a Gigabyte BRIX in Taiwan, but couldn't find one. Nonetheless, the shops did have a huge selection of SSD devices, so I picked up one for my Cubieboard21 which hasn't been pressed into active use.
I am considering making it a Debian Linux file server, and only available locally via wifi. Rather than re-firewalling the router and Samba to assure security, I am thinking I can just use wifi security and keep the server local.
Any suggestions pro or con on my security choices?
I am considering making it a Debian Linux file server, and only available locally via wifi. Rather than re-firewalling the router and Samba to assure security, I am thinking I can just use wifi security and keep the server local.
Any suggestions pro or con on my security choices?
Comments
For most of my junk I would just rely on WPA2-PSK or whatever the latest recommendation is.
Then employ the usual SAMBA security practices. Like host and user protection https://www.samba.org/samba/docs/man/Samba-HOWTO-Collection/securing-samba.html
The SSD is only 65 watts of power, the Cubieboard2 is equally low power - so it is optimal for a 24/7 server application. I just don't have the need for that.
With the audio built in to the Cubieboard2, it could have just as easily become an audio jukebox. I even have the IR interface for a remote control device. Hmmm... I just might change my mind about what I want to build. The tax stuff can go an a USBstick... it doesn't really need a server.
In any event, I will try to get the Debian file server software loaded and running and go from there.
150 Watts! What century are you living in? A hard drive has not consumed that much power since they looked like this:
It's an order of magnitude less than 150 Watts. I have a bunch of drives here that claim about 7Watts is required. And they are pretty old desktop jobs. I bet a laptop hard drive is even less.
SSD's are two orders of magnitude down from your figure. My Samsung EVO consumes a max of about 1.5 watts
When the EVO is resting it's down to 25 milli Watts ! That's nearly 4 orders of magnitude less than 150 watts!!
Don't you love this "order of magnitude" thing ?
It's at least an order of magnitude easier than citing actual numbers!!
If this one works out, I may never buy another mechanical hard disk again.
I did take a look at Seagate Barracude 7200.7 @ 200 GBytes and certainly seems to require less than 8 watts (5VDC @ 0.75amps; 12VDC @ 0.36 amps). Looking back into the paperwork of the new SSD, I can't find where I read or thought I read 65 watts.
The nicest thing about the SSD are that it boots really fast, and I don't have to worry about it being bumped while running.
I had to go shopping again for a SATA cable with power. And I picked up a little 5amp 5VDC switcher to adequately power all that I might attach to this.
I thought I had a Cubieboard2, but it is now obvious that I have the original Cubieboard1.
So having spent a bit of bench time with it, I now have to go back to reading up on how to get Debian to boot. Android currently won't recognize my SSD or the USB Wifi.
I'm actually beginning to think this is one of an SSD's biggest advantages. I've always used WD Raptors for boot drives though, so I'm somewhat used to fast disks.
Considering the small mass of the actual computer, having a SSD to avoid bumping is a very important issue. But they boot and run faster as well.
My EEEpc 701/4G had a 4Gybe SSD and even at that small size it was very impressive in Linux. Plus, the SSD proved itself when the notebook was dropped hard on concrete. It happened twice due to falling out of a backpack, and once went bounding down a flight of concrete stairs. Neither drop did any serious damage.
I just read that if you have anything important, you really need to back it up to cassette tape.
Of course, this was a back issue of Byte magazine from last century.
Meanwhile, I am still working on getting my Cubieboard1 with SSD and wifi operational as an interesting project. Prior efforts with this Cubieboard have it booting in Android and I am working through how to change that over to Cubian, a Debian version of Linux for the Cubian which supports the Samba File server, headless operation, and wifi interface.
I still may deploy the device as a digital jukebox... in addition to being a file server. Linux has long had a well documented digital jukebox project and the fact that I have an IR remote interface, very low stand-by power, and a small foot print make this attractive to me.
In the process of getting up and running, I discovered that the Cubieboard uses "Das U-Boot", which happens to be the same booting application that Open-Wrt uses. So I am reading up on it for projects in both contexts.
Cubieboard support has matured and that makes it easier to get going. Previously I had one of their first boards and rather cryptic support for how to get started. There is a new application called Cubiez.
At this point, it seems that I may not have to compile anything from binaries. I might just get by with installing a pre-compiled binary to a micro SDcard and then having it install the Root file system to the SSD.
I am just wondering if I need to remove the Andriod 4.0.4 or if it can exist as an alternative boot.
I am still working on my MR-3020 in Open-Wrt that has similar challenges, and also offers another Wifi interface.
Yes, the Cubieboards were derived from boards designed for a TV box that was supposed to have Android with a LAN access to the internet.
In fact, mine is currently set up for that. It was also the easiest way to get started.
A change over can be done in three ways.
1. A mini SDcard with a bootable Linux OS to replace the Android
2. Re-flash the NAND memory with a Linux OS binary
3. Provide a SATA hard disk to boot Linux OS
Much depends on what hardware you have and what you are really trying to do.
It looks as though I have to have the 3.3v ttl serial port active to get a boot from an SDcard, and then I can have the image on the SDcard revise the NAND and/or provide a SATA hard disk boot. (Or there is an alternative USB port that will load a binary to NAND directly from Windows or Linux which has a special load button -- but you have to compile the binaries for that approach.)
There isn't one comprehensive document explaining the pros and cons of each and pointing to the links that are required. In fact, I am getting quite a few broken links. So I am going back and forth with exploring one alternative then another.
I have pretty much settled on the Cubian Linux as I don't have to compile anything. Just load it to a mini-SDcard and boot. Then I can migrate where it boots from.
But for you, you may have to set up a cross-compiler tool chain, compile and load. It is a more tedious process.
I absolutely HATE the HDMI video interface as I only have VGAs in my house. I doubt if I will ever buy and HDMI TV. So I had to spend about $25USD on a good HDMI to VGA converter.
Good luck on finding a tool chain to hack your TV box. It can be quite a challenge to locate. At least the Cubieboards make that part a bit easier.
http://docs.cubieboard.org/tutorials/cb1/customization/wireless_music_box
And Cluso..
If you are using Sunxi chips... (I really don't know where your MXQ Quad core fits in - these are all Allwinner SoC Arm chips. You might just have a nice Android TV box that won't load Linux.).
http://linux-sunxi.org/Main_Page
There is a lot of TV boxes listed with hacking advice.
The S805 is an Amlogic ARM chip with the MALI-450 GPU.
Since it is so cheap and compact, and has all the nice peripherals, I am waiting for it to be hacked for other work. Maybe OpenWRRT ???
Comes with 2GB & 32GB so its not a tiny router.
BTW my version has an AV out too Apparently there are two variants of the MXQ.
About all I can find is that the Chinese sell a Linux pre-loaded version called "OpenElec".
Sunxi has been extremely popular in low-end Android devices and the Linux-Sunxi provides good support to hacking these... even though it is unsupported by Sunxi.
So the real question here is typical of Linux. What DIY support is there for the Amlogic ARM products? You might wait a long time for someone to do something.
Or something may be already in the works...
http://openlinux.amlogic.com/wiki/index.php/Arm
++++++
I got into the Cubieboard1 a bit to early for my skill set at that time. So I kept my board and backed off for quite awhile. Now the community has matured and offers an easier entry point for a new user. Amlogic just has to go through the same cycle of growing pains.
It does seem like the link for Amlogic in OpenLinux does indeed provide enough to get just about any popular Linux compiled. You may have to add 'Das U-Boot' to the tools. And then figure out a good plan and memory map for flashing binaries to your device. (That is a challenge I am not quite ready for.)
Presently, it seems OpenWrt only provides a HOWTO for a headless server verision. OpenElec is not sharing what they did, at least not in English... maybe in Chinese.
Last night I spent a bit of time exploring what I had done on the miniSDcard. The NAND flash loads Android 4.0.4 and works nicely, but the miniSDcard was not booting as it should when inserted.
I discovered I have an image of Berryboot on the miniSDcard, and that is really a RaspberryPi solution that has never gotten fully ported to the Cubieboard. So I wiped the SDcard and am currently working on loading a CubianX1 binary to it.
If all goes well, that should boot right up when plugged in.
After than, I have choices to load it to the NAND flash (overwriting the Android 4.0.4) and/or loading the Root to my SSD.
That's the plan for now. Of course, there may be more snags along the way. I suspect I will at least stay in the microSDcard boot for awhile to familiarize myself with Cubian. I may want to go with another Linux distro rather than commit it to NAND and/or SSD.
The boot from microSDcard makes exploring distrobutions a bit like the LiveCD/DVD. I am NOT fond of the Android 4.0.4 as it mainly is extremely Google dependent and expects to be connected to the WWW.
There are three configurations to chose from.
1. HDMI, which is really the comand line via an HDMI display with keyboard and mouse for input.
2. Headless, which I presume uses the RS232 interface to a terminal that you provide
3. Desktop HDMI.
I currently have #1 running. And I need to still investing a wifi interface and installing the SSD Sata storage.
Eventually, there is the question of need to change the booting over to NAND or to the SSD. But I may purchase a few more microSDcards and try some different distributions and Linux alteratives.
+++++++
The main point is that the Cubieboard now is running in Cubian Linux.
It's good to see you've finally got your Cubbie running beyond Android.
A. At this point, it is rather simple to load Android 4.0.4 from an available binary to the NAND flash, and that includes an alternative automatic boot from the microSDcard of Linux distributions. Cubian is quite easy to copy a binary onto a microSDcard with provided binaries. Other flavors might require you use Cubiez to compile your own binary that can be on a microSDcard.
B. The SSD hard disk appears to need to be formated for Linux. I've not figured out how I desire to do that. I may have to open my big box computer that has SATA interfaces on the mother board and go from there. Or I think I might have a USA to SATA/PATA adapter device that can do the job. Of course, the third alternative is to figure out how to do it from CubianX with either FDISK or gparted.
C. OpenWRT is a very valid OS alternative -- even if it does not support the HDMI. Why so? OpenWrt has a delightful repository called opkg. There are tons of software choices in there that will keep one engaged and one doesn't have to compile from code. I am not sure if CubianX even has a repository. The lack of one adds a bit of a burden to explorting.
D. Some software applications keep cropping up as popular 'goto' tools for hacking these small boards and exporing.
"Das U-Boot" has been mentioned previously. Open-Wrt uses it for everything and the Cubieboard also depends on it to get binary images running. One can use this to explore an unknown device if one really learns to use all its features.
"Busybox" seems to be on-board. "Busybox" compacts a wide array of utilities for system operation and management into one binary. Previously, all the separate binaries took up unnecessary space. So gaining and understanding of "Busybox" is useful.
"nano" which is just a small text editor. It is easier to use than 'vi' or 'emacs'. One needs to use a good text editor to configure the system to personal preferences.
"minicom" or "putty" are serial terminal programs. PuTTY is more complicated and powerful. These might be installed on your Windows or Linux computer to connect to the RS232 port on your board. Often that RS232 port is the ONLY unsecured port that allows you to collect and observe the boot operation. Such data in turn gives you an idea of how to use "Das U-boot" to configure and create a new binary.. and to take the final leap of loading it. Flash memories have memory maps and it is imperative you have a good understanding of the existing one, before you create a new one.
And eventually "ssh" is important for administration of your new board. It is more secure than a simple RS232 port or telnet.
Next steps????
1. Ge then USB wifi device installed and working.
2. Get the SSD installed and working as merely extra storage -- not the Root
Then follow the instructions.
fdisk is available in CubianX and eliminates the need for me to dig through a lot of junk or open up another computer for a SATA interface.
Usually I use gparted in Linux. I am not sure that is available in CubianX as I don't yet have a GUI running. But I am now certain that fdisk is available for both the SSD and microSDcard.
I just need to refresh my use of it before I get into it. Just 'man fdisk' might be enough.