Redundant array of hard disks and disks

Source: Internet
Author: User

This blog is located at: http://xubenbenhit.github.io/HardDiskAndRAID.html

First of all, the day before Christmas has been looking at some papers, disk-related, today simply one-time write finished, otherwise read and forget.

1. HDD

Hard disk basic knowledge will not repeat, what magnetic head track sector and so on, see at a glance, do not know the words of their own reading.


Then one thing to make clear is that the disk guarantees that the update operation for the sector is atomic . Each write sector is either fully written or not written in.
Let's write some disk scheduling algorithms. Dispatch, which means that if there are multiple requests, the disk processes the requests in turn. There is a big guideline for short-duration requests to be executed first, which is well understood, after all, to minimize the average wait time for all requests.Shortest However, this is hard to do because it is difficult to know in advance what time is required to execute a request. Thus, the following approximate algorithms are available:

  • Shortest Seek time First (SSTF)
    This is, the next disk command to execute is to select the most recent track request command, but this is also difficult to do, because the operating system does not see the track, it does not know the space geometry of the disk, so there is actually an alternative,Nearst-block-first (NBF) , the closest physical address is executed first.
    Sounds this NBF dispatch should be good, but there is a special case, that is, the distance from the current head position of the disk request may be "forever" can not be dispatched to. This is the "hunger" problem that often needs to be considered in scheduling.

  • Elevator
    This is the lift algorithm. All current disk request commands are executed according to NBF schedule, and the disk requests received during execution are temporarily not processed. This solves the hunger problem above.

  • Shortest positioning time First (SPTF)

    This, considering the actual disk addressing time, because your physical address is similar does not mean that the head addressing the short time required, but also to consider a disk steering problem. This is because in the present disk, in general, the need for addressing the magnetic arm movement time and disk rotation time is quite, so, you need to consider the disk steering. Of course, about the disk steering these, to the OS to do is too delicate and tedious. So actually when it comes to operation:
    First, the OS according to its own scheduling algorithm to give a few candidates, and then to the disk's own scheduling algorithm (SPTF) to specific scheduling, and second, disk scheduling also do I/O merging operations, for example, there are two requests to request two disk blocks respectively, The two disk blocks are contiguous, so the two disk requests can be merged, and finally, the disk does not say that no rest is required as long as there is a request, in fact, it may be a little better (anticipatory disk scheduling), of course, These designs need to be very careful, not so simple, there is a concept here.

2. Redundant array of Inexpensive disks (RAIDs)

  The English full name of RAID is redundant Arrays of inexpensive Disks. A disk array is a way of connecting several disks together, allowing users to access them in parallel for increased efficiency. The main purpose of the redundant array design is to provide some form of redundancy to enhance the security of the array, not to say that a lot of disk as long as there is a bad data will cause loss.
Come directly, here is raid0,raid1,raid4,raid5:

    • RAID0
      This is the simplest, original array, there is no redundancy, so any one disk bad data will be a problem, direct. The a,b,c,d in the figure refers to a disk block, the same as below.
          

    • RAID1

      This, in fact, is the usual sense of the mirror, divided into two, the following is RAID10,
        
      This is RAID01,

      See the difference, the design of the mirror is more reliable, at least a disk is not a bad thing, and in the best case, half the number of disks is not good.

    • RAID4
      Let's look directly at the chart:

      Haha, more than a check disk, the data of this disk is how to come? The data of the first three disks can be computed by the bitwise XOR operation to verify the data of the disk. This has the advantage that any disk is damaged, we can use the remaining three disks through the bit XOR or operation to recover, bad bar. However, this design has a drawback, each time you write data need to also update the corresponding check disk data, the officer Test block uniformly placed on the check disk, it means that each write operation needs to access the check disk, so that the parallel writing operation does not exist, so the smart people designed RAID5.

    • RAID5
      Let's look directly at the chart:
          

      Here are some of the levels of RAID read and write efficiency bar, anti-damage capability has been said before. Well, it's too complicated to say, I'll leave a reference in the back, here it's straight to the conclusion, check it out.

3. References
?
  1. Http://pages.cs.wisc.edu/~remzi/OSTEP/file-raid.pdf
  2. Http://pages.cs.wisc.edu/~remzi/OSTEP/file-disks.pdf
  3. http://www.thegeekstuff.com/2010/08/raid-levels-tutorial/
  4. http://www.thegeekstuff.com/2011/10/raid10-vs-raid01/
  5. http://www.thegeekstuff.com/2011/11/raid2-raid3-raid4-raid6/
?

Redundant array of hard disks and disks

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.