Page 154 - DCAP106_OPERATING_SYSTEM_TOOLS
P. 154
Unit 9: The File System
/dev/sda7 on /home type ext3 (rw,noatime) Notes
none on /dev/shm type tmpfs (rw)
/dev/sda1 on /mnt/data type ext3 (rw,noatime)
usbfs on /proc/bus/usb type usbfs (rw,noexec,nosuid,devmode=0664,devgid=85)
It can be seen that all partitions are typed as ext3. But what are those other file systems that you
notice? T hese are discussed below.
z z Proc: It is a special file system which doesn’t exist on a device. However, it is a kind of
gateway to the Linux kernel. Everything you see below /proc is something the kernel
displays the moment you read it. It is a way to communicate with the kernel (and vice versa)
using a very simple interface: file reading and file writing, something well supported.
proc is known to be a pseudo file system: it does not contain real files, but runtime
information.
z z Sysfs: It is a special file system similar to proc. It doesn’t exist on a device, and is a sort of
gateway to the Linux kernel. It varies from proc in the way it is programmed as well as
structured: sysfs is more structured and tailored towards computer-based parsing of the
files and directories, whereas proc is more structured and tailored towards human-based
reading/writing to the files and directories.
The idea is that proc will eventually disappear and be fully replaced by the sysfs file system.
Similar to /proc, sysfs is known to be a pseudo file system.
z z Tmpfs: It is a temporary file system. The contents of this file system is stored in memory
and not on a persistent disk. As such, its storage is generally very quick.
In Linux, we use tmpfs for things like the device files in /dev and /tmp.
z z Devpts: It is a pseudo file system similar to proc as well as sysfs. It includes device files
used for terminal emulation. Earlier, those device files were created statically, which
caused most distributions to allocate a lot of terminal emulation device files (as it is difficult
to know how many of those emulations a user would start at any point in time). To manage
those device files better, a pseudo file system is developed that creates and destroys the
device files as they are needed.
z z Usbfs: It is also a pseudo file system and we can compare it with devpts. It also includes
files which are created or destroyed as USB devices are added or removed from the system.
However, unlike devpts, it doesn’t create device files, but pseudo files that can be used to
interact with the USB device.
Task Compare and contrast tmpfs and sysfs.
Partitions and Disks
Every hardware device of the Linux system is represented by a device file inside the /dev location.
Partitions and disks are no exception.
Example: As an example, let us take a serial ATA hard disk.
A SATA disk driver internally uses the SCSI layer to represent and access data. As such, a SATA
device is represented as a SCSI device. The first SATA disk on your system is represented as
/dev/sda, its first partition as /dev/sda1. You could read sda1 backwards as: “1st partition (1)
on the first (a) scsi device (sd)”.
LOVELY PROFESSIONAL UNIVERSITY 147