Background


Let's examine the following key filesystems and disk partitions concepts before getting into details: Intelligent/Integrated Drive Electronics (IDE), SCSI, and bit functions. Simply saying that data resides on a platter in the form of magnetic polarization of the surface greatly oversimplifies the nature of the beast.

IDE and SCSI

IDE is perhaps the most common drive type used by Linux, although it is slowly losing ground to SCSI in the Linux market because of the increasing popularity of large storage arrays. SCSI has not been around much longer than IDE; it was renamed around 1981/1982 from Shugart Associates System Interface (SASI) to Small Computer Systems Interface (SCSI). The IBM Mainframe 360 had the capability to speak to several devices simultaneously on any given I/O bus as early as 1960, so it could be said that SCSI started then. No matter the case, with more and more companies using storage consolidation, SCSI disk arrays are truly becoming commonplace.

Bit Calculation

Another key concept is bit calculation. Regardless of SCSI, IDE, or other storage medium you choose, you should always start with the basics: the calculation of bits and bytes. The best way to depict the combinations is through a chart, as shown in Table 6-1.

Table 6-1. Bit and Byte Calculations

8 bits

1 byte

1024 byte

1 Kilobyte (KB)

1024 Kilobytes

1 Megabyte (MB)

1024 Megabytes

1 Gigabyte (GB)

1024 Gigabytes

1 Terabyte (TB)

1024 Terabytes

1 Pentabyte (PB)

1024 Pentabytes

1 Exabyte (EB)


Eight bits written as 00000000 or 0000 0000 defines an eight-bit address with 256 possible combinations, as listed in Table 6-2.

Table 6-2. Bit Combinations

Bit

1

1

1

1

1

1

1

1

Baseexponent

27

26

25

24

23

22

21

20

Value

128

64

32

16

8

4

2

1


Each bit has a value of either "0" for off or "1" for on, instructing a virtual gate/door to allow 5 volts DC (power-conservative machines and newer technologies use 3.2 volts DC) to pass. Given that a bit only has two states (on or off) rather simplifies the importance of a single entity.

The following is a list of key terms and their definitions to help you understand the data on a platter discussed later in this chapter.

  • sBitSingle binary element defined as on or off (1 or 0, respectively).

  • NibbleFour bits.

  • ByteTwo nibbles, eight bits, or a character.

  • WordSixteen bits, or two bytes. # on most hardware implementations.

Other terms, such as "binary," "octal hex/decimal," and "ASCI," are just other ways to represent the same value under different systems. Table 6-3 lists binary value "bits" converted to decimal and hexadecimal values.

Table 6-3. Converted Binary Values

Binary (4 bits)

Decimal

Hexadecimal

Octal

0000

0

0

0

0001

1

1

1

0010

2

2

2

0011

3

3

3

0100

4

4

4

0101

5

5

5

0110

6

6

6

0111

7

7

7

1000

8

8

10

1001

9

9

11

1010

10

A

12

1011

11

B

13

1100

12

C

14

1101

13

D

15

1110

14

E

16

1111

15

F

17

0001 0000 (8 bits)

16

10

20

0010 0000 (8 bits)

17

11

21

0011 0000 (8 bits)

18

12

22

0100 0000 (8 bits)

19

13

23


Each bit has a mathematical value defined as 2X, whereby we define the base value of every bit equal to numeric value 2 multiplied by an exponent X. The combined value of the eight bits depends on the order in which they are interpreted, "left to right" or "right to left."

The values of bits are calculated utilizing the Endian order, which is the direction the bits are read. Binary data is written and calculated by the majority of humans in most significant bit (MSB), LEFT, to least significant bit (LSB), RIGHT, order. Starting right to left, the bit values have exponential values beginning with zero and incrementing to seven. Although the exponent values change, the base value always remains at two. Note that the hardware platform determines the default bit order, which is referred to as "Little Endian or Big Endian." The following shows the MSB and LSB difference through od and bvi:

"od -h /dev/disk_device_file | head" "dd if=/dev/disk_device of=/tmp/disk_device.out bs=512 count=1" utilize "bvi /tmp/disk_device.out". ...


"0001 0e83 143f 003f 0000 4d46 0000 0000"  By od -h "0100 830E 3F14 3F00 0000 464D 0000 8000" By bvi ...


When reviewing binary data in Hex, we use the nibbles to perform calculations at great speed. Each nibble has a decimal value of 0 to 15 or Hex 0 to F.

The following is an example of a binary value being converted into a Hex value:

1010 1001 = A9

This conversion is a two-step process. First, we need to address the left nibble. Break down the left nibble,"MSB," by doing the following:

23 22 21 20

on, off, on, off

8, 0, 2, 0, = decimal 10, or Hex A

Then do the same for the right nibble, "LSB," to achieve a value of 9 in Hex, as listed in Table 6-3.



Linux Troubleshooting for System Administrators and Power Users
Real World Mac Maintenance and Backups
ISBN: 131855158
EAN: 2147483647
Year: 2004
Pages: 129
Authors: Joe Kissell

Similar book on Amazon

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net