RA(4) RA(4) NAME ra - DEC MSCP disks (RA60, RA80, RA81, RA90) DESCRIPTION Ra devices occupy disk drives conforming to DEC's Mass Stor- age Control Protocol standard: drives such as the RA81 con- nected via controllers such as the UDA50. Files with minor device numbers 0 through 7 refer to different sections of drive 0, minor devices 8 through 16 refer to drive 1, and so on up to 63 (8 drives). Normally the disk is accessed in 1024-byte blocks (1K). If 64 is added to the minor device number, 4096-byte blocks (4K) are used instead. A 4K device mounted as a file system is bitmapped; see filsys(5). Conventionally the files are given names like `ra37' for section 7 of drive 3. There are no name rules distinguish- ing 1024-byte files from 4096-byte files; in practice the files are almost always the 4096-byte kind. The start and size of the sections of each drive are as fol- lows. Sizes are measured in 512-byte hardware sectors. disk start length 0 0 10240 1 10240 20480 2 30720 249848 3 280568 249848 4 530416 249848 5 780264 arbitrarily large 6 30720 749544 7 0 arbitrarily large The `arbitrarily large' sections reach to the end of the disk. Rarct will display disk sizes; see rarepl(8). For example, an RA81 has 891072 sectors, so section 7 is that size, and section 5 is 891072-780264=110808 sectors. An RA90 has 2376153 sectors; section 7 is that size, section 5 is 2376153-780264=1595889 sectors. For other disks, run rarct and do the arithmetic. The ra files discussed above access the disk via the system's normal buffering mechanism and may be read and written without regard to physical disk records. There is also a `raw' interface which provides for direct transmis- sion between the disk and the user's read or write buffer. A single read or write call results in exactly one I/O oper- ation and therefore raw I/O is considerably more efficient when many words are transmitted. The names of the raw files RA(4) RA(4) begin with `rra' and end with a number which selects the same disk as the corresponding `ra' file. In raw I/O the buffer must begin on a word boundary, and counts should be a multiple of 512 bytes (a disk block). Likewise lseek(2) calls should specify a multiple of 512 bytes. Several ioctl(2) calls apply to the raw devices. UIOCHAR The third argument to ioctl points to an object to be filled with drive parameters: struct ud_unit { daddr_t radsize; /* disk size, sectors */ daddr_t rctsize; /* RCT size, including pad */ long medium; /* medium id */ short tracksz; /* sectors per track */ short groupsz; /* tracks per group */ short cylsz; /* groups per cylinder */ char rbns; /* RBNs per track */ char copies; /* number of RCT copies */ }; UIORRCT The third argument points to an object of type struct ud_rctbuf { caddr_t buf; int lbn; }; buf points to a 512-byte buffer, into which block lbn of the replacement and caching table (RCT) is read. As many copies of the RCT as necessary are examined to find a readable copy of the block. UIOWRCT The third argument is like that of UIORRCT. Block lbn of the RCT is written in all copies. UIOREPL The third argument points to an object of type: struct ud_repl { daddr_t replbn; /* good block */ daddr_t lbn; /* bad block */ short prim; /* nonzero if primary replacement */ }; A `replace' command is sent to the controller, requesting that attempts to access logical block lbn henceforth be revectored to replacement block replbn. Prim should be set nonzero if and only if replbn is the primary replacement block for lbn. UIOSPDW Arrange that the disk drive will spin down when the last file using it is closed. UIORST Reset the controller to which this disk is con- nected. Any pending operations are abandoned and return an error. FILES SEE ALSO RA(4) RA(4) rarepl(8) MSCP Basic Disk Functions Manual DEC Standard Disk Format Specification BUGS In raw I/O read(2) and write truncate file offsets to 512- byte block boundaries, and write scribbles on the tail of incomplete blocks. Thus, in programs that are likely to access raw devices, read, write and lseek(2) should always deal in 512-byte multiples. UIORRCT and UIOWRCT will misbehave if invoked on a section that doesn't start at the beginning of the disk. Section 7 (the whole disk) is the best choice. The 1K/4K flag bit in the device number is unfortunate.