Physical Devices  «Prev  Next»
Lesson 12

Device Disks File Systems Conclusion

In the Unix operating system, special device files are used to represent physical devices such as hard drives, CD-ROMs, printers, and network interfaces. These device files provide a standardized way for applications and system utilities to interact with physical devices, regardless of the specific hardware being used. When a physical device is connected to a Unix system, the system creates a corresponding special device file that represents the device. This device file is typically located in the /dev directory and has a unique name that identifies the device.
Applications and system utilities can then access the physical device by interacting with the special device file, using standard Unix system calls such as read(), write(), open(), and ioctl(). The special device file acts as an intermediary between the application or utility and the physical device, providing a layer of abstraction that simplifies the programming interface and enables consistent device access across different types of hardware. Overall, special device files and physical devices are closely linked in the Unix operating system, with the former serving as a standardized interface to the latter. This abstraction layer simplifies device management and makes it easier for applications and system utilities to interact with a wide range of physical devices, without needing to understand the specifics of each individual device.
In this module, we examined in more detail the relationship between special device files and physical devices, with a special emphasis on disks and disk partitions. In this area, there is wide variation among different versions of UNIX, and even different machines running the same version, considering that we are close to the underlying hardware. You are now able to:
  1. Locate the special device files associated to hard disks on your system
  2. Manipulate hard links on your system
  3. Describe the relationship of inodes and directory entries
  4. Mount and unmount partitions, and configure your system to mount and unmount partitions automatically at boot time
  5. Describe the significance of the Logical Volume Manager on those systems, such as AIX, where it is used instead of the classical approach of disk artitions
  6. Describe the layout of a typical UNIX filesystem

Key terms<

In this module, we used the following terms:
  1. filesystem: A UNIX filesystem is a directory hierarchy. A UNIX system has one overall filesystem's with its root at which may be made up of a number of other filesystems.
  2. inode: An inode is the physical representation of a file on the disk. Each inode, and therefore each file, has a number that uniquely identifies it. These inode numbers can be viewed with the -i option to the ls command.
  3. logical volume: In a logical volume system, groups of physical disks are combined together into "volume groups." These volume groups can be divided up into "logical volumes." These logical volumes may span multiple physical disks, but they act like partitions in the old sense of the word. A logical volume, for example, contains a filesystem. In the logical volume world, you mount and unmount logical volumes, not disk partitions.
  4. major device number: Device files are categorized as "block" or "character" and have associated major and minor numbers. The major numbers typically group the devices into subsystems (IDE devices, SCSI devices, and so on).
  5. minor device number: Device files are categorized as ""block"" or ""character"" and have associated major and minor numbers. The minor numbers identify the individual devices within the subsystem.
  6. superblock: The superblock contains high-level information about the disk partition, such as its label. It also contains tables of information laying out available space on the partition. Every filesystem has one active superblock, but the information there is so critical that the commonly used UNIX filesystems replicate the superblock data in other locations on the disk.

Commands

In this module, we discussed the following commands:
Command Purpose
eject Ejects removable media (Solaris).
fsck Checks a filesystem for consistency.
fuser Checks to see which processes and users have open files or are otherwise using a partition.
mkfs Creates a new filesystem on a formatted partition (use with care).
mount Attaches a device to the filesystem.
newfs Creates a new filesystem (Solaris).
umount Removes a device from the filesystem.
volcheck Verifies that a device has been mounted (Solaris).

System configuration files

In this module, we discussed the different names for the system configuration files on various versions of UNIX.
File Purpose
/etc/fstab (Linux, SunOS)
/etc/vfstab (Solaris)
/etc/checklist (HP-UX)
/etc/filesystems (AIX)
Describes partitions and mount points. Controls which file systems are mounted at boot time. Format varies a bit from system to system, but underlying information is the same:
  1. Device
  2. Mount-point
  3. Mount options
  4. fsck pass
    (usually 1=root, 2=other, 0=don't check)
  5. Information for dump program (maybe)

Devices Disks File Systems - Quiz

Click the Quiz link below to take a multiple-choice quiz covering what you learned in this module.
Devices Disks File Systems - Quiz