130 likes | 300 Views
University Of Palestine. Essential System Administration 3rd Edition. Chapter 2 The Unix Way(Cont.). Ch2. University Of Palestine. 2.3.1 An In-Depth Device Example: Disks. Unix organizes all user-accessible files into a single hierarchical directory structure.
E N D
University Of Palestine Essential System Administration 3rd Edition Chapter 2 The Unix Way(Cont.)
Ch2 University Of Palestine 2.3.1 An In-Depth Device Example: Disks • Unix organizes all user-accessible files into a single hierarchical directory structure. • On most Unix systems, disks are divided into one or more fixed-size partitions. • The disk partition containing the root filesystem is called the root partition and sometimes the root disk. • The root filesystem is the first one mounted, early in the Unix boot process. • The remaining ones are mounted afterwards.
Ch2 University Of Palestine 2.3.1 Disks (Cont.) • On many operating systems, mounting is making the device's contents available. • For Unix, it means mapping pathnames to the correct physical device and data blocks. • Disk partitions may be accessed in two modes: • Block mode and Raw (or character) mode. • Different special files are used from each mode.
Ch2 University Of Palestine 2.3.1 Disks (Cont.) • Hardware devices can generally be categorized into: • Random access devices/Block Devices (like disk and tape drives) • Serial devices like/Character Devices (mouse devices, sound cards, and terminals) • Random access devices are usually accessed in large contiguous blocks of data that are stored persistently. • brw-r----- 1 root disk 3,64 Apr 27 1995 /dev/hdb • b on the far left of the listing, means that your hard disk is a block device.
Ch2 University Of Palestine 2.3.1 Disks (Cont.) • Serial devices, on the other hand, are accessed one byte at a time. Data can be read or written only once. • For example, after a byte has been read from your mouse, the same byte cannot be read by some other program. • crw-r--r-- 1 root sys 14, 3 Jul 18 1994 /dev/dsp • Con the far left of the listing, means that your hard disk is a Character device.
Ch2 University Of Palestine 2.3.1 Disks (Cont.) • As an example of the use of special files to access disk partitions, consider the mount commands below: • # mount /dev/disk0a / • # mount /dev/disk1e /home • The command to mount a disk partition needs to specify the physical disk partition to be mounted (mount's first argument) and the location to place it in the filesystem. • The mount command is discussed in greater detail in Chapter 10.
Ch2 University Of Palestine 2.3.2 Special Files for Other Devices • Other device types have special files named differently, but they follow the same basic conventions. • Some of the most common are summarized in Table 2-9:
Ch2 University Of Palestine
Ch2 University Of Palestine 2.3.2.1 Commands for listing the devices on a system • Most Unix versions provide commands that make it easy to quickly determine what devices are present on the system, as well as their current status. • The following Table (Table 2-10) lists the commands for the different systems:
Ch2 University Of Palestine
Ch2 University Of Palestine 2.3.3 The Unix Filesystem Layout