MB, MiB, GB, GiB, what the differences are and why it causes confusion

Posted by Andrew under Rants, Servers, on 5 February 2012 @ 7:50pm.

OK so you’ve probably heard of MB and GB (MegaBytes and GigaBytes), they’re used on all sorts of devices from phones to computers. But what are they? Better still, what are MiB and GiB (MibiBytes and GibiBytes)? Well both are units for measuring memory size but they have differences. The difference is that one is calculated using base 2 and one is calculated using base 10.

For these examples we’ll stick to GigaBytes and GibiBytes for our sizes.

A GigaByte that we’re all so used to is base 10 (1,000,000,000 bytes to 1 Gigabyte).
A GibiByte that you may have heard of is in base 2 (1,073,741,824 bytes to 1 GibiByte).

gib-vs-gb-table
Table taken from http://www.pcguide.com/intro/fun/bindec.htm

So why does it cause confusion? Several reasons. Most sizes are referred to in Mega or Giga bytes so many people have been accustomed to this. For example in magazines or advertisements selling electronic equipment (tablet’s, digital cameras, etc.) and computers running Windows they’re referred to as this, but that’s where the confusion comes in, and a bit of a rant because of it.

The difference between 1GiB and 1GB is marginal, but when you increase this to several tens or thousands, it throws the scale way off. Not only that, Windows runs in base 2, but actually displays it using the prefix for base 10. So when you think it’s 1 GigaByte it’s actually showing 1 GibiByte instead but with the wrong unit! I have no idea why Microsoft decided to do this but it’s confusing as hell when you’re trying to work out the differences in file size on a program that really does show it properly. Gah!

The problem I had recently was on one of my sites, BetaArchive. I was trying to find discrepancies in the total archive size counter. It wasn’t showing the right size but we were adamant we had it right. In the end it turned out to be in the units.

Now I believe Mac and Linux use GigaBytes correctly and are also switchable from what I have read, you just have to find the option for it so Windows should have no excuse getting it right. Many people have complained to Microsoft but they’ve never done anything about it for some reason, so this problem continues to plague developers and people like myself trying to work out these discrepancies.

Suffice to say I wasted 2 hours trying to figure out where the missing data was. As a result of this cock-up I’ve even had to put a message next on the display on BetaArchive so people know it’s actually showing the right unit on the site but Windows shows the wrong unit!

I don’t doubt this will plague people for years to come as I doubt it will be fixed in Windows 8 either. I just find it hard to believe Microsoft have got away with it for this long.

 

 

Hard drive death and switch to new home server hardware at last

Posted by Andrew under Servers, on 3 January 2012 @ 9:57pm.

Happy new year to everyone, I hope you welcomed the year in style and with a stomach full of booze. I know I did!

This month has been an interesting one, not just with Christmas and New Year but also with hardware as well. A few weeks ago my server randomly reset during the night. I thought nothing of it and let is continue doing what it does, I never checked any logs. A few days later the same happened again so I started keeping an eye on it. Again another few days passed and it reset again, this then started to concern me so I did some chkdsk scans and everything came back clean. As I had other things on my mind I left it for a few days.

One day several days later I started to get backup failure e-mails so I went investigating. Hold on, the backup drive is missing, it’s just gone. I reset the server but it didn’t come back, so I tried a hard reset instead (full power off and on again). It came back. I decided it would be a nice idea to check the SMART stats and to my dismay it had “Raw Read Errors”. The drive was dying.

Several things can cause raw read errors but the most common are either controller failure or physical media failure. No matter which it was, the drive needed replacing. Luckily for me I had a spare 1TB drive which I hadn’t used and was just sat there waiting. While making the change I decided that perhaps now would be a good time to switch to my new home server hardware which has been gathering dust for the better part of 6 months.

The one part I hate about switching hardware is the OS re-installation and reconfiguration, but this time I decided to just switch the boot drive and see what happens. To my delight the OS started and worked just as it did on the old hardware with just a small wait for the new drivers to install. After that I put in the other drives and the server was fully operational without any reconfiguration! All I had to do was initialise the new backup drive, set up the new directory structure and off it went.

Needless to say I was very happy that I didn’t have to spend hours reconfiguring it all. So what are the new specs you might be asking? Nothing special.

AMD Phenom II 550 Dual Core CPU @ 3.10GHz
10GB DDR3 Corsair 1333MHz (2x4GB and 1x2GB)
ASUS M4A77T (6xSATA)
3×1.0TB Samsung
1×1.5TB Samsung
2×2.0TB Samsung

It does allow me to use hardware virtualisation if I need to though which is what the extra memory was for originally.

Now, I better not get another disk failure as I have no more spares and they’re still not cheap enough to buy new ones!

 

 

Second Home Server – I Need More Storage Space!

Posted by Andrew under Servers, on 17 October 2011 @ 9:55pm.

I’ve recently realised I’m rapidly running out of space and processing power on my current home server. It’s been running well for the last 3 years and currently has a capacity of almost 8TB, but that space is filling up. Running multiple websites, including the all huge BetaArchive, this space is primarily filled with backups of those sites. As BetaArchive continues to expand, more space is going to be needed for the archive backups.

current-server-statsStatistics from my home server

Although it looks like I have plenty of space left, I prefer to keep certain tasks kept to one drive. For example I don’t mix my main data with archive backups, or media with betas, etc. This keeps the layout clean and makes things easier to find (or lose!).

The BA archive backup currently occupies a little under 2.3TB spanned over a 2TB disk and a 1.5TB disk. The data is split between them with everything except PC Beta Operating Systems on one drive, and those being on another. Our FTP admin has recently released information that means another 1TB of data will be coming to the site in the near future. For this reason it means I have to prepare the extra space for this data so I will have a backup of it.

The problem with the current server is that not only is it suffering from being under powered, due to firstly having an older CPU, and lack of RAM (2GB doesn’t go very far, and the motherboard has issues taking any more than that due to faulty hardware), but there are no more spare SATA slots for more hard drives. I bought a replacement AMD Phenom II X2 and motherboard some months ago but it’s not yet been put into service. Even more recently I got myself a second 4U rack case to house it.

new-serverBottom: Current Server. Top: New Server

This new board now has 10GB of DDR3 memory (2x4GB and 1x2GB DIMMs) and 6 SATA-II slots for additional hard drives. My original plan was to use this as an ESXi or Hyper-V server but I’m not so sure now. I’ll probably stick with the single OS solution as I’m not familiar enough with ESXi to risk using it on a production system. If anything I would use Hyper-V.

I have 2 hard drives ready to go in it. An older Samsung F1 1TB and a brand new and currently untouched Samsung F4 2TB. I can instantly bump my storage space up to 11TB when I bring this server online. I hope to replace all of the 1TB drives with 2TB’s as I go along, retiring the 1TB’s to other tasks.

So what will I use the new server for? To begin with I may just move all of the BetaArchive archive backups to it, and use it as an offline server for the time being. Running two servers will be higher in electricity costs so if possible I want to reduce that until it’s necessary. It costs about £13 a month to run a single server at the moment (130Watts at 14.7p/kWh).

As I have some spare time later this week I will see what I can do to bring it online and get it running a copy of a server OS. I have a couple of beta keys I can use temporarily while I play around. I won’t keep the server online 24/7 though as I still need to wait for the fan extension cables. I can’t safely run the server 24/7 without risking damage from the heat.

Right that’s probably enough talk about servers for now, I’ll make another update during the week if I get around to having a play around.