Monday, January 10, 2011

The 10 best Android hacks


The web’s massed fanboy armies will debate the relative merits of iOS and Android until the apocalypse, but there’s no denying Google’s OS wins out when it comes to customisation – and, if you’ve taken the plunge and rooted your device, then a whole load more options will become available.

It sounds like a complex procedure but, for virtually all Android handsets, it’s surprisingly easy: our own Technical Editor, Darien Graham-Smith, explained how to do it back in September, and instructions for major handsets – such as the HTC DesireSamsung Galaxy S and Sony Ericsson Xperia X10 are easy enough to find, although you’ll be taking your phone and, perhaps, your warranty, into your own hands if you proceed.

Still, that’s not to say that you need a rooted handset to take advantages of some of these tweaks – here are ten of our favourite Android hacks and tricks, rooted or not:


Replace your car’s satnav system

This will only work if you’ve got a phone that can connect over a TV-out cable – that’ll restrict you to a mere handful of handsets, including the Samsung Galaxy S, HTC EVO 4G and Droid Incredible, which is used in this video – and a car that’ll display the signal on its screen.

If you tick those boxes, though, you could be in for a money-saving treat. Why invest in a satnav, after all, when you could use Google’s own software?

It’s got undoubted pedigree: we put it through real-world road tests in the summer against many of its rivals and found it to be the best satnav option.

Satnav’s only the tip of the iceberg. Connect your phone to access your music collection, read your Twitter feed, check the latest headlines or perform any other function on your dashboard.

While Android in cars has been mooted before, no concrete models have appeared, so this is the next best thing.


Run Android on your old iPhoneApple iPhone 3G

If you’ve still got an iPhone 2G or 3G gathering dust, it can be hard to know what to do with it – after all, you’ve likely replaced that older model with a snazzy new iPhone 4.

If you’d like to experience the unrestricted pastures of Android, though – and perhaps try out apps that Steve Jobs has deemed unacceptable, such as the Wikileaks cables – then follow these steps, which begin with jailbreaking your phone.

You’re not restricted to installing Android on an old iPhone, either.

Intrepid developers have busily ensured that a whole range of devices can be hacked to run Google’s OS: from the Windows Mobile-running HTC HD2 to an old netbook.


Overclock your handset

You’ll need to have rooted before trying this trick, but it’s worth it if your phone struggles when multi-tasking or running intensive applications.

Of course, as with a desktop PC, overclocking a phone comes with risks.

The processor inside your handset’s been designed to run at a specific speed and, without any active cooling inside its chassis, running the chip at a faster pace will generate additional heat and use more power.

The versatility of these apps does mean that it’s possible to combat these symptoms by underclocking your phone’s processor, saving battery power and potentially prolonging the chip’s life in the process.


Play classic games

One potentially dubious benefit of Android’s open approach is that its market is full of software emulators for classic games consoles: a quick scan on AppBrain reveals software like SNesoid, GameBoid and Ataroid – apps that wear their retro allegiances firmly on their sleeves.
NES controller
While these tools occupy some particularly murky legal ground, that hasn’t stopped several developers creating apps to download ROMs – the software needed to play classic games. Some have been even more imaginative, with one intrepid Dell Streak owner attaching a NES controller to his device for more realistic retro gaming action.

Install Ubuntu

Why settle for just only open-source OS on your device? We suspect that this particular trick won’t work if you own older and less powerful Android devices such as the HTC Hero, but owners of newer, faster handsets might want to take a gander at this guide.

It’s an impressive trick – just imagine pulling out your Nexus One at a (very, very geeky) party and booting into Ubuntu. As neat as it is, we’re struggling to think of practical uses for this trickery.

After all, Ubuntu isn’t designed for touch interfaces and small smartphone screens could be problematic, too.

Change your look

LauncherPro
Android is the most versatile mobile OS around. Don’t believe us? Take a look at the sheer number of apps, themes and graphics that are available for customising your phone.

Numerous apps are designed to replace Android’s stock front-end or manufacturer-provided software, with tools such as LauncherProHome++ and HelixLauncher just three of many in the Market.

That’s just the start. Basic modifications like wallpaper changes can be livened up with animated backgrounds, and new icons can be downloaded if you don’t like the standard ones included with your home screen replacement.

Tools such as Beautiful Widgets have their own communities churning out hundreds of stylish skins for its software.

It’s also worth taking a gander at some of the home screens posted on Reddit’s Android forum: with examples such as thisthis and this regularly making the rounds, it’s no surprise that Google’s OS is doing so well for itself.


Install root-only apps

Rooting your phone opens it up to a whole new world of options, not least the chance to install apps that aren’t available in the regular Market.

Plenty of these allow extra control over the behind-the-scenes operations of your phone: some provide quick booting options, others allow your system to access extra memory, and more permit developers to access and edit the SQL databases used by most standard apps.

Plenty of root apps prove themselves useful in other ways. Screenshot tools will prove invaluable if you’re used to the faff of getting screenshots from a stock Android phone, which involves installing the Android SDK and jumping through several dozen hoops.

Backup tools, Wi-Fi tethering and battery-management and conservation utilities are all commonplace, too.

Root apps tend to be on the geeky end of the spectrum, but they’re very useful.

Control your media centre

Gmote
Having a smartphone means that your media collection needn’t be limited to your PC. Install an app like Gmote alongside its PC server software and you’ll see what we mean: by using Wi-Fi streaming it’ll grant access to your entire media collection.

Its slick interface makes navigating your media collection a doddle and a couple of options mean that you can choose to play files on your PC or on your phone.

It’s also possible to switch to a touchpad-style interface that allows you to take control of your PC from your touchscreen.


Open your garage door

Yes, seriously. It’s the work of one imaginative Android owner, and it’s brilliant.

Get the latest Android versions, fast

Every Android user is familiar with the seemingly endless waiting that punctuates every OS update: while Google might announce that the latest version is available, handset owners still have to twiddle their thumbs while their manufacturer and phone network tweak the software and add plenty of crapware before releasing it to paying customers.

If you’ve rooted your phone, though, then you don’t have to go through any of that hassle; instead, merely wait for an eager developer to release a ROM of the latest Android build and you’re good to go. It certainly beats waiting months for HTC to release the 2.1 update for the Hero.

Read more: The 10 best Android hacks | PC Pro blog http://www.pcpro.co.uk/blogs/2011/01/02/the-10-best-android-hacks/#ixzz1A3X8F2ag

Saturday, January 8, 2011

Introduction to RAID

RAID is one of those technologies that has really revolutionized storage. In this article, we’ll review the six most common single RAID levels and describe how each works and what issues surround them.

Introduction
One of the most common techniques to improve either data reliability or data performance (or both) is called RAID (Redundant Array of Inexpensive Disks).

The concept was developed in 1977 by David Patterson, Garth Gibson, and Randy Katz as a way to use several inexpensive disks to create a single disk from the perspective of the OS while also achieving enhanced reliability or performance or both.


Before anyone erupts and says that RAID does not stand for “Redundant Array of Inexpensive Disks”, let me start by stating that was the original definition.

Over time, the definition has become more commonly known as “Redundant Array of Independent Disks” perhaps so the word “inexpensive” isn’t associated with RAID controllers or disks.

Personally I use the original definition but regardless, either definition means that the disks are independent of one another.

Feel free to use either definition since it won’t change the content of this article.

Now, back to our discussion of RAID.
When the original paper was issued, five different RAID levels or configurations were defined. Since that time other RAID configurations have been developed including what are referred to as “hybrid” RAID configurations.

The RAID Advisory Board (RAB) was created to help advise the IT community on the defined RAID configurations and to help the creation of new RAID configuration definitions.

While it is not an organization that creates legally binding standards and labeling, it does help in clarifying what the RAID levels mean and what is commonly accepted in the community.

There was a time where companies were creating very strange RAID configurations and using strange labels, causing great confusion.

The RAB has helped to reduce the proliferation of “weird” RAID configurations and labeling and standardize the meaning of various RAID levels.

In this article I want to review the seven most common standard RAID configurations. But I will also very briefly touch on some of the hybrid RAID configurations.

For each RAID level, I will describe how it works as well as the configuration’s particular pros and cons.

However, before starting I want to clarify one thing: RAID is not meant as a replacement for backups. RAID can help improve data reliability which really means data availability (improving uptime for data) and/or data performance (I/O performance).

It is not intended as a replacement for backups or keeping multiple independent copies of your data.

RAID Configurations


As mentioned above, there were five original RAID levels or configurations that were defined but others have been developed since that original article.

In RAID terminology each distinct RAID configuration is given a number which can also be called a RAID “level”.

The core RAID configurations are listed as: RAID-0, RAID-1, RAID-2, RAID-3, RAID-4, RAID-5, and RAID-6.


RAID-0
This RAID configuration is really focused on performance since the blocks are basically striped across multiple disks.

Figure 1 from wikipedia (image by Cburnett) illustrates how the data is written to two disks.
325px-RAID_0.svg.png
Figure 1: RAID-0 layout (from Cburnett at wikipedia under the GFDL license)

In this illustration, the first block of data, A0, is written to the fist disk, the second block of data, A1, is written to the second disk, the third block of data, A3, is written to the first disk, and so on.

If the I/O is happening fast enough data blocks can be written almost simultaneously (i.e. A0 and A1 are written at just about the same time).

Since the data is broken up into block sized units between the disks, it is commonly said that the data is striped across the disks.

As you can see, striping data across the disks means that the overall write performance of the disk set is very fast, usually much faster than a single disk.


Reading from a RAID-0 group is also very fast. A read request comes in and the RAID controller, which controls the placement of data, knows that it can read A0 and A1 at the same time since they are on separate disks, basically doubling the potential read performance relative to a single disk.


You can have as many disks as you want in a RAID-0 array (a group of disks in a RAID-0 configuration).

However, one of the downsides to RAID-0 is that there is is no additional data redundancy provided by RAID-0 (it is all focused on performance).

No data parity is computed and stored meaning that if you lose a disk in a RAID-0 array, you will lose access to all of the data in the array.

If you can bring the lost disk back into the array without losing any data on it, then you can recover the RAID-0 array, but this is a fairly rare occurrence.


Consequently, we can see that RAID-0 is focused solely on performance with no additional data redundancy beyond the redundancy in a single disk.

This affects how RAID-0 is used. For example, it can be used in situations where performance is paramount and you have a copy of your data elsewhere or the data is not important.

A classic usage case is for scratch space where data is written while an application is running but is not needed once the application is done and the final output is copied to a more resilient storage device.

If a scratch space disk is lost while the application is running, you can rebuild the RAID-0 array with one fewer drives, and rerun the application.


The capacity and failure rate of a RAID-0 array is the fairly simple to compute. The capacity is computed as,
Capacity = n * min(disk sizes)

where n is the number of disks in the array and min(disk sizes) is the minimum common capacity across the drives (this indicates that you can use drives of different sizes).

This equation also means that RAID-0 is very capacity effective since it doesn’t waste any space for parity or any other error correction. It uses all of the space for data focusing on performance.

The failure rate is a little more involved but can also be estimated.
MTTFgroup = MTTFdisk / n

where MTTF is the Mean Time To Failure and “group” refers to the RAID-0 array and “disk” refers to a single disk.

So as you add disks, you greatly reduce the MTTF for the RAID-0 array. Having two disks decreases the MTTF by half.

Three disks reduces the MTTF by a factor of 3, and so on. So you can tell why people are reluctant to use RAID-0 for file systems where data availability and reliability is important.

But, RAID-0 is the fastest RAID configuration and has the best capacity utilization of any RAID configuration discussed in this article.

Table 1 below is a quick summary of RAID-0 with a few highlights.


Table 1 - RAID-0 Highlights
Raid Level Pros Cons Storage Efficiency Minimum Number of disks
RAID-0
  • Performance (great read and write performance)
  • Great capacity utilization (the best of any standard RAID configurations)


  • No data redundancy
  • Poor MTTF

100% assuming the drives are the same size 2
RAID-1
RAID-1 is almost the exact opposite of RAID-0 because it uses multiple drives that are mirrors of one another.

Typically two drives are used in RAID-0 but three drive RAID-1 configurations are becoming more common.

RAID-1 takes an incoming block of data to one drive and creates a mirror image (copy) of it on a second drive.

So RAID-1 doesn’t compute any parity of the block - it just copies the entire block to a second drive.

Figure 2 from wikipedia (image by Cburnett) illustrates how the data is written to two disks in RAID-1.
325px-RAID_1.svg.png
Figure 2: RAID-1 layout (from Cburnett at wikipedia under the GFDL license)



In this illustration when block A1 is written to disk 0, the same block is also written to disk 1. Since the disks are independent of one another, the write to disk 0 and the write to disk 1 can happen at the same time.

However, when the data is read, the RAID controller can read block A1 from disk 0 and block A2 from disk 1 at the same time since the disks are independent.

So overall, the write performance of a RAID-1 array is the same as a single disk, and the read performance is actually faster from a RAID-1 array relative to a single disk.


The strength of RAID-1 lies in the fact that disks contains copies of the data. So if you lose disk 0, the exact same data is also on disk 1.

This greatly improves data reliability or availability.

The capacity of RAID-1 is the following:
Capacity = min(disk sizes)

meaning that the capacity of RAID-1 is limited by the smallest disk (you can use different size drives in RAID-1).

For example, if you have a 500GB disk and a 400GB disk, then the maximum capacity would be 400GB (i.e. 400GB of the 500GB drive is used as a mirror, and the remaining 100GB is not used).

RAID-1 has the lowest capacity utilization of any RAID configuration.




The reliability or probability of failure is also described in wikipedia. Since the disks are mirrors of one another but still independent, the probability of having both disks fail, leading to data lose, 
is the following:





P(dual failure) = P(single drive)2

So the probability of failure of a RAID-1 configuration is the square of the failure probability of a single drive.

Since the probability of failure of a single drive is less than 1, that means that the failure of a RAID-1 array is even smaller than the probability of failure of a single drive.


The reference has a more extensive discussion about the probability of failure but in general, the probably is fairly low.


One might be tempted to use RAID-1 for storing important data in place of backups of the data.

While RAID-1 improves data reliability or availability, it does not replace backups. If the RAID controller fails, or if the unit containing the RAID-1 array suffers some sort of failure, then the data is not available and may even be lost.

Without a backup you don’t have a copy of your data anymore. However, if you make a backup of the data, you would have a copy. The moral of the tale is - make real backups and don’t rely on 
RAID-1.




Table 2 below is a quick summary of RAID-1 with a few highlights.


Table 2 - RAID-1 Highlights
Raid Level Pros Cons Storage Efficiency Minimum Number of disks
RAID-1
  • Great data redundancy/availability
  • Great MTTF


  • Worst capacity utilization of single RAID levels
  • Good read performance, limited write performance

50% assuming two drives of the same size 2
RAID-2
This RAID level was one of the original five defined, but it is no longer really used. The basic concept is that RAID-2 stripes data at the bit level instead of the block level (remember that RAID-0 stripes at the block level) and uses a Hamming Coding for parity computations.

In RAID-2, the first bit is written on the first drive, the second bit is written on the second drive, and so on. Then a Hamming-code parity is computed and either stored on the disks or on a separate disk.

With this approach you can get very high data throughput rates since the data is striped across several drives, but you also lose a little performance because you have to compute the parity and store it.


A cool feature of RAID-2 is that it can compute single bit errors and recover from them. This prevents data errors or what some people call “bit rot”.

For an overall evaluation of RAID-2, there is this link.


According to this article hard drives added error correction that used Hamming codes, so using them at the RAID level became redundant so people stopped using RAID-2.


RAID-3
RAID-3 uses data striping at the byte level and also adds parity computations and stores them on a dedicated parity disk.

Figure 3 from wikipedia (image by Cburnett) illustrates how the data is written to four disks in RAID-3.
675px-RAID_3.svg.png
Figure 3: RAID-3 layout (from Cburnett at wikipedia under the GFDL license)




This RAID-3 layout uses 4 disks and stripes data across three of them and uses the fourth disk for storing parity information.





So a chunk of data “A” has byte A1 written to disk 0, byte A2 is written to disk 1, and byte A3 written to disk 3.





Then the parity of bytes A1, A2, and A3 is computed (this is labeled as Ap(1-3) in Figure 3) and written to disk 3.





The process then repeats until the entire chunk of data “A” is written. Notice that the minimum number of disks you can have in RAID-3 is three (you need 2 data disks and a third disk to store the parity).



RAID-3 is also capable of very high performance while the addition of parity gives back some data reliability and availability compared to a pure striping model ala’ RAID-0.

Since the number of disks in a stripe is likely to be smaller than a block all of the disks in a byte-level stripe are accessed at the same time improving read and write performance.

However, the RAID-3 configuration some possible side effects.


In particular, this link explains that RAID-3 cannot accommodate multiple requests at the same time.

This results from the fact that a block of data will be spread across all members of the RAID-3 group (minus the parity disk) and the data has to reside in the same location on each drive.

This means that the disks (spindles) have to be accessed at the same time, using the same stripe, which usually means that the spindles have to be synchronized.

As a consequence, if an I/O request for data chunk A comes into the array (see Figure 3), all of the disks have to seek to the beginning of the chunk A and read their specific bytes and send it back to the RAID-3 controller.

Any other data request, such as that for a data chunk labeled B in Figure 3 is blocked until the request for “A” has completed because all of the drives are being used.

The capacity of RAID-3 is the following:
Capacity = min(disk sizes) * (n-1)

meaning that the capacity of RAID-3 is limited by the smallest disk (you can use different size drives in RAID-3) multiplied by the number of drives n, minus one.

The “minus one” part is because of the dedicated parity drive.


RAID-3 has some good performance since it is similar to RAID-0 (striping), but you have to assume some reduction in performance because of the parity computations (this is done by the RAID controller).

However, if you lose the parity disk you will not lose data (the data remains on the other disks). If you lose a data disk, you still have the parity disk so you can recover data.

So RAID-3 offers more data availability and reliability than RAID-0 but with some reduction in performance because of the parity computations and I/O.

More discussion about the performance of RAID-3 is contained at this link.


RAID-3 isn’t very popular in the real-world but from time to time you do see it used.

RAID-3 is used in situations where RAID-0 is totally unacceptable because there is not enough data redundancy and the data throughput reduction due to the data parity computations is acceptable.

Table 3 below is a quick summary of RAID-3 with a few highlights.


Table 3 - RAID-3 Highlights
Raid Level Pros Cons Storage Efficiency Minimum Number of disks
RAID-3
  • Good data redundancy/availability (can tolerate the lose of 1 drive)
  • Good read performance since all of the drives are read at the same time
  • Reasonable write performance but parity computations cause some reduction in performance
  • Can lose one drive without losing data


  • Spindles have to be synchronized
  • Data access can be blocked because all drives are accessed at the same time for read or write

(n - 1) / n where n is the number of drives 3 (have to be identical)
RAID-4

RAID-3 improved data redundancy by adding a parity disk to add some reliability. In a similar fashion, RAID-4 builds on RAID-0 by adding a parity disk to block-level striping.





Since the striping is now down to a block level, each disk can be accessed independently to read or write data allowing multiple data access to happen at the same time.





Figure 4 below from wikipedia (image by Cburnett) illustrates how the data is written to four disks in RAID-4.

675px-RAID_4.svg.png
Figure 4: RAID-4 layout (from Cburnett at Wikipedia under the GFDL license)



In this layout, data is written in block stripes to the first three disks (disks 0, 1, and 2) while the third drive (disk 3) is the parity drive.

The parity of the blocks across the drives is computed by the RAID controller and stored on the dedicated parity drive.

In the figure The parity for A1, A2, and A3 is listed as Ap on the parity drive.


The dedicated parity drive becomes a performance bottleneck in RAID-4, particularly for write I/O.

Since RAID-4 has block level striping, you can write to blocks A1 and B2 at the same time since they are on different disks.

However, the parity for both blocks has to be written to the same drive which can only accommodate a single write I/O request at a time.

Consequently, one of the parity writes (A1 parity or B2 parity) is blocked and the write I/O performance is reduced.

For more on the performance of RAID-4, please see this link.

The capacity of RAID-4 is the following:
Capacity = min(disk sizes) * (n-1)

meaning that the capacity of RAID-4 is limited by the smallest disk (you can use different size drives in RAID-4) multiplied by the number of drives n, minus one.

The “minus one” part is because of the dedicated parity drive.

However, it is recommended you use drives that are the same size in RAID-4.


RAID-4 improves on the redundancy of RAID-0, which has zero data redundancy, by adding a parity disk.

You can lose one drive without losing data. For example you could lose the parity disk without losing data or you could lose one of the data disks without losing data.

But the introduction of the single dedicated parity drive has reduced write performance relative to RAID-0.

However, if the loss of write performance of RAID-4 is acceptable it does give you more data redundancy than RAID-0.


RAID-4 was the last RAID configuration defined in the original RAID paper.

In the real-world, RAID-4 is rarely used because RAID-5 (see next sub-section) has replaced it.




Table 4 below is a quick summary of RAID-4 with a few highlights.



Table 4 - RAID-4 Highlights
Raid Level Pros Cons Storage Efficiency Minimum Number of disks
RAID-4
  • Good data redundancy/availability (can tolerate the lose of 1 drive)
  • Good read performance since all of the drives are read at the same time
  • Can lose one drive without losing data


  • Single parity disk (causes bottleneck)
  • Write performance is not that good because of the bottleneck of the parity drive

(n - 1) / n where n is the number of drives 3 (have to be identical)
RAID-5
RAID-5 is similar to RAID-4 but now the parity is distributed across all of the drives instead of using a dedicated parity drive.

This greatly improves write performance relative to RAID-4 since the parity is written on all of the drives in the RAID-5 array.

Figure 5 below from wikipedia (image by Cburnett) illustrates how the data is written to four disks in RAID-5.
675px-RAID_5.svg.png
Figure 5: RAID-5 layout (from Cburnett at wikipedia under the GFDL license)




In this layout, the parity blocks are labeled with a subscript “p” to indicate parity. Notice how they are distributed across all four drives.





The blocks that line up (one block per drive) are typically a “stripe”. In Figure 5 the blocks in a stripe are all the same color.





The data stripe size is simply the following:

Data stripe size = block size * (n-1)

where n is the number of drives in the RAID-5 array. Inside a stripe there is a single parity block and all other blocks are data blocks.

Anytime a block inside the stripe is changed or written to, the parity block is recomputed and rewritten (this is sometimes called the read-modify-write process).

This process can add overhead reducing performance.


RAID-5 also has some write performance problems for small writes that are smaller than a single stripe since the parity needs to be computed several times which eats up computational capability of the RAID controller.

As mentioned previously the read-modify-write process that must be followed happens much more often in this case.

The capacity of RAID-5 is very similar to RAID-4 and is the following:
Capacity = min(disk sizes) * (n-1)

meaning that the capacity of RAID-5 is limited by the smallest disk (you can use different size drives in RAID-5) multiplied by the number of drives n, minus one.

The “minus one” part is because of the parity block per stripe.


With RAID-5 you can lose a single drive and not lose data because either the data or the parity for the missing blocks on the lost drive can be found on the remaining drives.

In addition, many RAID controllers allow what is called a hot-spare drive. This drive is typically part of the RAID array but is initially not used for storing data.

If the RAID group loses a drive, the hot-spare is immediately brought into the RAID group by the controller.


In the case of RAID-5, the controller immediately starts redistributing data and parity blocks to this new drive.

To do this, the initial drives in the RAID-5 array have to have all blocks read and the RAID controller has to recompute parity or rebuild missing data blocks.

This combination means that it can take quite a bit of time to fail-over data to the hot-spare drive.

The nice thing about having a hot-spare drives is that typically the fail-over process happens automatically so there is almost no delay in incorporating the hot-spare drive.


RAID-5 has been used for a very long time and during this time the data availability and redundancy has been very good.

However, there is a new phenomenon that impacts RAID-5 that has been explained in various article around the web such as this one.

Basically the capacity of drives is growing quicker than the Unrecoverable Read Error (URE) rate of drives to the point where losing a drive in a RAID-5 array and recovering it to a hot-spare drive is almost guaranteed to lead to a URE which means that the RAID-5 array will be lost and the data has to be restored from a backup.

However, this is the subject for another article.


There is no shortage of articles about RAID-5 on the web. You will see some strong opinions both for and against RAID-5 based on usage cases.

Be sure to understand the application used when reading about both pros and cons of RAID-5.

A reasonable overview of the trade-offs of RAID-5 is this article.

Table 5 below is a quick summary of RAID-5 with a few highlights.


Table 5 - RAID-5 Highlights
Raid Level Pros Cons Storage Efficiency Minimum Number of disks
RAID-5
  • Good data redundancy/availability (can tolerate the lose of 1 drive)
  • Very good read performance since all of the drives can be read at the same time
  • Write performance is adequate (better than RAID-4)
  • Can lose one drive without losing data


  • Write performance is adequate (better than RAID-4)
  • Write performance for small I/O is not good at all

(n - 1) / n where n is the number of drives 3 (have to be identical)
RAID-6
As mentioned previously, there is a potential problem with RAID-5 for larger capacity drives and a larger number of them.

RAID-6 attempts to help that situation by using two parity blocks per stripe instead of RAID-5’s single parity block.

This allows you to lose two drives with losing any data. Figure 6 below from wikipedia (image by Cburnett) illustrates how the data is written to four disks in RAID-6.
800px-RAID_6.svg.png
Figure 6: RAID-6 layout (from Cburnett at wikipedia under the GFDL license)

In this figure, the first parity block is noted with as subscript “p” such as Ap. The second parity block in a stripe is noted with a subscript “q” such as Aq.

The use of two parity blocks reduces the useable capacity of a RAID-6 as in the following:
Capacity = min(disk sizes) * (n-2)

meaning that the capacity of RAID-6 is limited by the smallest disk (you can use different size drives in RAID-6) multiplied by the number of drives n, minus two.

The “minus two” part is because of the two parity blocks per stripe.


Computing the first parity block, p, is done in the same fashion as RAID-5. However, computing the q parity block is more complicated as explained here.

This means that the write performance of a RAID-6 array can be slower than a RAID-5 array for a given level of RAID controller performance.

However, read performance from a RAID-6 is just as fast as a RAID-5 array since reading the parity blocks is skipped. But in exchange for worse performance, RAID-6 arrays can tolerate the lose of two drives while RAID-5 can only tolerate the lose of a single drive.

Coupled with larger drives and larger drive counts, this means that larger RAID-6 arrays can be constructed realtive to RAID-5 arrays.

Table 6 below is a quick summary of RAID-6 with a few highlights.


Table 6 - RAID-6 Highlights
Raid Level Pros Cons Storage Efficiency Minimum Number of disks
RAID-6
  • Excellent data redundancy/availability (can tolerate the lose of 2 drives)
  • Very good read performance since all of the drives can be read at the same time
  • Can lose two drives without losing data


  • Write performance is not that good - worse than RAID-5
  • Write performance for small I/O is not good at all
  • more computational horsepower is required for parity computations

(n - 2) / n where n is the number of drives 4 (have to be identical)

Hybrid RAID Levels

As you can see, there are some limitations to each of the standard RAID levels (0-6). Some of the them have great performance (RAID-0) but pretty awful data availability or redundancy while others have very good data availability and redundancy (RAID-6) but the performance is not so hot.

So as you can imagine, people started to wonder if they couldn’t combine RAID levels to combine features to perhaps achieve better performance while still having very good data redundancy and availability.

This lead to what people called Hybrid RAID Levels or what is more commonly called Nested RAID levels.



The topic of Nested RAID levels is fairly lengthy so I will save that for another article. But the basic concept is to combine RAID levels in some fashion.

For example, a common configuration is called RAID 1+0 or RAID-10. The first number (the furthest to the left) refers to the “bottom” or initial part of the RAID array.

Then the second number from the left refers to the “top” level or the RAID array. The top level RAID uses the bottom level RAID configurations as building blocks.


In the case of RAID-10, the approach is to use multiple pairs of drives at the lowest level (RAID-1) and then to combine them using RIAD-0.

This retains the goodness of RAID-1 for data availability and redundancy while gaining back some performance from RAID-0 striping.


Summary

This wraps our introduction to RAID. For some people it may be new and for many it will be review.





Now that we’ve covered the basics, in coming articles we will be exploring Nested-RAID more in depth, including RAID-01 RAID-5, RAID-6 and RAID-10 configurations.





Have questions about RAID or topics you’d liked to see covered? Post them in the comments and we’ll try to incorporate them as deep dive into redundant arrays. 

4 Open Source Applications for the Visually Impaired

Eye Test

When you're visually impaired, getting around the Internet isn't always easy. Fortunately, the open source community takes accessibility very seriously.

If you or someone you know needs assistive computer software, here are four open source applications you'll want to check out.

Qwitter - Orignally designed as a Twitter client for the visually impaired, Qwitter has become a more fully-formed application that works across the internet with most screen readers, including the open source project NVDA for Windows.

Use it to search Bing, interact with Captcha-completer service Solona, manipulate your Google Voice account, and more.

Orca - This screen reader is bundled with the GNOME desktop (version 2.16 and newer), and ships with the Open Solaris, Ubuntu, and Fedora operating systems, but it is also available for separate download.

It supports the OpenOffice word processing suite and Firefox browser, and the Java platform, making Orca one of the most versatile open source screen readers available.

It also works with an ever-growing assortment of stand-alone apps.

WebAnywhere - Unlike screen readers that must be installed on a PC in order to work correctly, this Web-based tool requires no installation.

WebAnywhere works on any computer with a sound card, so visually impaired people can use publicly accessible PCs (at the airport or library, for instance) or borrow a friend's laptop hassle-free.

The vOICe for Android - Designed specifically for Android phones, this app uses sonic augmented reality with a device's built-in camera to provide geo-spatial feedback to the user via sound.

Check the app's website for full details on how it works, or download it for free in the Android Market by searching "seeingwithsound."

Checking out JQuery Mobile

JavaScript
In a seemingly short period of time, JavaScript has gone from a form-validation tool to a game changer.

Having my head buried into SDK development for a number of years, I have taken relatively small notice of JavaScript until this past 18 months.

It’s no longer just a scripting language for pulling off Web2.0 tricks but a mainstream language for building full-blown applications.

In the mobile world, one example of this is WebOS, which came onto the scene with an innovative and flexible user interface, driven by JavaScript, HTML and CSS.

While WebOS has a long way to go to prove that it is more than just a “drive-by operating system”, one thing is for sure, JavaScript is here for a good while.

And WebOS isn’t the only driver — there are other champions of JavaScript to note.

PhoneGap has become a player in the mobile app development scene as developers are leveraging their web skills to build mobile applications with an open source, royalty free framework.

And the folks at Appcelerator have some non-trivial venture funds behind them and have gone through a number of iterations all built around the JavaScript/HTML/CSS model.

While their approach has shifted a bit over time, they are committed to the rapid development capabilities that JavaScript can enable.

So, it would seem that web technologies have a prominent place in mobile as WebOS, PhoneGap and Appcelerator have each taken their own approach to bending web technologies to their mobile will.

But what about true web applications — where do they fit in?

While there are some techniques available for making a “normal” web page mobile friendly — things like setting view-port and scaling the page appropriately to make sure that the page renders nicely on a mobile device, the truth is that the WebKit browser engine, now standard in many major mobile platforms, renders content quite nicely, mobile-optimized or not.

So, if web content renders nicely on a mobile browser, do we care about building web apps “for mobile” at all?

Though the question alone is worthy of debate over a beverage of your choice, it is sometimes helpful to have a look at the market itself to find our answer. And we need not look any further than the folks at JQuery.com.

A Familiar Player
The JQuery project has brought advanced web functionality to the masses and they are now getting into mobile in a big way.

In fact, the impact of this mobile effort might make some think that the tail is wagging the dog here as the JQuery team is introducing JQuery Mobile.

The JQuery mobile effort is not only introducing new capabilities for mobile developers but the effort is causing the JQuery team to go back to their core library and revisit architectural and performance characteristics.

All of this is good news for developers, web users, and now mobile users also.

The JQuery Mobile project encompasses some major functionality and is currently at the Alpha 2 Release.

The balance of this article takes a look at some of the goals of this project and in upcoming articles we will demonstrate some of JQuery’s major features.

The basics
The JQuery team is targeting all major mobile browser options. Patterned after Yahoo’s browser grading system, JQuery Mobile aims to offer their complete array of functionality on “A” level browsers.

Most of the platforms in the list have native browsers capable of advanced functionality, however in some cases the better option is currently delivered by the Opera browser.

In case you are wondering just how many “major” mobile platforms exist today, here is the list of the primary targets world-wide:
  • iPhone/iPod/iPad
  • Symbian Series 60
  • Symbian UIQ
  • Symbian Platform (3.0)
  • BlackBerry OS (primarily Torch and later)
  • Android
  • Windows Mobile (sort of)
  • webOS
  • bada
  • Maemo
  • MeeGo
A primary objective of JQuery Mobile is to create a library where truly cross-platform applications may be written, eliminating (OK, reducing) the need for platform-specific applications.

If they can deliver on this it will lower the barrier to entry for many software vendors struggling to bring their products to the mobile scene.

A viable UI framework based on web tools enables virtually every software vendor to access the mobile space.

Another winner in this trend is the tablet class of device as tablets look to play an increasingly important role in both the consumer and commercial spaces.

The availability of a clean, consistent web-based application presentation framework will only accelerate the penetration tablet devices enjoy.

So, what all does JQuery include? Lots. Here is a brief list of some features of JQuery mobile.
  • Built on the core JQuery library
  • Quick runtime download via a small footprint, similar to JQuery core
  • Utilizes HTML5 based markup for simplifying the development process
  • Relies upon progressive enhancement to deliver high quality features on capable browsers and degrade acceptably on lower-end browsers
  • Built with screen readers and other accessibility features in mind from the outset
  • Accepts diverse input devices — touch, mouse and cursor input methods
  • Upgrades HTML Form elements with new, snazzy controls
  • Customizable with powerful theming framework
One of the nicest features of developing mobile applications with JQuery Mobile is that you don’t need to do 100% of your testing on the small screen of a phone.

Because the mobile browsers are often built upon WebKit, developers can use Safari, the WebKit nightly build, or Chrome to proto-type applications. Of course, don’t ignore the mobile browser altogether!

I am increasingly finding myself testing web pages in Safari due to this high level of compatibility.

Speaking of testing, in our next article we will build a basic application, exercising a multi-page application, highlighting some of the UI elements included in the JQuery Mobile library.

Until then, you can read more about JQuery Mobile directly at http://jquerymobile.com.

Friday, January 7, 2011

Car Theft by Antenna

Researchers beat automatic locking and ignition systems.

Car thieves of the future might be able to get into a car and drive away without forced entry and without needing a physical key, according to new research that will be presented at the Network and Distributed System Security Symposium next month in San Diego, California.

The researchers successfully attacked eight car manufacturers' passive keyless entry and start systems—wireless key fobs that open a car's doors and start the engine by proximity alone.

Srdjan Capkun, an assistant professor of computer science in the system security group at ETH Zurich in Switzerland, who led the work, says he was inspired to investigate the security of keyless entry and start systems after buying a car that had one.

Capkun and Aurélien Francillon and Boris Danev, both researchers in the same institution, examined 10 car models from the eight manufacturers.

They were able to access all 10 and drive them away by intercepting and relaying signals from the cars to their wireless keys.

While they could relay the signals from the key back to the car as well, usually they did not need to because the key transmits its signals up to around 100 meters.

The attack works no matter what cryptography and protocols the key and car use to communicate with each other.

Normally, when a wireless key is within a few meters of the right car, it detects a low-powered signal that causes it to issue a command that opens the car enable the ignition.

The researchers used a pair of antennas to transmit these signals from the car to the key when the key was farther away, tricking the car into opening without the ordinary authorization.

One antenna needs to be very close to the car, and one needs to be within eight meters of the key.

The researchers came up with two versions of the attack. In one, they ran a cable from near the car to near the key and used it to transmit the signals.

They conducted the other wirelessly. Francillon says that the materials for the wired attack cost about $50, and those for the wireless attack cost between $100 and $1,000, depending on the electronic components used.

The researchers tested a few scenarios. An attacker could watch a parking lot and have an accomplice watch as car owners as entered a nearby store.

The accomplice would only need to be within eight meters of the targeted owner's key fob, making it easy to avoid arousing suspicion.

In another scenario, a car owner might leave a car key on a table near a window. An antenna placed outside the house was able to communicate with the key, allowing the researchers then to start the car parked out front and drive away.


A car won't open or start if the signal from its key takes too long to arrive, so the researchers devised a way to speed communication between their antennas.

Most relay attacks require the signals to be converted from analog to digital and back, which takes time.

The researchers were able to keep the signals in analog format, which reduced their delay from microseconds to nanoseconds and made their attack more difficult to detect.

The researchers suggest things that car owners and manufacturers can do to protect themselves. Car owners can shield their keys when they're not in use, to prevent attackers from communicating with them.

Alternatively, manufacturers could add a button to fobs that would allow owners to deactivate and reactivate them.

Capkun worries, however, that these types of solutions detract from the convenience that makes passive keyless entry systems worthwhile.

Ultimately, he says, manufacturers will need to add secure technology that allows the car to confirm that the key is in fact nearby. "I don't see a way around it," Capkun says. His group is actively working on protocols that would accomplish this.

David Wagner, a professor of computer science at the University of California at Berkeley who has studied the cryptographic systems used in keyless entry systems, says the research "should help car manufacturers improve auto security systems in the future."

Wagner doesn't think the research ought to make car owners anxious. "There are probably easier ways to steal cars," he says. But, he adds, a "nasty aspect of high-tech car theft" is that "it doesn't leave any sign of forced entry," so if a thief did use this method to steal a car, he says, it might be hard for police and insurance companies to get sufficient evidence of what happened. Wagner believes that manufacturers, police, and insurance companies all need to prepare for this eventuality.

"Automobiles are a key example of a system that is pervasively computerized," so they need to be thoroughly examined to ensure they are secure, says Tadayoshi Kohno, an assistant professor of computer science at the University of Washington.

Kohno helped form the Center for Automotive Embedded Systems Security, which is dedicated to identifying and solving security problems with car security systems before they cause problems in the real.