Parallel ATA, Serial ATA, SCSI under Linux .. basics

It’s not possible to go through device management in Linux without saying a word about ATA (Advanced Technology Attachement) and SCSI (Small Computer System Interface) buses…. and of course about USB, but not in this post.

So … ATA, which is an interface standard for connecting storage devices and has been invented by IBM. But its derivate, widely known in the world of x86, is PATA (Parallel ATA) whose first version developped by Western Digital and named IDE (Integrated Drive Electronics), also a very popular acronym.

Which were its characteristics, or better said which were its drawbacks and why currently is only history?

One of the embarassing things when using PATA was that the motherboards supported only a limited number of PATA slots  and … if you wanted to attach more disks to the system, you had to connect two disks on the same cable. This implied setting master and slave disks which had to be done by setting jumpers (which was quite embarassing)

With the advent of Serial ATA, motherboards supported many more slots, so only one disk can be connected per cable, so you should not care anymore about masters, slaves’ configurations …

One thing that surprised me long time was … how could a parallel standard be slower than a serial one? Also how can a serial standard displace a parallel one? I mean, at a first glance it sounds obvious … parallel should be faster than serial 🙂

The answer resides in the technology and I guess is far more complicated then the purpose of this post, but generally the biggest problem/challenge with PATA was that is quite difficult to ensure that all the parallel signals arrive at destination at the same clock edge. If this dopes not happen then the receiving part signals a tranmission error. People are commonly talking of PATA bandwidths of 16-133 MBps and of SATA bandwidths of 187-375 MBps, but you should bear in mind that these are far from the real throughput and SATA is NOT inherently faster than PATA. So … I would NOT go saying that “the most important advantage of Serial ATA is the data transfer rate”

One of the main advantages of SATA, overwhelmingly important for PC manufacturers,  is the size of the cables. These are thiner and easier to be assembled, also leaving more space, meaning more room for cooling airflow.

Another big advantage of Serial ATA over Parallel one is that it offers support for hot-pluggeable connectivity, disks can be added and removed while the system is still powered ON.

Now .. what about SCSI? This is a set of standards and since its public disclosure, in 1981, there have been three major releases from ANSI: SCSI-1 (currently withdrawn), SCSI-2, approved in 1994 and SCSI-3, which indeed is a set of standards (earlier SCSI standards have been embodied into SCSI Parallel Interface – which in fact reveals us the  parallel nature of this  standard, like PATA, and Fiber Channel was introduced, supporting data transfer bandwidths up to 2GBps at distances up to several kilometers) .

Compared to previous ones  this one did not gained a lot of field due to its cost, still prohibitive, but can largely be found on high-end systems, like servers, workstations …

One of the interesting things about SCSI is that these devices are NOT normally detected by usual x86 BIOS. This is why sometimes SCSI disks come with a PC card, or a host adapter, that is connected to the motherboard. These boards support a BIOS chip, dedicated for SCSI devices and usually at boot time a key, or a key configuration is required, in order to enter the SCSI BIOS.

SCSI disks that do NOT have BIOS can still be attached to PCs but they cannot be used as boot devices.

Coming back to IDE devices I have to say that these are mounted by Linux into /dev as /dev/hda, /dev/hdb … all of them starting with h , unlike SATA and SCSI devices which are mounted as /dev/sda, /dev/sdb/ In case of IDE  devices it is quite simple to identify how Linux mapped the devices, since a controller can support a maximum of two devices. As a consequence the first drive on the first controller, meaning the master, will always be mapped as /dev/hda, then the second disk on the first controller as /dev/hdb, then the first disk on second controller as /dev/hdc and so on …

With the advent of SATA and SCSI things complicate a little bit especially because manmy more devices can be attached to a SCSI cable. One way to find info about SCSI devices attached to system is to have a look into /proc/scsi/scsi , using cat utility, or, if you have a more recent system, by using SCSI generic driver. Part of the sg driver are two utilities that can help you in identifying and mapping the devices: sg_map and sginfo.

Also if you want to find out many more about how is SCSI implemented under Linux, how the two evolved together, what is the trend and perpespectives of a better and smoother integration of SCSI into Linux, I really recommend you this tutorial from IBM.

Advertisements

3 Responses to Parallel ATA, Serial ATA, SCSI under Linux .. basics

  1. vasiauvi says:

    De cand esti pasionat de Linux, Bogdan?

    • Cam de anu trecut de prin Octombrie … dar mai mult m’a interesat Linux pentru Embedded -> RTAI, mai putin Linux pt desktop. Oricum trebuie sa am ceva cunostintze de baza si am zis sa incerc sa iau o atestare … cum LPIC-1 e cam cel mai la indemana (si ca pretz si ca cerintze, si ca sunt centre de testare cam peste tot, nush in ROmania cum e treaba asta … dar aicea e in Barcelona) m’am apukat sa invatz pt asta. Partea nasoala e ca din diverse motive tot intrerup procesu de invatzare 🙂 … dar sper ca pana la toamna sa apuk sa dau examenu asta.

  2. With everything which seems to be developing inside this subject material, your opinions tend to be fairly radical. Having said that, I am sorry, but I do not subscribe to your whole suggestion, all be it radical none the less. It seems to everybody that your comments are actually not entirely justified and in fact you are generally yourself not even entirely certain of the point. In any event I did appreciate reading it.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: