1. What is the difference between primary storage and secondary storage? Primary Storage is … - Limited , Volatile, Expensive - Fast (accessed directly from the CPU) - Retrieve character in nanoseconds Secondary Storage is … - Extendible, Permanent , Cheap - Slow (must be copied to main memory) - Retrieve character in msec. 2. What are the two major types of secondary storage devices? a. Direct Access Storage Devices (DASDs) - Offer high storage capacity and low cost - Data stored as magnetized areas on magnetic platters surfaces - Each disk has one or more platters - A disk pack contains several magnetic platters connected to a rotating spindle Examples: - Magnetic Disks Hard Disks (high capacity, low cost per bit) - Optical Disks CD-ROM, DVD-ROM (Read-only/write-once, holds a lot of data, Cheap) b. – Serial Devices - Magnetic Tapes 3. List the common types of secondary storage devices? a. Direct Access Storage Devices (DASDs) Magnetic Disks Hard Disks and optical disks ( CD-ROMs and DVDs) b. Serial Devices Magnetic Tape. 4. Describe the structure of the magnetic disk? Magnetic disks support direct access to a desired location and consisted of: - Disk blocks - Tracks - Platters - Cylinder - Sectors - Disk heads - Disk Controller 5. Describe how the data can be organized in a disk? - The information is stored on successive tracks on the surface of the disk Each track is divided into a number of sectors A sector is smallest addressable part of a disk - A cylinder is a set of tracks that are directly above and below each other. The information on one cylinder can be accessed without moving the arm. Moving this arm is called seeking. 6. How to calculate disk capacity? - Drive capacity = number of cylinders × cylinder capacity Number of cylinders = number of tracks in a surface Cylinder capacity = number of surfaces × track capacity Track capacity = number of sector per track × bytes per sector 7. How many cylinders to store a file with 20,000 fixed length records of 256 bytes each on a disk with 512 bytes per sector, 40 sectors per disk and 11 tracks per cylinder? Answer – - File Size = Number of records * record size = 20,000 * 256 = 5,120,000 bytes - Number of sectors = File Size / Sector size = 5,120,000 / 512 = 10,000 sectors - Number of tracks = Number of sectors / sectors per track = 10,000 / 40 = 250 tracks - Number of cylinder = Tracks / tracks per cylinder = 250 / 11 = 22.72 cylinders This file requires 22.72 physically contiguous cylinders. 8. What are Blocks? And why are they important? - A track is divided into blocks. Block size is fixed and ranges from 512 bytes to 4 kB. Importance :the blocks is transferred between disk and main memory for processing 9. What is the difference between a cluster and FAT? - A cluster is a fixed number of contiguous sectors. The file manager map the logical sectors to the physical clusters using a file allocation table (FAT) The file manager allocates an integer number of clusters to a file. The FAT contains a linked list of all the clusters in a file, ordered according to the logical order of the sectors in a cluster With each entry in the FAT is an entry giving the physical location of the cluster 10. How to choose cluster size? - The OS system administrator choose the cluster size. When to use large cluster size? - When disks contain large files processed sequentially. When to use Small cluster size? - When disks contain small files accessed randomly. 11. How can operating system Read a particular byte from a disk file? - The operating system find the correct surface, track and sector , reads the entire sector into a special area of memory called buffer And then find the requested byte in the buffer. Suppose we need to store a file with 50,000 fixed length data records on a disk with the following characteristics: - Number of bytes/sector = 512 - Number of sectors / track = 63 - Number of tracks / cylinder = 16 - Number of cylinders = 4096 12. How many cylinders does the file require if each data record requires 256 bytes? Number of sectors for a file = (50000* 256) /512 = 25 000 sector Cylinder size = 16 track * 63 sector * 512 byte = 516096 Cylinders for the file = 50000* 256 / Cylinder size (516096) = 24.8 cylinders 13. How can data organized on disks? Data can be organized on disk in two different ways: - Sectors - User defined blocks. 14. List the different methods used to organize data on sectors for magnetic disks? 1. Physically placement of sector a. Adjacent sectors: fixed size segments of a track used to hold a file b. Interleaving sectors: leave an interval of several fixed sectors between adjacent logical sectors. 2. Clusters - A cluster is a fixed number of contiguous sectors that can be read without additional seek. 3. Extents a. The file consists of contiguous clusters b. If there is not enough contiguous space available. - The file is divided on one or more non-contiguous parts, each part is an extent. 15. Describe how data can be organized on magnetic disk using Blocks? - Tracks are divided into user defined blocks with variable size. Blocks may be fixed length or variable length. Blocks are referred to physical blocks. Example: Disk drive: 20 000 byte / track The amount of space taken by blocks and inter block gaps = 300 byte/block. We need to store file with 100 byte/ record. How many records can be stored per track if the blocking factor is 10 ? if it is 60? a. Blocking factor = 10 Each block holds = 10 (block factor) * 100 (record size) + 300 (block data) = 1300 byte. The number of blocks that can fit on 20 000 track = 20000 / 1300 = 15.38 = 15 block. Number of records can be stored = 15 block * 10 record = 150 record. b. Blocking factor = 60 Each block holds = 60 (block factor) * 100 (record size) + 300 (block data) = 6300 byte. The number of blocks that can fit on 20 000 track = 20000 / 6300 = 3 block. Number of records can be stored = 3 block * 60 record = 180 record. The larger blocking factor can lead to more efficient use of storage 16. List the Magnetic Disk performance Parameters - - - A fast access time - Maximum disk bandwidth. Access time factors include - Seek time (slowest) - Time to position read/write head on track - Search time Rotational delay - Rotate until desired record under read/write head Transfer time (fastest) Seek time is the reason for differences in performance - Minimize seek time - Seek time seek distance File Handling sheet 1. Describe the Logical File Organisation - A file is made up of records containing fields. A record is a collection of data that belongs together o Example: all the data about an individual person. Field: is a data item contains one piece of data, e.g. a date, first name, age. 2. Compare between sequential devices and random access devices? Sequential Device Slow. Inexpensive. Access time is dependent on current position. Random or Direct Access Fast Expensive. Have an almost constant access time. 3. What are the methods of accessing data on secondary storage devices? 1. Serial Access - - Each record is stored, one after the other, with no regard to any logical order. It is the simplest form of file organization. 001 1. 2. 3. 4. 003 006 004 002 005 Features of Serial Files Easy to implement on magnetic tape. Slow access. Is suitable for: Batch search servicing (group search). It is not a suitable: On-line access because it is too slow. 2. Sequential Access - Records are stored one after the other but are sorted using a key sequence. Features of Sequential Files - Records stored in pre-defined order. - Suited to magnetic tape. - Update and insert is more complicated to maintain the sequential order of records. - Very useful for transaction processing (Payroll systems, calculating the student's grades) Slow access time. 3. Random or Direct Access - Records are accessed directly, allowing records to be read in any order. You can read or write information anywhere in the file. Suitable for Magnetic disk storage. 4. Indexed Sequential - - Similar in principle to the sequential access file, and the index of a book. Access records by using a separate index file. An indexed file system consists of a pair of files: - One holding the data - One storing an index to that data. The index file will store the addresses of the records stored on the main file. There may be more than one index created for a data file. - Example: A library may have its books stored on computer with: - Indices - Author, - Subject - Class mark. - There are two types of indexed files: Fully Indexed Indexed Sequential - - Advantages of Indexed Sequential Files o Allows records to be accessed directly or sequentially. o Direct access ability provides vastly superior (average) access times. Disadvantages of Indexed Sequential Files o The fact that several tables must be stored for the index makes for a considerable storage overhead. 4. What are the major Criteria's for selecting file organization? There are four main criteria to be considered when choosing a file organisation technique: File use ratio (hit rate) File volatility File size User requirements 1. File use ratio (file activity) - File-use ratio (hit rate): If we divide the number of records that are accessed (within a specified process or period) by the total number of records in the file. - High file Ratio: The majority of records are used regularly. - Sequential/serial file organisation may be the appropriate method. - If the ratio is low (say 5% to 10%) : the ability to retrieve a desired record quickly is crucial and therefore - Direct file organisation should be recommended: Examples: a. Payroll production: an example of a high activity file. - Organisations production of payroll and payslips is a regular event, which can be either weekly or monthly. - Such an application requires processing of all or nearly all the employee records. - The file-use ratio will be close to or equal to one (100%). - Thus sequential file organisation is preferred. b. Customer accounts in banks: an example of a medium activity file. - Both random and sequential access are required. - Several customers should be able to withdraw cash simultaneously and randomly, - The bank should be able to update all customer accounts periodically by sequential processing. - Indexed sequential file organisation may therefore be the most suited to this type of application. c. Airline ticket reservations: an example of a low activity file. - In most cases only one record is accessed at a time. - This record is required quickly and therefore direct accessing is most appropriate. Calculating the file use ratio To calculate the file use ratio we need to know the number of records accessed and the number of records in file Examples: File has 8,000 records, 250 of which are accessed and updated per week. File use ratio = 250 / 8000 = 0.03125 per week (very low) 4100 records are accessed per week. File use ratio = 4100 / 8000 = 0.5125 per week (medium) If all but 400 were accessed weekly, i.e. 7600 accessed per week. Then: file use ratio = 7600 / 8000 = 0.95 per week (very high) 2. File volatility - How often files require modification and updating, e.g. Insertions and deletions. - Highly volatile files are not usually Direct Access is used, as this would entail excessive overheads in too frequently updating the index and file. - Low volatile: Indexed sequential organization is used when the data is fairly stable. 3. File size When files are large serial/sequential location techniques give longer access times. Thus large files are usually indexed or direct files. 4. User requirements How the user access the records? - Batch access files are use sequential file organisation is likely to be appropriate providing the file activity is reasonable. - Interactive Access use direct access. The type of storage device available. - Magnetic tape will only allow serial/sequential access. - Magnetic disks will use other file organizations. The ease (or complexity) of actually implementing the file organisation technique with the data concerned. Availability/features/cost of software to handle the organisation technique preferred according to other factors. 5. What are the different types of File Content? 1. 2. 3. 4. Private one user files: created to be used by one operator or one user. Private database files: They store data for a group of related users. Public files: shared files. Public database files: public databases. 6. Classify the different types of files according to the function usage? The files in an information system are classified by six functions: 1. 2. 3. 4. 5. 6. 7. Master File. Transaction File. Table File (Lookup file): static data like nationality and city. Report File: a set of data from different sources for display. Control File History File: Backup files from past runs. Batch Processing: processing large amounts of dat.
© Copyright 2026 Paperzz