Archive for the Category » computing «

Sunday, August 04th, 2013 | Author:

I had a power outage affect my server’s large md RAID array. Rather than let the server as a whole be down while waiting for it to complete an fsck, I had it boot without the large array so I could run the fsck manually.

However, when running it manually I realised I had no way of knowing how far it was and how long it would take to complete. This is especially problematic with such a large array. With a little searching I found the tip of adding the -C parameter when calling fsck. I couldn’t find this in the documentation however: fsckhelp showed no such option.

The option turns out to be ext4-specific, and thus shows a perfectly functional progress bar with a percentage indicator. To find the information, instead offsckhelporman fsck”, you have to inputfsck.ext4helporman fsck.ext4”. 🙂

Abelana
Sunday, August 04th, 2013 | Author:

History

Much had changed since I last mentioned my personal serverit has grown by leaps and bounds (it now has a 7TB md RAID6) and it had recently been rebuilt with Ubuntu Server.

Arch was never a mistake. Arch Linux had already taught me so much about Linux (and will continue to do so on my other desktop). But Arch definitely requires more time and attention than I would like to spend on a server. Ideally I’d prefer to be able to forget about the server for a while until a reminder email saysumthere’s a couple updates you should look at, buddy.

Space isn’t freeand neither is space

The opportunity to migrate to Ubuntu was the fact that I had run out of SATA ports, the ports required to connect hard drives to the rest of the computerthat 7TB RAID array uses a lot of ports! I had even given away my very old 200GB hard disk as it took up one of those ports. I also warned the recipient that the disk’s SMART monitoring indicated it was unreliable. As a temporary workaround to the lack of SATA ports, I had even migrated the server’s OS to a set of four USB sticks in an md RAID1. Crazy. I know. I wasn’t too happy about the speed. I decided to go out and buy a new reliable hard drive and a SATA expansion card to go with it.

The server’s primary Arch partition was using about 7GB of disk. A big chunk of that was a swap file, cached data and otherwise miscellaneous or unnecessary files. Overall the actual size of the OS, including the /home folder, was only about 2GB. This prompted me to look into a super-fast SSD drive, thinking perhaps a smaller one might not be so expensive. It turned out that the cheapest non-SSD drive I could find actually cost more than one of these relatively small SSDs. Yay for me. 🙂

Choice? Woah?!

In choosing the OS, I’d already decided it wouldn’t be Arch. Out of all the other popular distributions, I’m most familiar with Ubuntu and CentOS. Fedora was also a possibilitybut I hadn’t seriously yet considered it for a server. Ubuntu won the round.

The next decision I had to make didn’t occur to me until Ubiquity (Ubuntu’s installation wizard) asked it of me: How to set up the partitions.

I was new to using SSDs in LinuxI’m well aware of the pitfalls of not using them correctly, mostly due to their risk of poor longevity if misused.

I didn’t want to use a dedicated swap partition. I plan on upgrading the server’s motherboard/CPU/memory not too far in the future. Based on that I decided I will put swap into a swap file on the existing md RAID. The swap won’t be particularly fast but its only purpose will be for that rare occasion when something’s gone wrong and the memory isn’t available.

This then left me to give the root path the full 60GB out of an Intel 330 SSD. I considered separating /home but it just seemed a little pointless, given how little was used in the past. I first set up the partition with LVMsomething I’ve recently been doing whenever I set up a Linux box (ngempela, there’s no excuse not to use LVM). When it got to the part where I would configure the filesystem, I clicked the drop-down and instinctively selected ext4. Then I noticed btrfs in the same list. Hang on!!

But a what?

Btrfs (“butter-eff-ess”, “better-eff-ess”, “bee-tree-eff-ess”, or whatever you fancy on the day) is a relatively new filesystem developed in order to bring Linuxfilesystem capabilities back on track with current filesystem tech. The existing King-of-the-Hill filesystem, “ext” (the current version called ext4) is pretty goodbut it is limited, stuck in an old paradigm (think of a brand new F22 Raptor vs. an F4 Phantom with a half-jested attempt at an equivalency upgrade) and is unlikely to be able to compete for very long with newer Enterprise filesystems such as Oracle’s ZFS. Btrfs still has a long way to go and is still considered experimental (depending on who you ask and what features you need). Many consider it to be stable for basic usebut nobody is going to make any guarantees. And, kunjalo, everyone is saying to make and test backups!

Mooooooo

The most fundamental difference between ext and btrfs is that btrfs is aCoWorCopy on Writefilesystem. This means that data is never actually deliberately overwritten by the filesystem’s internals. If you write a change to a file, btrfs will write your changes to a new location on physical media and will update the internal pointers to refer to the new location. Btrfs goes a step further in that those internal pointers (referred to as metadata) are also CoW. Older versions of ext would have simply overwritten the data. Ext4 would use a Journal to ensure that corruption won’t occur should the AC plug be yanked out at the most inopportune moment. The journal results in a similar number of steps required to update data. With an SSD, the underlying hardware operates a similar CoW process no matter what filesystem you’re using. This is because SSD drives cannot actually overwrite datathey have to copy the data (with your changes) to a new location and then erase the old block entirely. An optimisation in this area is that an SSD might not even erase the old block but rather simply make a note to erase the block at a later time when things aren’t so busy. The end result is that SSD drives fit very well with a CoW filesystem and don’t perform as well with non-CoW filesystems.

To make matters interesting, CoW in the filesystem easily goes hand in hand with a feature called deduplication. This allows two (or more) identical blocks of data to be stored using only a single copy, saving space. With CoW, if a deduplicated file is modified, the separate twin won’t be affected as the modified file’s data will have been written to a different physical block.

CoW in turn makes snapshotting relatively easy to implement. When a snapshot is made the system merely records the new snapshot as being a duplication of all data and metadata within the volume. With CoW, when changes are made, the snapshot’s data stays intact, and a consistent view of the filesystem’s status at the time the snapshot was made can be maintained.

A new friend

With the above in mind, especially as Ubuntu has made btrfs available as an install-time option, I figured it would be a good time to dive into btrfs and explore a little. 🙂

Ingxenye 2 coming soon

Abelana
Monday, October 29th, 2012 | Author:

It appears that, in infinite wisdom, Google have a security feature that can block an application from accessing or using your google account. I can see how this might be a problem for Google’s users, in particular their GTalk futhi Gmail users. In my case it was Pidgin having an issue with the Jabber service (which is technically part of GTalk). I found the solution after a little digging. I was surprised at how old the issue was and how long this feature has existed!

To unlock the account and get your application online, use Google’s Captcha page here.

Abelana
Thursday, June 03rd, 2010 | Author:

Why I’ve left MTN

So I’ve been shopping around in a non-serious fashion in the last few months trying to figure out how best to leave MTN and how get the best deal for me. I don’t like MTN since I became anirate“, as I might call such a customer in the ISP industry. MTN’s Customer-Service Call Centre had rarely been helpful or knowledgeable on their own systems. The final straw however was when their systems let me screw myself over and Customer Service was as helpful as a dead redshirt:

I had a billing issue where, admittedly, it started of my own fault. MTN has a feature where you can call in to find out the amount owing on your account. Only, as Murphy would have it, this amount was hhayi the amount owing on the account but the last amount that was billed.

So one month my account was about R900. I called the number, mis-heard R500, paid the amount I thought I should: R500. 15 days later MTN suspended my account. No wrong done, right? Wrong.

First off, I received no notification of any kind. An sms would make the most sense, especially since it would cost MTN almost no resources: “Your account xyz is in arrears by R400. Please contact blah blah blah”. They could phone me, they could email me, something, but nothing of the sort happened. Suspend without Prejudice. Thats the best way to get the customer’s attention!

Now, not only could I not make calls and sms’s, I could not receive calls or sms’s. Further, I could not even call MTN’s toll free phone number. I had to use someone else’s phone to get to the bottom of the problem. After two days of haggling I finally found a lady kind enough to re-enable the account. Ten days later my salary goes in, I call the same number and hear a number close toR900”. I think to myself maybe I should double-check juuuust in case I mis-heard. I call again, I hear the same number again. Right. Pay the R900. Fifteen days later, my phone is suspended AGAIN. WTH?

Remember what I mentioned earlier?: “this amount was hhayi the amount owing on the account but the last amount that was billed.” So, in spite of the fact that the voice prompt specifically saysPress 3 for Balance Due; [Presses 3] ; The Total Outstanding Balance is; Nine; hundred; futhi; #whatever ; Rands; futhi; #whatever; cents”, I actually owed them R900 plus the R400 that I’d paid short the previous month. No, I do not know if MTN has fixed this. I no longer care. Since I figured this out I started waiting for paper statements to see how much was actually due. Interestingly, their paper statements were also wrong. Only they had the opposite problem: “This invoice: R1300in spite of the fact that on the next page it says opening balanceR400”, closing balanceR1300”. Pah! Is it fixed? Again, I don’t care.

I let them know I wasn’t renewing the contract and I’ve now already ported my number away to Virgin Mobile. Because I want to keep my number and port it elsewhere, the store said I could not putunsatisfactory serviceas the reason for ending the contract but that it should simply sayporting”. Apparently by putting anything else there they might notnoticethat I want it ported. WTF.

What next? (without MTN)

In my research I’ve found that contractdealsare most popular. Typically, you can get a R8000 phone for R800 per month over 24 months with R500-odd worth of airtime per month. This amounts to you paying R19 200 over a 24-month period for a phone worth R8000 which will be obsolete within 12 months. You will get some airtime every month so you might feel its not a complete loss. However you should also remember that it costs the cellular companies nothing when you make those phone calls. Profit.

There’s a better way

There are much cheaper contracts, contracts for between R50 and R200 which include cheapish phonesphones that work damned well as a phone but won’t let you play games on the train. Most of these contracts actually give you the same airtime value (sometimes more!) as what you are paying. So for R100 you might get R100 worth of airtime plus some free sms’s, and a cheapish phone. The best deals I’ve seen recently have all been for the Samsung STAR, an understated but good cell phone, available from a number of retailers for between R100 and R200 per month. In most cases the deals have included the full amount of airtime. Virgin Mobile has probably the best example here: The cost is R199 per month which includes R200 in airtime and 1000 sms’s (yebo, you read that rightone thousand!).

Virginal Service All the Way!

Another reason I’ve gone with Virgin Mobile is a little something no other service provider does: AmixedContract/Prepaid facility. I get R200 in airtime however, if I go over that, the extra just gets added to my invoice. With MTN this could go sky high without the option of a limit! With Virgin, because I asked, it has a limit of R300. However, I can still add prepaid airtime (with cellphone banking, nogal). No other service provider lets you do this!

Remember that R8000 cell phone I mentioned earlier? My plan is to get the Samsung STAR and spend less than R300 per month. I’ll have saved enough money to actually go and buy a more expensive phone (or laptop) with the cash I’ll have saved! Kunjalo, if you actually use that R800-worth of phone calls, I guess the best available deal is where you spend the R19200 anyway. Maybe at least with a more critical view on your choices you’ll save yourself a good amount of money in future. Good luck in your search for your best deal!

Abelana
Thursday, November 12th, 2009 | Author:

If you ever find yourself updating a single application in Arch Linux (a very bad idea, btw) and it upgrades readline you might end up seeing an error along the lines of:
/bin/bash: error while loading shared libraries: libreadline.so.5: cannot open shared object file: No such file or directory
Hopefully you still have a bash prompt open and you haven’t closed them all. If you still can, immediately run the following:
pacman -S bash
else you won’t be able to run bash any more because bash would still be linking to the old version of readline.

Futhi, in future, don’t run
pacman -Sy application
(python in my case)
instead, run:
pacman -Syu
which will ensure that all applications are upgraded.

Personally, I think that bash should have had a dependency set saying that it required the old specific version of readline and the same for the new bash, requiring the new version of readline. Regardless, rather play it safe. 😉

Abelana