DIY Router at home aka PfSense on the beat;-) part 2.

Part 1 is here if you didn’t read it ūüėČ

Using my pfSense router for a while, I saw spikes of 50% and sometimes 70% when downloading Windows Hyper-V updates. It turned out, that ClamAV was the culprit of checking in real time and slowing things down. Yes, I know. It is task intensive and adding things like Snort and PfBlockerNG does not help either.

So…¬†I have to upgrade CPU then? But onto what? My 1220L v3 has¬†2110 points in Passmark, I don’t want to upgrade to next in line Xeon 1220 v3 (over 9700 points), once because¬†cheapest¬†I can find is ¬£99 and two it is 80W TDP (yes, I will explain later), then there is 1230L 25W TDP (4 cores 8 threads) and over 7200 points on the Passmark still costing minimum ¬£115 occasionally¬†on eBay. All I need is ECC and AES-NI and low power (ish)…

Behold… The i3 enters with¬†4130T 35W (it’s 4130 but with chopped cohones, aka lower TDP), dual-core¬†(2 cores 4 threads), 2.9GHz and no turbo, benchmarked at 4133 points (nearly twice of my 1220L v3). Can be purchased for about ¬£45. It has AES-NI, can utilise ECC with Cxx chipset, has all of the Xeon features, but no trusted computing, no turbo.

After installation first positive impressions: power consumption didn’t increase at idle and at full speed 100% on both cores, maximum usage was… 45W total. WHAAAT? Is only about 8W increase utilising full speed? I can live with this.

Next upgrade will SSD 120GB and Xeon 1230L v3, if I find the power of 4130T not enough, but it cost twice more and has 4 cores, what means for me maybe more heat in my Antec case… although¬†it is 25W TDP… but who knows ūüėČ

TDP Story:

Finally, we are here. What is all about TDP? People often confuse it with current consumption or maximum consumption (kinda). TDP acronym translates to Thermal Design Power and it is maximum heat output of the processor stressed out to the max. Simply saying if you utilise your CPU at 100%, it will emit TDP in Watts of thermal energy into the cooler via heat. It is important to know that the T (i3) or L (Xeon)¬†versions of CPU have reduced clock and are undervolted as well. In my case Antec ISK300-150, there is no much space, even if my CPU cooler can dissipate¬†temperatures from most of the big CPUs, but not in this tiny case. Also, my motherboard cannot do underclocking nor undervolting CPU, so I am stuck with default¬†maximum speed. This is where T or L versions come in very handy. my i3 4130T has TDP of 35W and it idle at around 45…50 deg centigrade, where 1220L v3 was comfortable at 36…40 degrees. Now, if I open the case it drops¬†to 33…36 degrees.

UPDATE:

Just realised something: Antec case has internal exhaust fan with a 3-speed controller at the back. Even with the lowest setting, you can still hear it easily and it’s worth mentioning that the highest settings… it is basically small vacuum¬†cleaner. You can feel air pulling from top¬†case opening so there is air movement anyway and if this bothers me too much, I will replace the fan with fractal silent 80mm and 4-pin, whisper quiet ūüėČ Shame that this board don’t have any means of fan control in bios, even though is using 4-pin PWN headers. Strange… No IPMI access and no fan control…

Power consumption with the fan on lowest (quietest) settings: 30…31W, with highest only 1W more. Not bad. Thermal Sensors in pfSense:

hw.acpi.thermal.tz1.temperature: 29.9 ¬įC
hw.acpi.thermal.tz0.temperature: 27.9 ¬įC
dev.cpu.1.temperature: 40.0 ¬įC
dev.cpu.0.temperature: 37.0 ¬įC

All that with 27 deg centigrade in my room. Not bad… Not bad at all.

 

Posted in PFSense | Tagged | Leave a comment

DIY Router at home aka PfSense on the beat;-) part 1…

After years of customer routers abuse¬†you see here, I decided to finally build something small, efficient and exactly what I want/need. Not too big, not too tiny…

My requirements¬†for my routers use to be always “small”: small case, small board, small CPU, small memory and then after using few things like ClamAV, PfBlockerNG, Snort/Suricata… things started to change. Small CPU was not the case anymore: “I NEED MORE POWER”, the memory from 2GB to a min of 8GB and ALWAYS ECC (especially those devices are running 24/7… and AES-NI for OpenVPN. You will end up with quite a hustle if you want everything together and also quite pricey. Or… there is always eBay ūüėČ

I didn’t want things super new and latest generation, simply because¬†they are expensive. Yeah, I know, they have a better power consumption, speed but also premium. I want ECC, this means I need a motherboard with Cxx chipset and ITX form factor, that¬†means new=expensive. Also, AES-NI on my CPU, so no Celerons, no Pentiums and because¬†of Cxx chipset NOT working with i5 and i7… all I got left is i3 or Xeon.

Then I saw it: Xeon 1220L v3, 1.1GHz with turbo 1.5GHz, it has ECC, AES-NI, 15W TDP (this is a little of¬†BS, but I’ll explain it later) and cost ¬£35 used. Got CPU, what about the motherboard? Digging into eBay and found lovely, new(ish)¬†MSI MS-S0891, LGA1150, ITX, C222, ECC ready board, IPMI (didn’t get it going yet BTW) for ¬£78, but without a back shield. I couldn’t believe my luck and it has 2 Intel LANs, OMG… I’m happy!!!

RAM: 2 sticks of 4GB ECC 1600MHz was just a quick transaction. Next was the case: remember, small… Soon after browsing few forums, I got something¬†like Antec ISK300-150 with external (important!) power brick. There is one with internal power supply, but it is noisier and heats up like a¬†toaster.

OK, we have most of the things I need, time for CPU cooler: Zalman 8900 Quiet

It fits exactly into the board and is one of the biggest coolers you can fit in this case and one of the best. Also, is bloody expensive with cheapest I’ve found at ¬£45. I got mine without a back plate (again?) for ¬£30 and used 4 separated bolts instead. Alternatively, you can do it with standard Intel CPU cooler for ¬£5, it will work as well.

As I didn’t expect to have 2 Intel NICs onboard my motherboard, I chose to purchase Intel 1000 VT LAN PCIe card with 4x Intel NICs. It has low¬†height bracket option, fitting perfectly my ISK300 case and you can find on eBay for around ¬£30-¬£35 pounds. Why VT and not MT? Same price and the first one has few options more useful for virtualisation. Keep in mind that this card will add about 5W of power to total consumption.

This is how it looks fully assembled.

My HDD is hybrid SSD+HDD from Seagate and it had a tendency to run up a high amount of head parking. It was solved here, now is a quiet¬†as a mouse ;-). From my stats, it’s not really using the whole 500GB, so next upgrade is ¬£35 Sandisk SSD 120GB from Amazon.co.uk ūüėČ

Power consumption:

Idle consumption is around 30W with small variances. To test the CPU on max performance (not very often you will see that in a home environment), it’s easy with OpenSSL in pfSense/Command Prompt, like:

 openssl speed -elapsed -evp aes-128-cbc & openssl speed -elapsed -evp aes-128-cbc

It will stress both cores using AES-NI (if you have it), so for me, it was around 40-42W  and having a peek at pfSense/System Activity to ensure 2 instances of OpenSSL are running on CPU 0 and CPU 1.

openssl speed -elapsed aes-128-cbc & openssl speed -elapsed aes-128-cbc

This command will ensure to run the same test but without AES-NI on the CPU, so 100% usage, both cores. The result is nice 46W max. Great!

Posted in PFSense | Leave a comment

IBM MegaRAID M5015/M1015 and long boot delay “fix”

AGAIN, A PROBLEM… ūüėČ

When I start building my new Workstation, I wanted RAID10 as the main boot drive. Firstly, I was testing mixed 500GB drives like WD Black x1, Hitachi x2, and Seagate 7200.11 (I knew this one was dying, but I needed a 4th drive, even if  I have to replace it soon). Playing around with onboard soft RAID options and Windows 10 spanned volumes, I decided to get good and cheap hardware RAID card like AVAGO ServeRAID M1015 or M5015. My workstation hardware at the time was:

  1. Motherboard: ASROCK EP2C612 WS
  2. CPU: 2x Xeon E5-2623 v3 @ 3.0GHz
  3. RAM: DDR4 64GB ECC
  4. HDD: 500GB x4
  5. GFX: 1x NVIDIA 1070 GTX 8GB, 2x NVIDIA 1060 6GB (rendering farm, WPA cracking, etc…)
  6. LAN: 2x Intel I210 – 1Gbit, 1x Mellanox ConnectX-2 – 10GBit
  7. CASE: Fractal Design XL
  8. POWER: Corsair RM1000x 1000W Fully-Modular ATX 80 PLUS Gold Power Supply

 

M1015

Upgrading firmware to the latest wasn’t¬†the problem: the problem was that I had UEFI bios on the motherboard and original¬†firmware on M1015 and could not start a boot menu called WebBios to create my RAID10 array. Bummer.

The remedy was to switch from IBM firmware to LSI/AVAGO ( there is more info on the subject, have a look). WebBios was enabled (funny enough, I did not have this problem with my other motherboards using normal/old BIOS, only with new UEFI) and I could create my first RAID10 array.

Next thing to do was to re-image my old Windows 10 Pro from backup, so I fired up my good and trusty AOMEI Backupper Standard and… I’m waiting… and waiting… and waiting… and there must be something wrong with this whole set up! After 14 hours (yes, 14 hours!!!) of restoring 350GB onto the array, I got really puzzled. In the end, after something like 16h, I got my Windows 10 up and running, but…

It takes a long time to boot. A BLOODY LONG TIME. Like 20 minutes? Heh???!! Back to basics. Speed? Should be around 300 MB/s read, yes? CrystalDiskMark to the rescue and I were shocked one more time… 60MB/s sequential read and 20MB/s sequential write… don’t start me on the random r/w… CARRAMBA.

STOP. REWIND. WHAAAAT???!!! It cannot be. Nope. It’s RAID card, 4x 1TB WD each can do 120MB/s easy, so… whats the problem?

Digging around forums for few days, I’ve found out, that M1015 is just HBA card with “added” raid option and CPU on this card is to slow for anything else but a straight RAID 1 or JBOD, even if you have more options like RAID 10 or RAID 5. Sad, but true. OK, let just remove RAID boot option, reflash it with latest LSI firmware and use it in my NAS4Free fileserver as straight HBA card. Done!

M5015

Ordered on Fleebay nearly “new” ServeRAID M5015 with BBU (battery backup unit), I was able to import old M1015 array without any problems, even if it was created under M1015 with LSI firmware, not IBM. Soon as I connected drives and boot my PC, I was asked if I want to import located array as RAID 10.

Speedwise? Nearly 450MB Reads and 350MB Writes. Happy like a bunny now!

But… Nearly everyone complains about one thing: delay before post. Seriously. It’s like 1.5 minute (exactly 60 seconds as I discovered later). Nothing. You just look at the screen and pray for something to happen. After few reboots (I had to get Windows to work my way), I had enough of it. Time to modify again. There is a program for Windows called MegaSCU.exe and it can read settings from M5015 into a file where we can edit some settings:

MegaSCU.exe -AdpSettings Write -f settings.ini -a0

This command will save everything into a file called “settings.ini”, where we need to find one option called:

delayPOST = 4 # intentional delay to be introduced during FW POST. Possible coded values: 0 to 7,which gives a value of 0,15,30,45,60,75,90,105 seconds

As you can see, value 4 equals to 60 seconds. I think, IBM servers having a long post, so they can make sure that all HDDs are running full speed before raid card gets online and drop some hard drives from the array.

Change delayPOST = 0 and save file. Next step is to upload the whole file to the card’s memory:

MegaSCU.exe -AdpSettings Read -f settings.ini -a0

…and this is it. Reboot computer and the whole post will be very short, from the 1st posted message by raid card to actual boot.

Now, few things to clarify:

  1. MegaSCU is a program working under Windows (10 in my case)
  2. Command -AdpSettings Write – reads from the card and writes into the file
  3. Command -AdpSettings Read –¬† reads from the file and write to the card
  4. If something happens, don’t blame me for it. I got my card working and I’m happy now. ūüėČ

For now, I am still unable to get WebBios working, but at least I don’t have to wait for it anymore. If one day, I need this option, then probably replacement firmware from LSI/AVAGO will be my choice.

Lastly, I replaced all drives for WD 1TB Blue x4 and created a nice, 1.86TB Raid10 array and guess how long took me to do a full restore from backup? About 1 hour. NICE!

 

Posted in RAID | Tagged , , | Leave a comment

Seagate, APM, pfSense and dreadful Start Stop Count rise killing slowly my hard drive

One day, tinkering with my pfSense, I was quite annoyed about how long it takes to boot up my box to get it to the user interface. OK, I had an old 2.5 HDD 320GB from Hitachi, it was bulletproof TBH, but soo slow.

Not long time ago, I saw one of 2.5in, 500GB Seagate SSHD FireCuda hybrids – ST500LX025. Fast 8GB SSD inside of normal HDD, up to 140MB/s transfer, SATA III. One way of saying: NICE! Normally, I would not use full SSD in something like pfSense, due to wear and tear, but… an idea, that internal SSD is only utilised for the most often used files… it kind of appealed to me very quickly. Let restart system a few times and it should get updated onto internal SSD. Let’s see.

THE PROBLEM

Installation was very straightforward as usual and in about 800 hours later, I had a peek at S.M.A.R.T. details and I was gutted. Not again. All that singing and dancing about “green drives”, “save the environment!”¬†usually end up truly with saying: “Penny wise – dollar stupid!”. Why? Let me rumble a bit: This is about the third time I have to resort myself to digging around the Internet to find out how to disable something, I don’t really need it and it was quite difficult to find info about it. OK, I’ve saved few watts on electricity having all those fancy features on, but wasted a much more looking for the way to disable¬†them. Let me show you SMART features after some 886 working hours.

SMART Attributes Data Structure revision number: 10
Vendor Specific SMART Attributes with Thresholds:
ID# ATTRIBUTE_NAME          FLAG     VALUE WORST THRESH TYPE      UPDATED  WHEN_FAILED RAW_VALUE
  1 Raw_Read_Error_Rate     0x000f   067   064   006    Pre-fail  Always       -       5411719
  3 Spin_Up_Time            0x0003   100   100   000    Pre-fail  Always       -       0
  4 Start_Stop_Count        0x0032   084   084   020    Old_age   Always       -       17116
  5 Reallocated_Sector_Ct   0x0033   100   100   036    Pre-fail  Always       -       0
  7 Seek_Error_Rate         0x000f   071   060   045    Pre-fail  Always       -       13991423
  9 Power_On_Hours          0x0032   099   099   000    Old_age   Always       -       886 (200 24 0)
 10 Spin_Retry_Count        0x0013   100   100   097    Pre-fail  Always       -       0
 12 Power_Cycle_Count       0x0032   100   100   020    Old_age   Always       -       96
184 End-to-End_Error        0x0032   100   100   099    Old_age   Always       -       0
187 Reported_Uncorrect      0x0032   100   100   000    Old_age   Always       -       0
188 Command_Timeout         0x0032   100   099   000    Old_age   Always       -       3
189 High_Fly_Writes         0x003a   100   100   000    Old_age   Always       -       0
190 Airflow_Temperature_Cel 0x0022   053   049   040    Old_age   Always       -       47 (Min/Max 25/51)
191 G-Sense_Error_Rate      0x0032   100   100   000    Old_age   Always       -       0
192 Power-Off_Retract_Count 0x0032   100   100   000    Old_age   Always       -       2
193 Load_Cycle_Count        0x0032   092   092   000    Old_age   Always       -       17171
194 Temperature_Celsius     0x0022   047   051   000    Old_age   Always       -       47 (0 22 0 0 0)
197 Current_Pending_Sector  0x0012   100   100   000    Old_age   Always       -       0
198 Offline_Uncorrectable   0x0010   100   100   000    Old_age   Offline      -       0
199 UDMA_CRC_Error_Count    0x003e   200   200   000    Old_age   Always       -       0
240 Head_Flying_Hours       0x0000   100   253   000    Old_age   Offline      -       517 (152 84 0)
241 Total_LBAs_Written      0x0000   100   253   000    Old_age   Offline      -       233859569
242 Total_LBAs_Read         0x0000   100   253   000    Old_age   Offline      -       15692817
254 Free_Fall_Sensor        0x0032   100   100   000    Old_age   Always       -       0

SMART Error Log Version: 1
No Errors Logged

Don’t just don’t¬†look at¬†Raw_Read_Error_Rate &¬†Seek_Error_Rate, it is the same rubbish I see since my first Seagate drives 7200.11 series. Somehow it always gives me some weird numbers not related to actual valid information, so with Seagate, I will just skip it. What you should be concerned, is¬†Start_Stop_Count &¬†Load_Cycle_Count, with BOTH having over 17000 counts!!! In 886 hours??!! Let us do some mathematics:

886h (working time) / 24h = 36.9 days
17116 / 36.9 days = 464 Start Stop cycles per day
17171 / 36.9 days = 465 Load Cycles per day

Those drives are calculated at max 600.000 times on those cycles, so:

600.000 / 465 =  1290 days
1290 / 365 days per year = 3.5 years

Basically… warranty last 5 years… but the drive with all those cycles may not.

THE SOLUTION

Having already NAS4Free and problems with way too much head parking, the solution is exactly the same: TURNING THIS BLOODY THING OFF!

New hard drives have SMART options and ability to turn some features on and off, so quick command in pfSense’s¬†Diagnostics/Command Prompt:

ataidle /dev/ada0



Model: ST500LX025-1U717D
Serial: ********
Firmware Rev: SDM1
ATA revision: ATA-10
LBA 48: yes
Geometry: 16383 cyls, 16 heads, 63 spt
Capacity: 465GB
SMART Supported: yes
SMART Enabled: yes
Write Cache Supported: yes
Write Cache Enabled: yes
APM Supported: yes
APM Enabled: yes
AAM Supported: no

What we need is APM Supported: yes and APM Enabled: yes. This is an indication that power management is available and is ON,  so next thing is to turn this thing OFF by issuing the command:

ataidle -P 0 /dev/ada0
ataidle /dev/ada0

...
APM Supported: yes
APM Enabled: no
...

Now… check¬†the SMART features and you should see that those counts are not changed as often as it was before. It should also survive a reboot of the machine, at least it did on mine so far.

Three days later, I went back to SMART info and I saw that drive is parking head again, but also somehow I left pfSense’s System/Advanced/Miscellaneous/Hard Drive Standby @ Standby 36, which forced HDD back into APM mode. Leave this option with¬†“ALWAYS ON”. Next thing is that it will turn off Advanced Power Management, but “old/normal power management” is still on and that will imply standby timers, where the device will go into normal standby mode as per ATA/SATA old standards. We can take care of those with this command:

camcontrol standby ada0 -t 3600

Forcing standby timers to 3600 seconds = 1 hour of inactivity.

So, that’s it. It is off and in machines like NAS4Free or pfSense should stay off as they do loads of small writes, where magnetic head stays busy for a small period time, waking up very often, racking up those cycles. The only problem is that not every HDD can be turned off this way, luckily this one can. The last thing is to just check if everything goes by the plan by issuing the command:

camcontrol identify ada0



pass0: <ST500LX025-1U717D SDM1> ACS-3 ATA SATA 3.x device
pass0: 600.000MB/s transfers (SATA 3.x, UDMA6, PIO 8192bytes)

protocol              ATA/ATAPI-10 SATA 3.x
device model          ST500LX025-1U717D
firmware revision     SDM1
serial number         ********
WWN                   ********
cylinders             16383
heads                 16
sectors/track         63
sector size           logical 512, physical 4096, offset 0
LBA supported         268435455 sectors
LBA48 supported       976773168 sectors
PIO supported         PIO4
DMA supported         WDMA2 UDMA6
media RPM             5400

Feature                      Support  Enabled   Value           Vendor
read ahead                     yes	yes
write cache                    yes	yes
flush cache                    yes	yes
overlap                        no
Tagged Command Queuing (TCQ)   no	no
Native Command Queuing (NCQ)   yes		                32 tags
NCQ Queue Management           no
NCQ Streaming                  no
Receive & Send FPDMA Queued    no
SMART                          yes	yes
microcode download             yes	yes
security                       yes	no
power management               yes	yes
advanced power management      yes      no      0/0x00
automatic acoustic management  no	no
media status notification      no	no
power-up in Standby            yes	no
write-read-verify              yes	no	0/0x0
unload                         yes	yes
general purpose logging        yes	yes
free-fall                      no	no
Data Set Management (DSM/TRIM) no
Host Protected Area (HPA)      yes      no      976773168/976773168
HPA - Security                 no

 

UPDATE:

Had a peek at SMART values and “Huston, we have NO problems” anymore. Both counts in question increased about +2 for the past 12h. I can live with that… ūüėČ

 

Posted in NAS4Free, PFSense | Tagged , , , , , , , , | 1 Comment

When your home “Wi-Fi router” is not enough…

A bit of boring history… Part 1:

US. Robotics 8054Going back in time, my first Wi-Fi router was the US. Robotics USR8054 802.11g Wireless Turbo Router with its 4x 100Mbit LAN and turbo Wi-Fi nobody else could (125Mbit) use and if I had >3 Wi-Fi users, it often died instantly (first Wi-Fi than LAN). It was a good router at the time and if nobody run torrents… At the time it was fine (especially, when I replaced original firmware with DD-WRT).

Linksys WRT300N

Then… it was the Linksys WRT300N… Didn’t last very long due to a position by the window it occupied… Died of condensation poisoning ūüėČ very dangerous sickness for any electrical device. Don’t remember to have any problems with it, it was working when it was alive…

Belkin 54g

Next was Belkin 54G, luckily in¬†this version, I was¬†able to replace the firmware with DD-WRT. Here, I was actually starting to be able to kill it with high¬†demands. It was beginning of¬†time, where all those mobile devices start getting access to the internet over Wi-Fi and all my previous home routers start showing age-related illnesses. Running on 300MHz CPU and having few MB ram wasn’t enough for more than¬†5 devices at the same time. Of course, having my desktops running Gigabit Ethernet but running in Fast¬†mode didn’t help either. So, I bite the bullet and ordered from Korea (¬£68 vs ¬£110 in the UK) the Speed Deamon: D-Link DIR-825 B1.

DIR-825_B1

It was THE router: 64MB RAM, 680MHz MIPS CPU, worked with DD-WRT, OpenWRT, Gargoyle firmware, 4x Gigabit Ethernet, 1x Gigabit WAN. Originally, this model was “bashed”¬†on the internet about how bad it was (most of it true for A1 and B1 versions running standard firmware), but soon as I replaced it with alternative (Gargoyle v1.8.1¬†is still¬†running now), it was really good, but… The 5GHz range wasn’t as good as 2.4GHz, but I think it was due to D-Link trying to save few quid and didn’t fit it with good power amplifiers for higher frequency, also it was beginning of 5GHz for consumers and 11N in the draft2.0 on both bands, didn’t help either. Here, I was quite happy with it and it has been good for me for a long 4 years. I probably wouldn’t change it, but I came across something like Virgin Media cable and its 30Mbits, 50Mbits, then 100Mbits and 200Mbits eventually and my router start getting bog down… then I discovered that if I use VPN with encryption for the whole house it will kill speed to barely 3… 5Mbits… Disaster, when you do not have hardware AES encryption…

Archer-C5v1.20

Then I found TP-Link Archer C5 v1.20 (DD-WRT and OpenWrt capable, with the same hardware as C7 v2.0) for ¬£49.00.¬†I do not have to think twice… 128MB RAM, 720MHz Archeros with original firmware OK for more than basic setup, Gigabit Ethernets, 11AC, dual band. To run on Virgin Media (VM) 200Mbits more than I need it. Of course, I wanted to test it with the latest OpenWrt, but discovered that unfortunately, there are 2 major problems (not a problem as per se, but…): Firstly, because of not using hardware NAT (and thank you for that, seriously :-)), the WAN -> LAN speed was half of its original potential (but then even for my VM 200Mbits, it was still within its range of around 300Mbits). Secondly, the 11AC Wi-Fi part was proprietary and neither OpenWrt nor DD-WRT was able to get it right, there was always some problems, sooner or later.

So… I have¬†6 mobile devices, TV with Wi-Fi, NAS, Satellite box, AVR with internet radio, 2x Desktops, Media Player… not much, but what if I want to run OpenVPN for whole house? 6..8Mbits max on Archer C5 and Gargoyle firmware… Again, no hardware AES and what’s the point to have 200Mbits, but use 8??

Then, I moved away and there is no Virgin Media, but SKY with its fibre 39Mbits. Ok, much slower, but I didn’t feel¬†any difference, to be honest… Strange…

As you getting older and have kids, you start to see internet as place, where you need to take control of¬†what’s going in and out from your network and I got to the point after having experience with many different kinds of consumer routers, that Wi-Fi routers cost more and more, have many good features and hardware tricks, but they are 5 years behind everyone else. How? My Mobile phone has 1GB RAM¬†and dual-core 1.4GHz CPU and is from 2011, but I saw dual-core ARM 1.2GHz¬†on the Wi-Fi router at the end of 2015 with its 256MB (1/4 of my mobile’s) and there are (in 2016) about few devices with dual-core and >128MB RAM… Disgrace and¬†if you add to the insult, that firmware side of those devices, is often rushed and not complete or fully tested, where proprietary drivers making it unsuitable to change firmware, you will end up with a very expensive toy, all singing and dancing, but unusable for anything more complicated than manufacturer anticipated.

If I want to, let say use OpenVPN, block pages via keywords or IP address (yeah.. I¬†know, some of them can, but it’s usually limited to few words or web pages) or anything more… you are not looking at¬†the consumer router at all.

All the time, I am running ARM or MIPS router systems due to low power. That’s all. There is nothing else to it. Crappy software, proprietary drivers, not able to upgrade with time, require you to buy new router all the time…

Having Media Player build on¬†Intel CPU (in my case, it was Intel Celeron G1610) and fully featured ITX motherboard with full-width PCIe 3.0 x16 will give you something to think about. This whole setup as a media player was (including PICO PSU 150W, 2GB RAM, 2.5″ hard drive) doing¬†about 30W with full HD movie on. OK, my router Archer C5¬†is doing max 5W, so I’m at loss of 25W, but it cannot do what I wanted, next one will be Linksys WRT1200 based on Marvell (AES supported) but costing around ¬£120, if not more and pooling about 10W full on. It can run OpenWrt, but 11AC has its own problems. So… What’s next?

Answer: PFSense. Simple. Running on x86 CPU like your normal PC… It just blows your mind this thing can do. Will I want to get another router in the future? No. Way. In. My. Life. Why? Let’s get to it: Why we buy ¬£100-¬£300 Wi-Fi router?

  1. It looks cool
  2. It has many antennas
  3. It is the fastest
  4. It only sips power from 5W-15W (depends on model)
  5. Has latest features (most of them are vulnerabilities and NOT features, unfortunately)
  6. It has alternative firmware (let’s be honest, it’s getting more and more problematic to actually get one “fully” supported by DD-WRT or OpenWrt)

To be honest, after all my previous toys, I wanted something, that was actually working and has many features I need. So, let’s get why:

  1. Looking cool? Don’t care. I got my case passed from NAS to Media Player to my PFSense router. It’s fine.
  2. Antennas? Don’t need one, still have my Archer C5, I’m using as an external Wi-Fi AP. Why? Looks cool, works fine as AP, doesn’t route anything, just transferring data. Simple. Even 200MHz CPU can do that now and I got there 720MHz. Great.
  3. Whooa… Intel G1610 will blow all those MIPS or ARM CPUs out of ANY water few times in the row.
  4. Archer C5 does 5W max, Linksys WRT1200 will do 10W… my Router with Intel Pro 1000VT will do 40W… Probably. Who cares. Difference between power consumptions will be at max 35W and with my prices of 12 pence per KWh, will yield¬†around ¬£3.50 per month. This will not change much because¬†I have enough CPU power to overtake my network needs 5 times, so I will not buy any routers in near future unless something breaks, but then anything can happen.
  5. PFSense is updated every so often including latest security patches, will your router get that? No way. Not possible.
  6. I can run PFSense or IPFire or anything else I wanted… Even Windows Server if I had money for it.

In the end… the only problem is, that it is not a plug-and-play solution. You need to know more or less what you want from your network and what you want to do with it, but judging by the need to change your router, it is time to get another look at x86 systems.

That’s why, part 2 will deal with actual installation and simple configuration… we will get webs/IPs blocked,¬† online Antivirus, have tons of info what’s going on in our network and more…

Posted in NAS4Free, PFSense | 1 Comment

To UPS it or Not to UPS it…

Uninterruptible Power Supply as they call them (or UPS in short) is a nice device. In contrary to common beliefs, it’s not that expensive but is very, very useful. I am a firm believer, that it should be in every home, where the owner of the expensive or fragile equipment, wants his pieces to last longer. I wasn’t like that from the beginning, I was actually quite opposite… “Why do I need it?”, I’ve asked myself many times… With time, using various bits of Audio Video Receivers, many different PCs, Printers… I found that, since I am using it, there is no sudden resets, restarts of my PC or file server, it is just rock solid… Also, it always annoyed me when I’m connecting power plug and I can see an arc sparking from connection… No more…

UPS

This unit (1300VA Management UPS PW-4130M) is quite simple UPS and works well for me, but was the same problem with both units I have at home: noisy fan, always on and amount dust accumulated inside after whole year…

Remember, when opening any UPS, always be sure that it’s switched off!!! Also, it will have a battery, so if you accidentally switch it ON it will POWER UP. You have been warned. I will not take ANY responsibility if something will happen to you. Just be careful and DO NOT touch anything inside…

Problem is quite simple to remedy: replacing the fan with something much quieter and while you at dismantling the case (hold by 4 screws inside of plastic feet and smaller screw at the bottom of front cover), you can vacuum inside. When installing your new fan, you can redirect it from blowing outside to actually blow inside of case AND install dust filter outside of case like I did. Now it’s quiet UPS and I can clean dust without opening case.

Just remember to clean every so often…

 

Posted in NAS4Free | Leave a comment

NAS… I want one!

Looking through internet magazines and forums, I found everywhere the same subject: people are using devices called NAS (Network Attached Storage). The range is from very simple devices based on very power efficient ARM CPU with 1 or 2 GB of memory and 1 or 2 hard drives usually connected in RAID 0 or 1 or simple JBOD (Just Bunch Of Disks) to server type with 16/32GB ECC memory and many hard drives (from 4 to 8 usually). Also, in the middle of this bunch, they are companies like QNAP or Synology, where you can have 2-8 hard drives all in very nice cases ready to set up and run… But… Not many people, actually have any clue what they want from this new gold aka NAS device.

I hear all the time that QNAP is the best or Synology is even better… Some people like me, they will prefer to build it from the ground up than relying on 3rd party devices. It all depends on what you want to do with it. Let’s divide those devices into 3 different groups:

GROUP A: This is so-called low powered ARM CPU based NAS with 1 or 2 disks in Raid 0 (stripe) or Raid 1 (mirror) or just as a JBOD (all HDDs connected next to each other). Now, true JBOD works kind of like Raid 0 (in terms of there is no redundancy and NO speed of Raid 0, but if one disk fails, you will lose everything, just like Raid 0). Some companies made it JBOD as “one disk finish, next will start”, so if one dies you will have the other working and you will have an accessible NAS anyway. At least half of data is still available… There are many examples of those devices with nice casing, small LCD… many different services like DLNA to stream your movies to TV or Blu Ray Player any other Media Player, FTP, iTunes… but those devices are designed for people who have NO clue about computers, they just need device to dump their DVD or BD or MP3 collection and forget about it. “Press a button and is ON”, also performance is more likely from 25 MB/s to 50MB/s. Not very often you will see more of that. “Raid 0? Raid 1? What’s that?”

GROUP B: Here are devices from QNAP or Synology. They have a better hardware and software, they use better memory with error correction (we will talk about it later), also they can use many more hard drives (usually up to 8). They have their own proprietary system with GUI, but you can do a lot more than with those devices from group A. Speed can be easily twice more (we are talking about SMB connection for simplicity), but… apart of replacing hard drives, there is not much you can do. Those devices are designed for users with bigger needs also with bigger knowledge and bigger pockets (and we are talking hundreds of dollars).

GROUP C: This is the most configurable, but the most complicated group of all, is also the most rewarding for you. Once configured, you will not have to do it again, but configuration process can be a bit of pain… Creating your own NAS from scratch: choice of CPU, motherboard, memory, hard drives, casing… I made my first NAS out of spare parts, I found around my home. It worked better than any of devices from group A. For free.

I knew, that I don’t need any device from group A, simply because most of them will work for me just like additional SLOW hard drive, and at that time they cost about ¬£150 without any drive. For that price, I could have a new computer, if I wanted. Group B was way too expensive, even without drives. What I wanted was something with redundancy, low(ish) power consumption and a possibility to upgrade when and if needed…

It was my breakthrough when I discovered something called ZFS. “Zettabyte file system”… Zetta… what?! It was something that no other device from group A or B did have. I discovered that it was my ideal file system to store what I need to store. Let me explain: I needed storage to hold my backups from windows, family photos, movies… etc. Usually, I had a spare hard drive, on my desktop where it was formatted in NTFS and I could access it via network simple by share it… It was simple and it worked, or at least I thought it was working… but it didn’t. There is something called a “bit rot” I wasn’t aware of, but I had a first-hand experience: one day I could find some of my pictures half or partially shown, everything else was black or blue… part photo, part plain colour. At the time I didn’t put too much weight on it, so I left it as it was.

Bit rot is when somehow, on your hard drive, one small bit change its state from 0 to 1 or from 1 to 0 without you knowing. “It’s nothing” you will say, but “ONE” bit in the middle of JPEG will render rest of this jpeg plain. This is what’s happened to my family photos. Not much trouble with movies, it will probably just skip frame or few, but for jpeg, it was a killer. Then, I couldn’t decompress some files by 7-zip. “Decompressing error” will say… I start searching and found the reason… It not always will happen, but filesystems like NTFS, EXT2/3/4, don’t have any safeguards for this type of error. ZFS does. It safeguarding against many other troubles like erased files. On ZFS they are not erased but temporarily removed, you can always bring them back unless you have no free space and system needs to save information in those areas, where your erased file was… self-healing when it finds problems… and many more. You need to read about it in depth to find all the perks. For me it was the 4 things: RaidZ2, compression, safeguarding against errors and self-healing.

Compression can be enabled, so any file being dropped onto those hard drives are being compressed on the fly. Yuppi! 100GB of Windows 7 backup, will not take 100GB anymore!

RaidZ2: it was like a song sung to me from far future. Imagine: 6x 500GB hard drives working together as one, where you can sustain 2 hard drives die on you at the same time… Now, they say that RaidZ1 is an equivalent of Raid5, RaidZ2 –>Raid6, RaidZ3 –>Raid7… It’s not entirely true and normal Raid system will not have any of the benefits of ZFS system but many of shortcomings like trouble when you interrupt power when Raid5 is writing a file (so-called “memory write hole”, no problem for ZFS).

OK, enough of theory, you can read for yourself and there is a lot of info out there, just have a look. What they will NOT tell you (mostly) is the hardware needed for all that stuff. Of course, you can base all of it on Intel and you will pay a premium for it (“I’ve got INTEL MAN!”) or simply you can scavenge AMD on the cheap and have working NAS in no time with minimal money spend.

First of all, I want to point out something: the need for ECC memory. There are many schools whether to get them or not, I think that you WILL NEED THEM sooner than later. Why? I had my first production NAS based on Asus motherboard P8H77-I with 6x SATA, ITX size, 2x DDR3 (up to 32GB) and CPU Intel Celeron G1610 @ 2.6GHz, 6GB RAM @1333MHz NON-ECC and 4x500GB hard drive in Raid10. Also, using ZFS with no ECC memory was¬†missing the point. Imagine: If ZFS read block and this block gets corrupted in memory, it will think that blocks on HDD are bad and rewrite them with bad ones…IE whole pool is lost… ECC prevent it from happening and I had first-hand experience with mine where I had memory @1600MHz and AMD CPU could use a maximum of 1333MHz. Of course, memory gets corrupted and system has done all it could: reset before you could use this bad memory block.

To be honest… there are many “theories” whether you must use ECC memory or not, for me, I want to be sure, that “all gaps” are being filled.

After retiring my Celeron to media player duty (it’s actually very happy there), I had a look whether I can get another Intel, but with ECC support. Unfortunately, at the time, all I could find was with a huge price tag as it needs it Cxx series Northbridge and Intel didn’t want ECC support in non-server motherboards even if many CPUs actually support it.¬†Now, Asrock rack does quite cheap ECC supported Intel’s LGA 1150 still with price tag of ¬£150

So, AMD was next in line. After spending hours on the internet finding out what CPU & motherboards can use ECC memory, I’ve found that only ASUS will state its support for ECC, some people had luck with Gigabyte, but others are¬†ignoring this feature. I wanted the latest generation, so I went for an AM3+ motherboard and having experience with ITX, that they are too expensive for what they are I wanted MATX. ASUS¬†M5A78L-M/USB3 was the one. 4x memory slots with ECC support “up to” 32GB, 6x SATA2.0, 2x PCI, 1x PCIe x1 (for Intel LAN card), PCIe x16 for HBA card if ever needed… All I ever need it was there for the price of ¬£49.99. Smashing.

CPU: I had Celeron G1610 before and it NEVER went more than 30%, so all I need was to find something with low thermal envelope and at least half of Celeron’s power. AMD 210e with 45W TDP fit the bill perfectly. It cost me ¬£26 on eBay. Memory? I was to use 6x 500GB so, a memory I needed was like 4 GB, but I go eBay to run for its name and got 2x2GB for ¬£12 and 2x1GB for ¬£6. Nice. All of them 1333MHz. 3U casing cost me another ¬£60. All in about ¬£150. This is what I like.

Operating System: I chose NAS4Free. Simple, it will do all I need and more, forum guys are stars, very easy to deploy.

Whole set: Right now, I have a 32GB ECC @1333 (eBay again @ £70 a piece of 16GB 1600MHz) memory and planning to increase from 6x500GB to 6x2TB, hard drives are: 2x Hitachi 7200.C solid hard drive, 4x Seagate 7200.11 (2 dying slowly). I have to say that Seagate has a bad name after 7200.11 series as they will just die on you.

Performance: 80MB/s writing and 85MB/s reading constantly around it. As for Realtek NIC, it’s a good result. Enough for me. I may fiddle with Intel CT NIC cards to see if I can squeeze more or just wait for new hard drives.

NEW hard drives: I need to replace two of them, so I think I will start to update what I have. There are 3 options: Standard WD RED 1TB @ £47 with 3 years warranty, WD BLACK 1TB with 5 years warranty @ £56 or throw me into darkness with Toshiba (rebranded Hitachi) 2TB for £56 including delivery and 2 years warranty.

I like darkness… I’m working nights ūüėČ Toshiba!!! I’m coming!!!

Posted in NAS4Free | Tagged , , , , , , | Leave a comment

Cheap NAS or Intel NAS?

Quite recently I was crawling through few forums and I just realised that there is some sort of prejudice towards non-Intel-based NAS systems. There is always someone saying that you must have:

  1. Intel C2xx chipset
  2. Xeon CPU
  3. ECC support
  4. Intel NIC

Some always argue that you will run 24/7, that Intel cards are faster, Intel is more power efficient… I am sure that for the majority of NAS users, the total price is the biggest thing to swallow. Of course, I wouldn’t mind having a very low powered system with all bells and whistles and if it was free, I would be very happy. Unfortunately, it may never happen.

Luckily, there are few alternatives to Intel’s prices and I am running one at home for dirt cheap with good 85MB/s read/write. How? Let’s debunk some of “necessities” based on Intel’s offerings. We will focus on MATX or ITX format, simply because not everyone wants full-blown tower NAS. Smaller is simpler, but more expensive, especially casing.

  1. Intel C2xx chipset – last time I’ve checked, any motherboard with C216 or C226 was with a price tag above ¬£150. With Intel, you need C2xx to handle ECC memory plus you gain few PCIe lanes, Intel NIC or two etc, something not really needed for home NAS system.
  2. Xeon CPU – It’s VERY expensive but it has AES instructions assisting in real time encryption (but there are people who are saying that those instructions which should be random are not entirely random, so there is a chance of decrypting what shouldn’t be possible… anyway different story), also can use ECC memory and it can address more than 32GB (and why you need more than 16GB in home file server?)
  3. ECC support – I will agree here that, if you want the safety of your data, you will need them. No buts no maybes: I will show you my pics were 1 bit flipped and 75% of the photo is destroyed. Reason? It sat on windows based computer for about 2 years. No ECC, no ZFS, no checksums, nothing.
  4. Intel NIC – I have 1 Realtek 8111E on my motherboard and it performs flawlessly, maybe I didn’t hit speed records, but it does nearly 1Gbp¬†limit anyway. Having 2 network cards on Intel boards? To do teaming or bonding you still need a switch with bonding functions and those are not consumer parts also damn expensive, so why bother. IPMI – a few years ago there was no IPMI and people still worked on servers using SSH for example. OK, it may help you, but at what price?

So, let’s face it: if you want to have Intel’s bells and whistles you may pay about ¬£200 just for board or/and¬†CPU:

  • ASRock E3C226D2I Server/Workstation Board (Socket 1150, Intel C226, DDR3, S-ATA 600, M-ITX) @ ¬£165
  • Intel Pentium G3220 @ ¬£40 (but no AES)
  • 8GB 10600E (PC1333) Unbuffered ECC @ ¬£70
  • TOSHIBA DT01ACA200 2TB @ ¬£50 x 6 (we are doing RaidZ2 with 6 disks)
  • any case you want, I chose rack 3U case @ ¬£50

My NAS is based on AMD 210e CPU @£26 used and ASUS M5A78L-M/USB3 @ £50 new motherboard. OK, Intel might be faster and more power efficient but with double or triple the cost and I will be very difficult to get it second hand if you want to save money. My system is used mainly for backups and family photos/videos and I do value, that it just works nearly out of the box using ZFS and NAS4Free.

I know that many people will argue that Intel is server grade hardware and much more powerful, but I will ask them again: Do I really need server grade parts for home use? I don’t think so and many others as well. We are going cheap and cheerful. It works without spending 100s on features ¬†I don’t really need. Below is screenshot during re-silvering of my new Toshiba 2TB. The CPU is coping quite well, so do¬†I need more power? for 1-2 users?

NAS4Free_CPU-Resilvering

Below¬†is the reason, why I actually bother with NAS, ZFS, ECC and other bits: this picture was destroyed by just holding on NTFS partition for about 2 years. If it was a 7zip archive, it will not decompress, if it was a program it will keep crashing… Faulty RAM memory can be silent killer as well…

20120173Bottom line is that for a home file serving with occasional FTP, SMB, SSH; cheap AMD system with ECC¬†memory¬†is more than adequate to safeguard your data without spending a lot of¬†money. I can hear those screaming “what about¬†transcoding video for DLNA?!”, I can scream back with “ditch your iPad/iPhone/isomething_else and use¬†more¬†advanced¬†stuff to play your music/video via SMB share without the need to transcode!!!”. Why the heck, every time you have to transcode something into something else using CPU at full throttle?? Where is your energy efficiency??? This is yet another story…

Yes, Yes… Always do a backup ūüėČ

 

Posted in NAS4Free | Tagged , , , , , | Leave a comment

When your NAS is DEGRADED…

…it’s not the end of the world. Not yet.

It was a very nice day, when just out of blue, 2 of my 6 hard drives in RaidZ2 configured pool, start having hiccups (read: S.M.A.R.T errors). A SMART error is not the end of the world and it’s more like warning signs than an actual problem. More often, it will give you plenty of time to replace playing up disk(s).

So far, I’ve found that first¬†of¬†my Seagate 7200.11, 500GB – dev/ada4 with 13690 working hours has 3 different problems, each qualifying disk for replacement.

  1. Reallocated_Sector_Ct – 10
  2. Spin Retry – 2 (I could live with this one)
  3. Reported_Uncorrect – 530

Also, second Seagate 7200.11 with 8490 working hours has its own quirks:

  1. Spin Retry – 51
  2. Reported_Uncorrect – 33
  3. UDMA_CRC_Error_Count – 280 (It could be just faulty cable)

Again, not the end of this hard drive yet, but… you need to think about new one as well. Fairly quickly.

Today, arrived 1st replacement (I will never buy more than 1 disk from the same batch): Toshiba¬†DT01ACA200 – 2TB Hitachi debranded hardware with 2 years warranty Return To Base. One thing to remember with Toshiba is that in case of damaged drive, you have to deal with seller and NOT Toshiba directly as they don’t have returns facility (at least in the UK)

Drive arrived from DABS.com in nice small parcel via Signed Delivery. Disk¬†well packed, with nice, big FRAGILE ¬†letters (shame, that it was inside the grey plastic bag, but… never mind). Inside, my Toshiba in the antistatic sealed plastic¬†bag.

To check 2TB, I had to run the EXTENDED SMART TEST, via any S.M.A.R.T. monitor tool (I used¬†well tested Hirens boot 15.2 from here) and it took over 4 hours to complete. Once completed, it was ready to go in my NAS4Free box. It was way easier for me to use my other media box to connect this hard drive and run test, than actually put in my NAS, as I have too many securing screws ūüėČ but you can feel free to just replace old HDD with the new one in your NAS4Free box.

How to replace damaged drive in ZFS? Actually, it’s very easy:

  1. Once you have physically replaced your old drive with new one.
  2. Start N4F and wait until it is up and running fully.
  3. Login into web and go to DISKS->Management
  4. Press Clear Config and Import Disks
  5. You should see new hard drive – in my case it was¬†/dev/ada4 –¬†TOSHIBA DT01ACA200, still not part of ZFS my pool
  6. You can use SSH, or pick menu ADVANCE->Command or like me, just switch monitor from DVI to VGA to see output from N4F box and choose menu 6 – Shell
  7. Type (in my case) zpool replace RaidZ2 /dev/ada4, where RaidZ2 is your pool name, /dev/ada4 is the number of your new drive, in my case 4, see point no. 5)
  8. If you type zpool status RaidZ2, you should see that your zpool is re-silvering, which mean replacing missing data.
  9. When it’s finished (timewise will¬†depend on how much data you have and speed of your hard drive, for me 300GB was about 15 minutes), you should see your zpool status as ONLINE. No more degraded.

As you can see, I’ve replaced 500GB with 2TB, but my zpool is still worth of 4x 500GB. Until all disks are not 2TB, my zpool will not grow. Once all are 2TB, I will have more or less 4 x 2TB, usable around 7.2TB. Enough for a long time… At least for me ūüėČ

Posted in NAS4Free | Tagged , , , , , , , | Leave a comment

Basic4Android

Once, long time ago, in a different galaxy…¬†I tried to learn a bit of C#, after that, Java was the hot topic as well as Android development. Problem was, that I just couldn’t get the grip with object-oriented programming. Also, at the time, development for Android was based only with¬†Java on¬†Eclipse. Nothing else.

I was looking towards BASIC type programming languages, but there was only one worth looking at Basic for Android (actually Basic4Android). I start doodling on it and it was way easier than Java for Android. Of course, the forum is the first thing to look at as they are so helpful, so if you stuck somewhere, they will help you.

Worth mentioning: There is 50% discount based on the referral system, where you can buy the copy of Basic4Android via Plimus and apply discount code:

CSEZEN

At the time of writing is $119 or¬†¬£78.67 and after discount, it is $59.50 or¬†¬£39.34 for Basic4android Enterprise Version with 2 years of updates applied or¬†Basic4android Standard Version with 30% discount and 2 months of updates. Prices may change without of notice so hurry up. It’s well worth it.

Posted in Basic4Android | Leave a comment